texts: how to get store configurations from cache in magento 1?

texts:
I'm trying to find out the way to get store configuration values (Mage::getStoreConfig($path, $store)) from cache.
The reason for this is that I don't want to make db connections every time I'm calling the configuration values.
Is there a way to use cache for the said purpose?

thanks


texts: How to send mails by selecting each dropdown value with differenet fields?

texts:
I had created the dropdwon list with lab,pharmacy,food,Gym and Nurse and When I select lab it shows some fields(ex:name,city,location,etc) and when I select pharmacy it shows some fields as(ex:medicine name,name,email) in the same it generates for other dropdown lists also.

I need to send the mails with these information with different body for customer,admin and for provider emails.

But I can send for only for lab and not for others.Please help me.


texts: Magento2.4.2 Email copy of invoice not working

texts:
Users getting invoice on shipping entry - even when the checkbox is unchecked, I have checked Magento\Sales\Model\Order\Email\Sender\InvoiceSender and did not found any such check to prevent the email to the customer.
Is there anything that I can prevent email by default and send only when the checkbox is checked?


texts: How to override definition.xml file in Magento 2?

texts:
I am developing an extension to add another export format option in order toolbar in export button dropdown.

What I found yet is that there are two options here (Sales Order Toolbar) right now:

a) CSV
b) Excel XML

Here I want to add another option here called "MOM" which will create a new csv format of order.

I found that above two options comes from following path:

vendor\magento\module-ui\view\base\ui_component\etc\definition.xml

But I don't know how to override it in my module. I don't want to edit core files.


texts: Add a sql like clause to Filter function

texts:
This is a function of a collection.php

public function setAvailableFilter($customerGroupId, $websiteId, $date = null, $sku=null)
{
    if (is_null($date)) {
        $date = now(true);
    }
    $this->addFieldToFilter('website_ids', array('finset' => $websiteId))
        ->addFieldToFilter('customer_group_ids', array('finset' => $customerGroupId))
        ->addFieldToFilter('is_active', 1);
    $this->getSelect()->where("(from_date IS NULL) OR (DATE(from_date) <= ?)", $date)
        ->where("(to_date IS NULL) OR (DATE(to_date) >= ?)", $date)
        ->where(" conditions_serialized like '%?%'", $sku)
        ->order('sort_order DESC');
    return $this;
}

i added this ->where("conditions_serialized like '%?%'", $sku) but seems produce errors, any one know what the problem about the where clause?


texts: When I want to visit my already installed magento shop the Installation wizard shows up

texts:
I recently tried to move my magento shop from the root to a sub directory.
( I changed the base urls, moved all files and adjusted the .htaccess file).As this didn´t work out I wanted to log in to my mysql data base but seemed to have not the correct password. So I changed the password of the database and also adjusted the local.xml file.
 I also moved the magento files again so that they are in the root directory and again adjusted the .htaccess file, so everything should be as it was, but instead of my shop the Magento Installation Wizard appears.

What does that mean? What am I doing wrong? Please can anybody help me?


texts: Does anyone know how to move hamburger menu before minicart in mobile view as shown below


texts: Magento 2 is only displaying some products on catalog page

texts:
I have 17 products added to my magento store all of which are enabled to display on Catalog and Search, but on the catalog page, only 10 products are being displayed and there isn't any pagination  either to display more products. When I looked at the grid.phtml which loads the products, I see these lines

$block->getProductCollection()->getSize()
$block->getProductCollection()->getItems()

When I echo the output of the getSize(), I get 17 , however when I execute

count($block->getProductCollection()->getItems());

I get only 10. I'm not sure what exactly the issue is and why there is a difference in the two outputs and what I need to do to get all the products listed. I'm using the luma theme and running magento 2.2.5.


texts: Magento 2 : How to Detect Checkout Step Change

texts:
I am trying to figure out the best method of detecting a step change in Magento 2's checkout. For example going from shipping details to payment, or vice versa.

I have done some digging and in vendor/magento/module-checkout/view/frontend/web/js/model/step-navigator.js I can use next() which fires on the continue button, and navigateTo() which fires when a user clicks on the checkoutstep directly - but both methods seem rather hacky, there must be a cleaner way to detect a step change regardless of how and which step.

I was hoping for a stepChange() function or something similar that fires whenever a checkout step change happens.

My question:

What is the best method to trigger my custom JS when a checkout step change occurs?


texts:
I've developed a custom module for magento1.9 , I'm doing the same for magento2 I'm able to have just a grid in admin page, also I have a form in admin page but I'm a bit stopped as I can't understand how to have both form and grid in the same page.
in my module1.9 I've used the renderer way to put a grid with form using this lines of codes

<?php
class Ns_Thorleif_Block_Adminhtml_Commerciaux_Edit_Form_Renderer_Fieldset_Grid extends Varien_Data_Form_Element_Abstract{
    protected $_element;

    public function getElementHtml()
    {
        //return Mage::helper('core')->getLayout()->createBlock('blockname_node/adminhtml_payment_edit_form_renderer_fieldset_customer_grid')->toHtml();
        return Mage::helper('core')->getLayout()->createBlock('thorleif/adminhtml_commerciaux_grid')->toHtml();
    }
}


texts: reindex command generates error: Argument 2 passed to Magento\Catalog\Block\Product\ImageFactory::getLabel()

texts:
When I run reindex command bin/magento index:reindex catalog_data_exporter_categories
I get the following error on console.
Argument 2 passed to Magento\Catalog\Block\Product\ImageFactory::getLabel()
Kindly find the attached image.

I referred this LINK, but I didn't got any solution.
Kindly guide me if anyone faced this issue.
Thanks in advance


texts: when i add new blog error occurs in magento 2

texts:
It displays below error when I add a new blog.
I don't understand why it displays error. Previously add blog is working fine.

There has been an error processing your request
The file was not uploaded.
Error log record number: 452585771340


texts: Magento2 - How to create sitemap pro-grammatically with custom script

texts:
I want to create sitemap pro-grammatically using script,

any one have idea, to create sitemap using API or another way...


texts: Process Payment Using Rest API In Magento 2

texts:
I working on an APIs to create mobile application, everything worked ok,
now I need to pay for the mobile application using Magento 2 rest API.

how can I pay using rest API?

Is there any API available which can process payment and validate payments?

I am new to Magento, I need to pay using credit cards and debit cards using Magento default configurations.

It will be great if anyone can help,

Thanks


texts:
I would like to migrate products from magento 1 to magento 2 using core models instead of the migration toolkit provided by magento.

The reason is that the products need A LOT of modification in the process.

What i'd like to do is write a custom script that handles the models from both stores. So my idea was to do this:

<?php
use Magento\Framework\App\Bootstrap;

require __DIR__ . '/../app/bootstrap.php';

$bootstrap = Bootstrap::create(BP, $_SERVER);
$obj = $bootstrap->getObjectManager();
$state = $obj->get('Magento\Framework\App\State');
$state->setAreaCode('frontend');

$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$resource = $objectManager->get('Magento\Framework\App\ResourceConnection');
$conn = $resource->getConnection();

// pointing to Mage.php from magento 1
require_once('../../www/app/Mage.php');
$app = Mage::app(Mage_Core_Model_App::ADMIN_STORE_ID);
Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);

$products = Mage::getModel('catalog/product')->getCollection();

foreach ($products as $product) {
    echo $product->getId() . "\n";
}

This fails because the BP constant has already been defined in magento 2.

PHP Notice:  Constant BP already defined in /path/to/old/store/app/Mage.php on line 29

Is there a way to use the model api of both magento 1 and magento 2 within one script?


texts: How to create custom “Duplicate” buttons for Adminhtml Edit Form and save custom module in Magento2.?

texts:
How to create custom “Duplicate” buttons for Adminhtml Edit Form save custom module in Magento2.1 and save and saveandcontinue Functionally not change.

Now duplicate button already create and onclick use setLocation but i have from submit so please any idea how to use button event in magento 2.1

        $this->buttonList->add(
            'duplicate',
            [
                'class' => 'save',
                'label' => __('Duplicate'),
                'onclick' => 'setLocation("' . $duplicateUrl . '")'
            ],
            12 // sort order
        );


texts:
My controller is not being read by Magento though and I can't find my error. I would like it to extend the admin sales order info controller and pass a variable to the renderLayout().

config.xml:

<config>
    <-- other -->
    <admin>
        <routers>
            <adminhtml>
                <args>
                    <modules>
                        <mymodule before="Mage_Adminhtml">MyApp_MyModule_Adminhtml</mymodule>
                    </modules>
                </args>
            </adminhtml>
        </routers>
    </admin>
    <!--other-->
</config>

MyApp\MyModule\controllers\IndexController.php:

class MyApp_MyModule_Adminhtml_IndexController extends Mage_Adminhtml_Controller_Action {
    public function indexAction()
    {
        $this->loadLayout();
        Mage::helper("adminhtml")->getUrl("myapp_mymodule/index/index");
        $this->renderLayout();
    }
}


texts:
I am trying to filter product collection by ids if I use below code, the filter works ok and the product shows.

$this->_productCollection
            ->addFieldToFilter('entity_id',array('in'=> 460 ));

The problem is that if I set an array to this code and try to filter, I keep getting empty collection.

$getData = array(460);
$this->_productCollection
            ->addFieldToFilter('entity_id',array('in'=> $getData ));

I've already tried setting array like the following

$getData[$a]= array(460);

and reading like

array('in'=> $getData[$a] )

PS: My array is variable, not only one product
I can't see anything wrong with the code and if dump array it is ok I think: array([0] => int(460))


texts: get product name and stars in all reviews page

texts:
At the moment i have this piece of code working, with a little help. But last thing is that i would like the product name to show instead of the product id numberand i would like to show the stars given in the review. Thanks for helping.

<?php
$Collection=Mage::getModel('review/review')->getCollection()
->setPageSize(5)
->addStoreFilter(Mage::app()->getStore()->getId())
->addStatusFilter(Mage_Review_Model_Review::STATUS_APPROVED)
->addRateVotes()
->setDateOrder();

$_items = array_reverse( $Collection->getItems());
foreach ($_items as $_review):
$productId = $_review->getentity_pk_value();
$_review->getTitle();
$_votes = $_review->getRatingVotes();
$_review->getDetail();
$this->formatDate($_review->getCreatedAt());
$this->__('[Posted %s]', $this->formatDate($_review->getCreatedAt()), 'long');
echo "

".$productId = $_review->getentity_pk_value()."
";
echo "

".$_review->getTitle()."

";
echo "
".$_review->getDetail()."
";
echo "
". $this->formatDate($_review->getCreatedAt())."
";
endforeach;
?>


texts: Call an third-party API on Magento basic operations like Update Customer

texts:
I need to do calls to an Third-Party API when customer updates his account for example. I'll need another actions too, but I think if I understand that one I can try to do the other ones, like update credit card information etc...

Thanks and I appreciate this website and all your help!


texts:
I am using Aschroder SMTP Pro extension, suddenly the extension stopped working and giving below exception:
On Testsite for gmail
2020-07-20T05:37:03+00:00 ERR (3):
exception 'Zend_Mail_Protocol_Exception' with message '5.7.9 Application-specific password required. Learn more at
 5.7.9  https://support.google.com/mail/?p=InvalidSecondFactor b8sm9558176pjd.5 - gsmtp
' in /var/www/html/lib/Zend/Mail/Protocol/Abstract.php:431
Stack trace:
#0 /var/www/html/lib/Zend/Mail/Protocol/Smtp/Auth/Login.php(95): Zend_Mail_Protocol_Abstract->_expect(235)
#1 /var/www/html/lib/Zend/Mail/Protocol/Smtp.php(217): Zend_Mail_Protocol_Smtp_Auth_Login->auth()
#2 /var/www/html/lib/Zend/Mail/Transport/Smtp.php(200): Zend_Mail_Protocol_Smtp->helo('localhost')
#3 /var/www/html/lib/Zend/Mail/Transport/Abstract.php(348): Zend_Mail_Transport_Smtp->_sendMail()
#4 /var/www/html/lib/Zend/Mail.php(1194): Zend_Mail_Transport_Abstract->send(Object(Zend_Mail))
#5 /var/www/html/app/code/local/Aschroder/SMTPPro/Model/Email/Queue.php(99): Zend_Mail->send(Object(Zend_Mail_Transport_Smtp))
#6 [internal function]: Aschroder_SMTPPro_Model_Email_Queue->send(Object(Mage_Cron_Model_Schedule))
#7 /var/www/html/app/code/core/Mage/Cron/Model/Observer.php(326): call_user_func_array(Array, Array)
#8 /var/www/html/app/code/core/Mage/Cron/Model/Observer.php(72): Mage_Cron_Model_Observer->_processJob(Object(Mage_Cron_Model_Schedule), Object(Mage_Core_Model_Config_Element))
#9 /var/www/html/app/code/core/Mage/Core/Model/App.php(1358): Mage_Cron_Model_Observer->dispatch(Object(Varien_Event_Observer))
#10 /var/www/html/app/code/core/Mage/Core/Model/App.php(1337): Mage_Core_Model_App->_callObserverMethod(Object(Mage_Cron_Model_Observer), 'dispatch', Object(Varien_Event_Observer))
#11 /var/www/html/app/Mage.php(448): Mage_Core_Model_App->dispatchEvent('default', Array)
#12 /var/www/html/cron1.php(76): Mage::dispatchEvent('default')
#13 {main}

On production site for Outlook:
2020-07-23T07:51:20+00:00 ERR (3):
exception 'Zend_Mail_Protocol_Exception' with message '5.7.3 Authentication unsuccessful [SG2PR06CA0235.apcprd06.prod.outlook.com]
' in /var/www/html/lib/Zend/Mail/Protocol/Abstract.php:431
Stack trace:
#0 /var/www/html/lib/Zend/Mail/Protocol/Smtp/Auth/Login.php(95): Zend_Mail_Protocol_Abstract->_expect(235)
#1 /var/www/html/lib/Zend/Mail/Protocol/Smtp.php(217): Zend_Mail_Protocol_Smtp_Auth_Login->auth()
#2 /var/www/html/lib/Zend/Mail/Transport/Smtp.php(200): Zend_Mail_Protocol_Smtp->helo('localhost')
#3 /var/www/html/lib/Zend/Mail/Transport/Abstract.php(348): Zend_Mail_Transport_Smtp->_sendMail()
#4 /var/www/html/lib/Zend/Mail.php(1194): Zend_Mail_Transport_Abstract->send(Object(Zend_Mail))
#5 /var/www/html/app/code/local/Aschroder/SMTPPro/Model/Email/Template.php(132): Zend_Mail->send(Object(Zend_Mail_Transport_Smtp))
#6 /var/www/html/app/code/core/Mage/Core/Model/Email/Template.php(508): Aschroder_SMTPPro_Model_Email_Template->send('sales@c...', NULL, Array)
#7 /var/www/html/app/code/local/Magecomp/Recaptcha/controllers/IndexController.php(149): Mage_Core_Model_Email_Template->sendTransactional('contacts_email_...', 'custom2', 'sales@c...', NULL, Array)
#8 /var/www/html/app/code/core/Mage/Core/Controller/Varien/Action.php(418): Magecomp_Recaptcha_IndexController->saveAction()
#9 /var/www/html/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(254): Mage_Core_Controller_Varien_Action->dispatch('save')
#10 /var/www/html/app/code/core/Mage/Core/Controller/Varien/Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#11 /var/www/html/app/code/core/Mage/Core/Model/App.php(365): Mage_Core_Controller_Varien_Front->dispatch()
#12 /var/www/html/app/Mage.php(684): Mage_Core_Model_App->run(Array)
#13 /var/www/html/index.php(84): Mage::run('', 'store')
#14 {main}

This when I Run for test email to check that SMTP details working or not.


texts: How to implement "Uses Per Customer" in Catalog Rules?

texts:
How can I implement "Uses Per Customer" functionality (Same Like Cart Price Rules) in Catalog Rules?

Say for example. If I enter 3 in Uses Per Customers. Catalog Price rule has to apply only 3 times for that customers. Next time onwards customers don't get the catalog discount.

How can I achieve this?

Please share your thoughts and ideas.

Thanks in advance !!


texts: Export Categories with their ids to another installation

texts:
How can I export my categories and retain their ids? Magento dataflow exports categories by their ids instead of their names, but after using a script to copy categories to the new install, the ids where completely different.

Anyone know of an easy way to export it?


texts: How define total amounts showed in transactions mails

texts:
We have all the prices setup including VAT.

Right now in the transactional Mails we get the following output:

Subtotal            USD 50.00
Shipping & Handling USD  5.00
Total (exkl. VAT)   USD 55.00
VAT                 USD  0.00
Total (incl. VAT)   USD 55.00

But we would like to have:

Subtotal            USD 50.00
Shipping & Handling USD  5.00
Total (inkl. VAT)   USD 55.00

How can we achieve that?

Thanks
Aldo


texts: Can't update my product name, PUT REST CALL

texts:
I've some problems with updating the name of my product. I'm using the REST CALL API.

Here's the PHP Code

Here's the error

I'm using the PUT REST CAll from product repository, to update the name of a product. Getting this error and just can't seem to find out why.

EDIT 1 : I managed to pass by this error by giving the attributesetId i use, he then threw ma an error that i needed to give the SKU in the json string, I did that, and now he throws me an error that I can't save the product, reason for this is that you can't update the SKU number because it's unique. Why do I need to add the SKU in my json file, i already gave it by with the rest call, as i add the sku after the URL ?


texts: How to create a custom button in Order grid in Magento 1

texts:
I want to create a custom button in magento 1 backend in **order tab.**

I want this button to be General(for all orders), but i can't find anything related to my issue. All i find it's this article article, but it not help me to much because they create a button for product catalog tab.

Dose anyone know what steps i need to follow to do this? Any advice will be greatly appreciated


texts: How to delete all sample data magento 1.9

texts:
How can we delete all the magento sample data imported before the installation using the magentosample data sql file.

Magento sample data delete includes deletion of sample products , sample categories and also sample test orders.


texts:
Can't we install or run the Magento 2.2 on our Windows machine with WAMP or XAMPP?

Please provide some details, as I have gone through the official documentation of Magento where they only mentioned about the Linux OS.

https://devdocs.magento.com/guides/v2.2/install-gde/install-flow-diagram.html

Thanks


texts:
I have configured the concerned brand logo to the store theme under the Email Transaction section

After saving the configuration, I flushed the cache and re-indexed. Then I created a customer, with all the required fields and the Welcome mail is sent to him / her. But the Email template showed a broken Brand image logo.

When I tried to open that broken image, I got this below error

Please help me how to resolve this issue.....


texts: Problem launching Magento 2 wizard on my MAC

texts:
I have a problem starting the installation process on my mac. Can't launch the set up wizard. These are  the changes I made to my php.ini file /Applications/MAMP/bin/php/php7.2.1/conf/php.ini:

max_execution_time = 18000
max_input_time = 16000
memory_limit = 1024M

I restarted MAMP multiple times still nothing appear on the browser.

Thanks


texts: Why SKU's need to be unique for each product, don't we have product id for that?

texts:
Question : How product nos/item number/part number different from SKU?

From what I understand, SKU groups all the attributes that applies to a product and assigns a fixed number/value to it so that that one number could define a set of values within an attribute group. For example if you were to make a stock transaction, lets say item is - Mens V neck T-Shirt and item number being MN-VN-TS now suppose this product comes in two sizes(M-L) and two colours(Grey and Blue) then the item will have four SKU's one defining each combination of attributes. SZ-M-COL-GRY, SZ-L-COL-GRY, SZ-M-COL-BLU, SZ-L-COL-BLU. So the transaction will look something like :

Received 6 pcs of Item: MN-VN-TS with SKU :SZ-L-COL-GRY

Lets now say there is another item Mens Round Neck T-Shirt with same attributes item name being MN-RN-TS so transaction should appear like:

Received 6 pcs of Item: MN-RN-TS with SKU :SZ-L-COL-GRY

So what you see now is that the stock of two different products got affected but the attributes were same and hence we kept SKUs also same. This way if you need to get the stock of all grey garments you can get all the SKU's having the attribute colour with the value grey and you'll get the stock of all grey coloured garments. Where as this would not be possible if different SKU was to be used for different products having same attribute group and values. It will also make the task of new item/product creation simple which is having the same attribute set. If you keep all the SKUs different for each product then it will be a very painful job to create new SKUs for every new product you add and every possible combination of attribute values even when such combinations already have SKUs defined for some other product.

So my questions is why dose the SKU needs to be unique for each product? What purpose dose it serves by being unique?


texts:
Magento ver. 2.3.2

I am writing a Magento 2 module. I'm trying to re-write a CMS page URL:

https://www.test.com/url-test/cat1/cat2/cat3/

https://www.test.com/url-test?path=/cat1/cat2/cat3/

I have a widget on the CMS page url-test that handles the logic of what is passed in GET['path'].

I cannot get the Router to fire at all (display the die() cmd). I've played with different values for the di sortOrder. I've tried overriding default routers. All to no avail.

I don't have a /etc/frontend/routes.xml file as I don't think I need it.

/etc/frontend/dii.xml:

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <type name="Magento\Framework\App\RouterList">
        <arguments>
            <argument name="routerList" xsi:type="array">
                <item name="test_router" xsi:type="array">
                    <item name="class" xsi:type="string">Me\MyModule\Controller\Router</item>
                    <item name="disable" xsi:type="boolean">false</item>
                    <item name="sortOrder" xsi:type="string">1</item>
                </item>
            </argument>
        </arguments>
    </type>
</config>

/Controller/Router.php:

namespace Me\MyModule\Controller;

class Router implements \Magento\Framework\App\RouterInterface
{
    private $actionFactory;

   public function __construct(\Magento\Framework\App\ActionFactory $actionFactory)
    {
        $this->actionFactory = $actionFactory;
    }

    public function match(\Magento\Framework\App\RequestInterface $request)
    {
        die("test Router");
        $pathInfo = $request->getPathInfo();

        return null;
    }
}


texts:
My magento site was recently hacked, and I'm trying to clear out admin users from the database. I'm wondering if it's safe to delete all of the admin users that I don't recognize, or if some modules/extensions may depend on them.

Are there modules that create admin users?
Is there a way for me to tell which users are legitimate, and which ones aren't?


texts: How to get secure url canonical in magento

texts:
In the Magento backend, under

  System -> Configuration -> Catalog -> Catalog -> Search Engine Optimizations

It adds category and product pages to the canonical url automatically, however the url is not secure and my entire site is in HTTPS. I would like to know how I can proceed to be able to add secure URL in canonical or I would like to know if doing what I described in the question, it already adds the secure URL (HTTPS) automatically in the canonical tag.

I've already done a lot of research on this and all the options explained follow the same steps I described in the question. Thank you in advance!


texts: Add custom attribute to myorder magento2.1

texts:
How to add custom attribute like country of manufactured into my order page in customer panel magento2.1?
Also i want to add configurable variations into my order page, EX: bought T-shirt red size m it should show on my order page.


texts:
For Product A have 100 qty., For Product B i have 200 qty.

I would like to check how many products ordered for a particular product.

Which table i need to look up & what will be the query to get that in format of Magento.

Thanks


texts: Add custom varible in order email template in magento 2

texts:
I have added custom variable in order email template .The variable have the value in sales_order and sales_order_grid table .Once place the order the custom variable doesn't not have any data it shows empty,after that go to backend  check that same order and click send email button manually got a email it shows the data in custom variable ,

Anyone face this problem help me?


texts: How to select data from two table in magento with same condition in custom table

texts:
I have two table tbl_magazine, tbl_page ....
I need to select data form magazine like...
if magazine is enabled then also check magazine page is enable or not...
if magazine is enable and some pages of magazine is disable then only select acive table.

my table is
------------

magazine  table

magazine_id
magazine_name
magazine_cover
status

page table

page_id
magazine_id
page_content
status

I musing this query..

   public function getMagazine() {
        $current_magazine_id = Mage::registry('current_magazine_id');
        $id = $current_magazine_id['o'];
        Mage::unregister('current_magazine_id');

        if ($id) {

            $collection = Mage::getModel('magazine/page')->getCollection()
                    ->addFieldToFilter('magazine_id', $id)
                    ->addFieldToSelect('status', array('eq' => 'ENABLED'))
                     ->setOrder('page_id', 'ASC');
        } else {
            $defaultMagazine = Mage::getModel('magazine/display')->getCollection();
            $data = $defaultMagazine->getData();
            $defaultMagazineId = $data[0]['magazine_id'];
            $collection = Mage::getModel('magazine/page')->getCollection()
                    ->addFieldToFilter('magazine_id', $defaultMagazineId)
                    ->addFieldToSelect('status', array('eq' => 'ENABLED'))
                     ->setOrder('page_id', 'ASC');
        }
        return $collection;
    }

my error

SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'FROM `magazine` AS `main_table` ORDER BY month ASC' at line 1


texts: Multiple Actions using two shopping cart rules with the same coupon code? still possible in 2.3.2?

texts:
I read in these two threads that seem dated on the status of this functionality on Magento.
Multiple actions on shopping cart price rule
Applying multiple action in Cart Price Rules
Is it still possible to have a single coupon code apply a percentage discount and a specific item for free using two shopping cart rules that have the same coupon code?


texts: Changes in app/design/frontend/Theme/theme/.../Magento_Newsletter not updating

texts:
I am trying to update some of the pages on my site and have navigated to:

app/design/frontend/Meigee/hoker/Magento_Newsletter

I am then editing a file called subscribe.phtml

However, any changes I make are not updated on my site even after flushing all cache.

PATH:

app\design\frontend\Meigee\hoker\Magento_Newsletter\templates\subscribe.phtml

Any help?


texts: Help! Dev Magento Site Down after Upgrading Module in EC2 instance on Server


texts:
I want to get a dropdown attribute value on the category page, i set the show in listing to yes and added this attribute to product. then set below code to my list.phtml:

productAttribute($_product, $_product->getMaterial(), 'material') ?>

but get the id of the attribute value. mean that now i see 72 instead of Bronze
How can i get the value test?


texts: How do i get the value from addressInformation Magento 2

texts:
How do I get the example value which is the date.

$billingAddress = $order->getBillingAddress();
$shippingAddress = $order->getShippingAddress();

these two don't have it

But it saves in quote_address table


texts: Custom Collection filtered with sortOrder() not showing higher values first(DESC)

texts:
I have a custom collection that gets updated/increases the attribute called "views" by 1 per view/access (observer records each view).

I later filter this collection to output data for viewing (see below);

$TopViews->setOrder('views', 'DESC');

The sort is outputting 2 ~ 9 above 10 etc (like the default product sort values) as per example below (foreach);

5 views
3 views
2 views
22 views
...
10 views

but really the higher the number should be output first. Maybe its the way i have created my table column in the sql setup file as I see that ID values are sorted correctly when using this.

SQL Setup;

`id` int(11) unsigned NOT NULL auto_increment,
`views` varchar(255) default NULL,

How would I filter the collection correctly to output higher values first (DESC)?


texts: How to change "This is required field" message to field-wise magento 2 customer registration

texts:
If I am submitting registration form as blank then all fields are showing an error message:

This is required field

I want to change this message according to fields.
For Example:
> > First name is required

> > Last Name is required

> > Email is required


texts: How to run upgrade script manually (1.9.0.0 to 1.9.1.0)

texts:
I'm currently experiencing some urgent problems with my Magento website.

I have upgraded my website from 1.9.0.0 to 1.9.1.0 and now it seems like the upgrade script (database) do not run entirely.

Table 'website.core_email_queue' doesn't exist' in /home/magento/lib/Zend/Db/Statement/Pdo.php:228

Some settings are also missing in the core_config_data tables... Is it possible to rerun the upgrade scripts manually because currently I can't find where...

Some people suggest to modify the version in core_ressources but I don't think it's the best solution. I have triend to reinstall Mage_Core_Modules and Mage_Core_Adminhtml from the downloader but it doesn't seem to work.

I also have tried to redownload the core files of Magento and override core file in my setup, but it doesn't work at all. I can't get the missing tables created.

Thanks !


texts:
I have 2 collection 1 is $bestsalecollection that show in dashboard . second is product collection.
After filter collection when i return it generate error Call to a member function isLoaded() on array

Please any one help me to tell how filter array convert into magento collection ?

Thank you

 $bestsalecollection = $this->_collectionFactory->create()->setModel(
                \Magento\Catalog\Model\Product::class
            )->addStoreFilter(
                $storeId
            );
            $productCollection = $this->productcollectionFactory->create();
            $sellercollection=$productCollection->addFieldToFilter('current_user_id',array('eq'=>1));
            $filter_product=[];

            foreach ($sellercollection as $allProduct){
                foreach ($bestsalecollection as $bestSale){
                    if($allProduct->getEntityId()==$bestSale->getProductId()){
                        $filter_product[]=$bestSale;
                    }
                }
            }
    $this->setCollection($filter_product);
        return parent::_prepareCollection();


texts:
On a fresh Magento 2 Open Source install, I accidentally named the site "foo.locale" instead of "foo.local". I've updated the database with the correct value [1] but when accessing the homepage foo.local I am still getting redirected to foo.locale with a parameter:

$ curl -I http://foo.local
HTTP/1.1 302 Found
Location: http://foo.locale/?SID=ltpekiq86h9nltd5rhgdeaidav

I have used mysqldump to confirm that the string foo.locale is not found anywhere in the database, and I've used grep to confirm that the string is not found in any files either.

Where is the redirect happening, and how can I prevent it?

[1] Changing "foo.locale" to "foo.local" in the database:

MariaDB> update core_config_data set value='http://foo.local/' where value='http://foo.locale/';
Query OK, 1 row affected (0.07 sec)
Rows matched: 1  Changed: 1  Warnings: 0

MariaDB> update core_config_data set value='https://foo.local/' where value='https://foo.locale/';
Query OK, 1 row affected (0.07 sec)
Rows matched: 1  Changed: 1  Warnings: 0


texts: How to Use Cookie-free Domains and Expire Headers in Magento Site

texts:
Hallow Guys !
 I did run speed test on my sites and most of the results shows that "Add Expire Headers" and "Defer parsing of Javascript" "Use Cookie-free Domains  " If anyone know kindly help me ! Thanks in Advance


texts:
Been running an M2 store for some time now, but for some reason JavaScript is suddenly not loading properly on the frontend.
Unsure how this happened, but it's obviously now preventing any orders from being placed, as the add to cart button is disabled as a result (though add to cart does work from quickview).
Site is running Magento ver. 2.3.5-p1.
Changing the theme to Luma didn't help -- JS continues not to load.
No changes were made beyond a couple of lines of CSS (now removed) and some general admin things (product updates, etc.).
Tried disabling a few things after we became aware of this problem, such as a live chat integration as well as turning off JS minify/bundling.
Also ran through a few commands:
php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy
php bin/magento indexer:reindex
php bin/magento cache:flush
php bin/magento cache:clean

Tried manually deleting the contents of:

pub/static (.htaccess not deleted and is still present)
generated/metadata
generated/code

Also reran the following command to check permission:
find var generated vendor pub/static pub/media app/etc -type f -exec chmod u+w {} + && find var generated vendor pub/static pub/media app/etc -type d -exec chmod u+w {} + && chmod u+x bin/magento

A file backup of the site (not DB) that was taken last week (when the JS was working) was restored, to no effect -- the JS issue persists, despite it not being a problem when the backup was taken.
Sadly, none of this has helped.
I suspect the issue is related to an error shown in the console:
Uncaught SyntaxError: JSON.parse: end of data while reading object contents at line 1 column 2 of the JSON data
The file this relates to is /pub/static/frontend/Vendor/Theme/lang/mage/apply/main.js and the errors are specifically lines 58 (getData) and 74 (apply).
Any insight as to what can be done to correct this would be greatly appreciated, thanks.


texts:
I installed a plugin that compresses images, then I deleted it because it didn't  work. Then, I go to log into my admin panel the next day and it says

  invalid username or password


texts: 1.7 displaying products placed in a root category

texts:
I've built a new block that displays products placed in a specific category (chosen via ID) and renders them out with some fancy jQuery. Now to test this I passed a id of 17, a category with plenty of products 10+. All works fine, products are found and rendered out propperly.

If i however pass it the id for a root category (I have called featured products) that has 6 products in, it fails to work.

    <!-- Global Variables -->
<?php $category = Mage::getModel('catalog/category'); ?>
<?php $_helper  = $this->helper('catalog/output'); ?>

<?php
$featured_category  = Mage::getModel('catalog/category')->load(17);
$products = Mage::getModel('catalog/product')
    ->getCollection()
    ->addCategoryFilter($featured_category)
    ->addAttributeToSelect("*")
    ->load();
?>
        <ul>
        <?php $counter = 0; ?>
        <?php foreach($products as $_item): ?>

Is there anything major I've done wrong that would stop this from working in a root category but not a sub category?


texts: FancyBox "swapTheImage" Function: Clicking on Images in Carousel Refreshes Page to Configurable Product

texts:
As the title states, when trying to click an additional product image for a configurable/simple product, the page instead reloads and reverts back to the configurable product page. You can see this at: http://abbietest.hotmakeup.com/v04/lips/lip-gloss/glistening-gloss-product

I've enabled the additional images for the linked product for the first two swatch options.

The client's live version of the site uses the same FancyBox lightbox — it is included with Amasty's Color Swatch Pro extension that we are using — it functions properly on the main domain at hotmakeup.com.

The following are error messages we get when the function is called and executed. The bottom half appears right before the page reloads.

The error messages from the console above refers to a cached javascript file at: media/js/ad6ced663bf0f0132dd7f7102f03a15d.js.

But the source of the function seems to be at: skin/frontend/base/default/js/amasty/amconf/zoomer.js

We've compared zoomer.js from the abbietest subdomain to the zoomer.js at the main domain and they're identical — so we're having trouble isolating the issue.

On the subdomain, the class value of "active" does get inserted — this can be seen before the page reloads when inspecting the element. But something is causing the page to redirect.

The screenshot above also happens to have an ebiz error. We've tried disabling that module through the Magento backend in case it was conflicting with FancyBox/zoomer.js but it made no difference. Any other troubleshooting ideas would be much appreciated.

Thanks!


texts: Show different thumbnail image set for each color picked in configurable product

texts:
Hi everybody (first post here), I've been trying Magento 1.9 display a different set of thumbnail images for every option in the color swatch, in a configurable product, but with no success.

For example, there are different colors for a single shoes model, (a single product) and for every color, there is a set of five photographs (different perspectives, of course), so I associated those photographs to a single product, and then I associated that single product to a configurable product (with just a single picture).

It doesn't work. Just one picture for every single color is showed as a base image in the product page, but always the thumbnail corresponding with the configurable product.

In the Magento 1.9 demo database an opposite approach is used (which I guess the right path): all the product with different colors goes with configurable product, while the single procuct has just one image... but it doesn't work either to my case.

What I expect is that Magento display the five pictures from the single product with a specific color picked by the user (in the same way as Amazon does it).


texts: I want to add new attribute in the add Product as a input filed in admin panel


texts: Attribute with this code is not super in row(s) - Confirmed global setting and assigned to attribute set

texts:
I created the parent (super) and used the 'create configuration' to choose the attribute and create the children.
My skus are long, could this be causing the problem (i.e. 083-000022-Chartreuse Lime Alternating w Orange Accent - 311SW)


texts: Place Order Magento 2.1 REST API as a guest for Android app

texts: I want to place order on Magento 2.1 using REST API, Please provide me all steps from creating cart to Place order, Actually i need parameters to pass for guest, How i'll set Customer_id etc for guest? Because i am guest how i can have customer id?


texts: How to override "/vendor/magento/framework/Mail/Template/TransportBuilder.php"?

texts:
I want to override this file : /vendor/magento/framework/Mail/Template/TransportBuilder.php

Did anyone know how to override this file. Thank you in advance.


texts: How to apply filter to magento model before loading or selecting the item?

texts: I am a newbie in magento development and want to implement softdelete on my models . So basically I have added a is_deleted field in tables. So when I delete any record I just set is_deleted to 1.  Now my question is that if I select record(s)  from either model or resource Model only filtered record where is_deleted is 0 should come.  For Exmaple - $model->load($id) should return the record which is not soft deleted.  Thanks for the help in advance


texts: How to include LESS in specific page layout

texts:
I have created my custom page_layout in magento 2 and now I want to add some less only in my page_layout. I don't want to load those less file in other layouts.

How I can achieve it?


texts: Magento2 after transfer the site to new server:try clearing your cookies. err_too_many_redirect

texts:
When I try to visit the admin URL.  I get a browser error that indicates too many redirects
I have tried the following to resolve it:
php bin/magento cache:clean
php bin/magento cache:flush
php bin/magento indexer:reindex
php bin/magento setup:upgrade
php bin/magento setup:static-content:deploy -f
However, this did not resolve the issue.
What needs to be done to get this fixed?


texts: How to set remote ip address when importing rating?

texts:
I'm trying to import product reviews with ratings from old magento site to new site. I've almost done. But I'm getting struck at setting remote ip address for rating?

When I searched the rating module I could not see any function to set this. This IP address is set by core module(Mage/Core/Model/http.php).

How can I set this? Do I want to write my own function?


texts: Product collection retrieval N at a time (paginated)

texts:
I want to retrieve all the products.  But would like to limit it to say 100 at a time to avoid too much memory usage.

I have the collection factory injected in the constructor as

\Magento\Catalog\Model\ResourceModel\Product\CollectionFactory $pfac

Using $pfac, created a collection.

$collection = $this->pfac->create();
$collection->setPageSize(100);
$pageCount = $collection->getLastPageNumber();

Now, I thought I could just iterate one page at a time using setCurPage, but alas, only the first page data is present always.

I tried:

for($x = 1; $x <= $pageCount; $x++) {
     $collection->setCurPage($x);
     $pageData = $collection->getData();
}

But the $pageData is always the same (first page data).

I tried calling $collection->load(), thinking that might be needed, but again, not helpful.


texts: How to set ui form field value with url-param when loading edit new page

texts:
I want to set a field value from url params in an input field when I load the admin edit new page. The value for the field "material_id" is a parameter in my url. This is my ui_component:

        <field name="material_id">
        <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
                <item name="dataType" xsi:type="string">text</item>
                <item name="label" xsi:type="string" translate="true">Material</item>
                <item name="formElement" xsi:type="string">input</item>
                <item name="source" xsi:type="string">specification</item>
                <item name="sortOrder" xsi:type="number">10</item>
                <item name="dataScope" xsi:type="string">material_id</item>
                <item name="validation" xsi:type="array">
                    <item name="required-entry" xsi:type="boolean">true</item>
                </item>
            </item>
        </argument>
    </field>

How can i set the url param to this field???

This is my Dataprovider:

namespace Mcas\DataMaterial\Model\Specification;

class DataProvider extends \Magento\Ui\DataProvider\AbstractDataProvider
{
    /**
     * Loaded data cache
     *
     * @var array
     */
    protected $loadedData;

/**
 * Data persistor
 *
 * @var \Magento\Framework\App\Request\DataPersistorInterface
 */
protected $dataPersistor;

/**
 * constructor
 *
 * @param string $name
 * @param string $primaryFieldName
 * @param string $requestFieldName
 * @param \Mcas\DataMaterial\Model\ResourceModel\Specification\CollectionFactory $collectionFactory
 * @param \Magento\Framework\App\Request\DataPersistorInterface $dataPersistor
 * @param array $meta
 * @param array $data
 */
public function __construct(
    $name,
    $primaryFieldName,
    $requestFieldName,
    \Mcas\DataMaterial\Model\ResourceModel\Specification\CollectionFactory $collectionFactory,
    \Magento\Framework\App\Request\DataPersistorInterface $dataPersistor,
    array $meta = [],
    array $data = []
) {
    $this->dataPersistor = $dataPersistor;
    parent::__construct($name, $primaryFieldName, $requestFieldName, $meta, $data);
    $this->collection = $collectionFactory->create();
}

/**
 * Get data
 *
 * @return array
 */
public function getData()
{
    if (isset($this->loadedData)) {
        return $this->loadedData;
    }
    $items = $this->collection->getItems();
    /** @var \Mcas\DataMaterial\Model\Specification $specification */
    foreach ($items as $specification) {
        $this->loadedData[$specification->getId()] = $specification->getData();

    }
    $data = $this->dataPersistor->get('mcas_datamaterial_specification');
    if (!empty($data)) {
        $specification = $this->collection->getNewEmptyItem();
        $specification->setData($data);
        $this->loadedData[$specification->getId()] = $specification->getData();
        $this->dataPersistor->clear('mcas_datamaterial_specification');
    }
    return $this->loadedData;
}

}

How can I set the param value for my field "material_id"
Hope to get help.
Thanks, Christian


texts:
I tried to install the latest version of magento 2.2.0 on wamp server 32 bit on my laptop. During the chceking readying process it shows missing .intl files . I tried looking for help on youtube and did the correction on php.ini removed the coloum before this file saved and restarted the wamp and still it showing the same error message enclosing is screen shot of the errors.

I am using Wamp server 32 bit
Apache 2.4.27
PHP 7.1.9
MYSQL 5.7.19
Maria DB 10.2.8

I am using windows 7 Ultimatum 32 bit 4gb ram I7 intel processor

Can you please help me fix this error by remotely using tieam viewer or step by steps.

Thanking you


texts: Magento 2.3.4 not syncing with braintree after refund

texts:
when issuing a refund from the braintree or paypal panel the orders in Magento 2.3.4 are not set to "closed" and no credit memo is being created. Is there any setting I need to adjust? Payments work great otherwise. Any help appreciated.

edit: getting following error

[2020-03-19 10:07:13] main.CRITICAL: The "braintree_paypal" method isn't available. {"exception":"[object] (Exception(code: 0): The \"braintree_paypal\" method isn't available. at /home/cloudpanel/htdocs/www.myshop.com/vendor/magento/module-paypal/Model/Ipn.php:109)"}

paypal IPN is set to    https://myshop.com/paypal/ipn

I read that I dont have to set this because magento is sending the IPN URL anyway but without it paypal doesnt send any request.

I have no problems with paypal express btw. With or without IPN setting in paypal


texts:
I've installed an autocomplete search module but it only works with the default Magento theme.

Do I have to call it's layout with a local.xml file on my theme package?

UPDATE:
Just to be more clear. I'm using the Porto Theme. This theme have a search module and when I disable it, it suposes to load the original search field but it's not.

I'm almost sure that I need to tell something on my custom local.xml but I realy don't know What.

I already copied all modules, layouts e templates folder to all custom themes folders possiblities (the module is original installed on base theme folder).


texts: Cannot save configurable products anymore!

texts:
I got a serious issue. I used to be able to create configurable products but I cannot anymore. I create lets say 2 simple products using the BagSizes attribute and then create the configurable product using that BagSizes attribute and associate with the simple products I created. When I click Save, it then goes back to the product list without saving. No error whatsoever.

Any ever had this problem?

Using Magento 1.9.1 (Was before on Magento 1.7.1)
Also, creating normal products work. Could it be a database problem?


texts: Magento sets zero quantity importing csv with only _links_* column

texts:
I'm trying to update products adding related, cross sell and upsell products by importing a CSV from System->Import/Export->Import functionality.

After the import process all the modified products (the ones in column "sku") have Quantity set to 0 (zero) and Stock Availability set to Not in stock.

My configuration

I'm working on Magento 1.6.2.0

My CSV file has the following columns:

 sku
_links_related_sku
_links_related_position
_links_crosssell_sku
_links_crosssell_position
_links_upsell_sku
_links_upsell_position

I don't need and I can't add the qty column.

I try both Append complex data and Replace existing Complex Data.

My questions

Updating product via CSV import there are some required columns as well as sku??
Is there a bug on Magento import system?

NOTE:
Time ago, for other stores, a fight with a similar issue importing product programmatically: all imported products gets the quantity specified for the first product and I resolved following the instruction at this link
http://www.magentocommerce.com/boards/viewreply/408209/

But now I'm updating products (and not importing) and this method does not resolve the issue.

Some help?
Thaks


texts: add to cart products with max qty of products error with run script

texts:
add to cart products with max qty of products with below code

include 'app/Mage.php';
Mage::app();

Mage::getSingleton('core/session', array('name' => 'frontend'));

// Need for start the session
$cartHelper = Mage::helper('checkout/cart');
    $items = $cartHelper->getCart()->getItems();
    echo count($items);
    foreach($items as $item)
    {
        $itemId = $item->getItemId();
        $cartHelper->getCart()->removeItem($itemId)->save();
    }

try {

    $product_id = '7896'; // Replace id with your product id
    $qty = '99'; // max qty with your qty
    $product = Mage::getModel('catalog/product')->load($product_id);
    $cart = Mage::getModel('checkout/cart');
    $cart->init();
    $cart->addProduct($product, array('qty' => $qty));
    $cart->save();
    Mage::getSingleton('checkout/session')->setCartWasUpdated(true);

} catch (Exception $e) {
    echo $e->getMessage();
}

products qty available in store is 99 with products id - 7896
when my script first time run add 99 qty in cart ..but  next time run its
give error to "The requested quantity for 'xxx' is not available"

its look like run script as

1st time - working (add to cart with 99 qty)

2nd time - given error

3rd time- working (add to cart with 99 qty)

4th time - given error and

continues,,,,

I have all ready remove cart item every time before add product as you see in code ..but its not getting same response as working ..


texts: Magento 2 : add pager in custom grid at frontend

texts:
I have added one grid in customer account and getting collection also.But when I want to add pager in that grid, that time I am getting an error like :

  SQLSTATE[42S22]: Column not found: 1054 Unknown column 'main_table.attribute_id' in 'field list', query was: SELECT COUNT(DISTINCT main_table.attribute_id) FROM custommodule_test AS main_table WHERE (customer_id='2') {"is_exception":false} []

Actually there is not any attribute_id filed is there in my table nor I am filtering for that filed name as you are seeing.

Please have a look :

test.phtml

<?php if ($block->getPagerHtml()): ?>

<?php echo $block->getPagerHtml(); ?>

<?php endif; ?>

block/test.php

protected function _prepareLayout()
{
    parent::_prepareLayout();
    if ($this->getCollection()) {
        $pager = $this->getLayout()->createBlock(
            'Magento\Theme\Block\Html\Pager',
            'custom.collection.test'
        )->setCollection(
            $this->getCollection()
        );
        $this->setChild('pager', $pager);
        $this->getCollection()->load();
    }
    return $this;
}
public function getPagerHtml()
{
    return $this->getChildHtml('pager');
}

public function getCollection()
{
    if (!$this->getData('collection')) {
        $this->setCollection(
            $this->_objectMangaer->get('Namespace\Modulename\Model\Test')->getCollection()->addFieldToFilter('customer_id',2)
        );
    }
    return $this->getData('collection');
}

Please note : If I directly call $this->getCollection() ; from phtml file then I got an correct collection.


texts: Timezone (CST6CDT) is not a known timezone Magento cannot login to admin

texts:
timezone (CST6CDT) is not a known timezone";i:1;s:3233:"#0
 \app\code\core\Mage\Core\Model\Locale.php(527):
 Zend_Date_DateObject->setTimezone('CST6CDT')

Cannot login to admin panel i get this exception. I also tried

/app/code/core/Mage/Reports/Model/Resource/Order/Collection.php

replacing line 373 and 374, with Etc/UTC to UTC but no luck. I'm running the site on wamp and my php version is 5.5.12. I want to fix the issue without downgrading php version to 5.4.

How can i change timezone (CST6CDT) to a valid timezone? (Note: I do not have access to the admin panel)


texts: Autoloader still trying to load deleted modules

texts:
I've removed a module:

  Deleted the files under app/code/community
  Deleted the xml file from app/etc/modules
  Removed the entry from the core_resource table
  Deleted all entries under app/design that relate to the module
  Deleted all files under var/cache

Below is the error I'm getting that is stopping me from accessing any interface for the site.

Warning: include(Pulsestorm/Better404/Model/Observer.php): failed to open stream: No such file or directory  in /var/www/vhosts/mysite.co.uk/httpdocs/releases/20141009070627/lib/Varien/Autoload.php on line 93


texts: Magento2: How to add dependency in composer for private Gitlab modules?

texts:
I'm installing a custom module in M2 using composer from my private Gitlab repo and it is working fine.

After I've added the dependency of other modules(using composer require) in my custom module which placed in the same private Gitlab but it is not working with the composer require test/module-test-extended:dev-master --ignore-platform-reqs command.

ERROR:

Your requirements could not be resolved to an installable set of packages.

Problem 1
 - Installation request for test/module-test-extended dev-master -> satisfiable by test/module-test-extended[dev-master].
 - test/module-test-extended dev-master requires test/module-test dev-master -> no matching package found.

Potential causes:
 - A typo in the package name
 - The package is not available in a stable-enough version according to your minimum-stability setting
   see <https://getcomposer.org/doc/04-schema.md#minimum-stability> for more details.
 - It's a private package and you forgot to add a custom repository to find it

Read <https://getcomposer.org/doc/articles/troubleshooting.md> for further common problems.

Composer.json

{
  "name": "test/module-test-extended",
  "description": "Test Module",
  "type": "magento2-module",
  "version": "1.0.0",
  "license": [
    "OSL-3.0",
    "AFL-3.0"
  ],
  "require": {
    "test/module-test":"dev-master"
  },
  "repositories": [
    {
        "type": "vcs",
        "url": "https://vcs.xxx.com/test/module-test"
    }
  ]
}

Note: Implementing composer dependency without packagist


texts: Set custom shipment email template, for spesific shipping method

texts:
Standard shipment emails are:

  app/locale/en_US/email/sales/shipment_new.phtml
  app/locale/en_US/email/sales/shipment_new_guest.phtml

In case an order has been made using a specific shipping method, I would like to set a custom shipment email template.

Can you help me to solve this?


texts: Magento 2 Hide top navigation links on Desktop View

texts: I need to hide magento 2 store top navigation menu from the desktop view but visible on mobile view. How can this be done ?


texts: Magnto 2 update the cart custom option value

texts:
Currently am using magento 2.2.5,

while adding the product to the cart the custom options values are stored in the quote_item_option table correctly.

while updating the custom options programmatically it has not changed in the quote_item_option table and doesn't throw any exception.

Please guide me with the proper solutions.


texts: Workaround to add shipment/tracking information to order and ignore the inventory check?

texts: Our ERP is source of truth and inventory is being managed via API. The issue is that if a source under a stock is 0 and an order requires a shipment from that source, then we can't create a shipment. Is there a way to create a shipment with tracking information and ignore any inventory checks? Or just a way to force shipment creation in general?


texts:
Setup version for module 'Magento_CatalogInventoryConfigurableProduct' is not specified error is my issue

I installed magento 2 and when I go to my the site on my local WAMP server I get this pesky error. This is a clone from Magento 2.1.5 and I used Composer to add the Migration Tool Kit... but alas... I am stuck here. I have a little experience with Magento. Ha someone run into this error as well? How can I get out of this muddy road?


texts: Export CSV of product with specific column

texts:
From frontend i want to export csv.

I am using this code to export csv

        Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);
    $attributeCodeToSkip = array(
        'approve_product',
        'vendor_customer_id'
    );

    $skipAttrs = array();
    if ($attributeCodeToSkip) {
        foreach ($attributeCodeToSkip as $attributecode) {
            $attributeDetails = Mage::getSingleton('eav/config')->getAttribute('catalog_product', $attributecode);
            $skipAttrs[]      = $attributeDetails->getAttributeId();
        }
    }
    $customer = Mage::getSingleton('customer/session')->getCustomer();

    $data = array(
        "entity" => 'catalog_product',
        "file_format" => 'csv',
        "export_filter" => array(
            "vendor_customer_id" => $customer->getId()
        ),
        "skip_attr" => $skipAttrs
    );

    $model = Mage::getModel('importexport/export');
    $model->setData($data);

    return $this->_prepareDownloadResponse($model->getFileName(), $model->export(), $model->getContentType());
    $store = Mage::app()->getStore();
    Mage::app()->setCurrentStore($store);

using this I am getting all information about product except two field which i set in skip_attr but i want only product name,SKU and qty. in csv.


texts: Magento 2.1.1- i18n:collect-phrases not working

texts:
I tried to create a translation dictionary for my whole magento site by using the following command:

php magento i18n:collect-phrases -o '/var/www/html/kikinben2/app/i18n/alothemes/bn_bd/bn_BD.csv' -m

I got this error:

[DomainException]
Missed phrase

It works only when I try with a directory path instead of -m at the end. But I need to make it for the whole website, not for a single module.


texts: how to include jquery.js file in checkout page

texts:
I followed the instructions as per http://www.fontis.com.au/blog/magento/using-jquery-magento
. So to include jquery.js file i have downloaded it and placed at skin/frontend/enterprise/yummjunkie/js/jquery/js.
And in page.xml

        All Pages

        <block type="page/html_head" name="head" as="head">
            <action method="addItem"><type>skin_js</type><name>js/jquery.js</name></action>

So when i checked at checout/onepage/ page source it does not include jquery.js file.

As checkout/onepage is 2 columns right template i have placed

<reference name="head">
<action method="addItem"><type>skin_js</type><name>js/jquery.js</name>

in checkout.xml at <checkout_onepage_index>

So please help me on how to add jquery.js file


texts:
I get this after updating from 2.1 to 2.2

1 exception(s):
Exception #0 (Magento\Framework\Config\Dom\ValidationException): Element 'block', attribute 'class': [facet 'pattern'] The value '\\Magento\Framework\View\Element\Template' is not accepted by the pattern '[A-Z][_a-zA-Z\d]*(\\[A-Z][_a-zA-Z\d]*)*'.
Line: 687

Element 'block', attribute 'class': '\\Magento\Framework\View\Element\Template' is not a valid value of the atomic type 'blockClassType'.
Line: 687

Exception #0 (Magento\Framework\Config\Dom\ValidationException): Element 'block', attribute 'class': [facet 'pattern'] The value '\\Magento\Framework\View\Element\Template' is not accepted by the pattern '[A-Z][_a-zA-Z\d]*(\\[A-Z][_a-zA-Z\d]*)*'.
Line: 687

Element 'block', attribute 'class': '\\Magento\Framework\View\Element\Template' is not a valid value of the atomic type 'blockClassType'.
Line: 687

I already read topic on github with same problem but idk what I supposed to do to fix this.

Now I fixed broken class in one of files in app/code
And get the "Attribute layout redefined" with checkout_index_index.xml
I deleted this file and completely get this:

Element 'move', attribute 'name': The attribute 'name' is not allowed.
Line: 687

Element 'remove': This element is not expected. Expected is one of ( block, container, referenceBlock, referenceContainer, uiComponent ).
Line: 723

Also code of my chekout_index_index.xml because i delete, not fix it

<?xml version="1.0"?>
<page layout="empty" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="checkout" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceContainer name="page.messages" remove="true" />
        <move element="logo" destination="checkout.header.wrapper" />
    </body>
</page>


texts: Update: Magento 1 checkout account create redirect, SUPEE-10570v2 and Magento 1.9.3.9

texts:
We currently have a strange problem on our Magento 1.9.3.9 shop.

When someone fills in the password fields in the checkout, to create an account. In that case when clicking the place order button on the checkout review page, it redirects to the homepage instead of the PSP.

It does create an account and place the order in the backend, but the customer is not re-directed to the payment page of the PSP.

UPDATE:

Someone told us it could be related to the SUPEE-10570v1 patch, that could cause this problem. Magento released SUPEE-10570v2 that should solve it. But we are running Magento 1.9.3.9 which should include the SUPEE-10570v2.

But for some reason Magento revert the changes from SUPEE-10570v2 inside SUPEE-10752.

When we are checking the SUPEE-10570v2 .sh file, we see the following lines:

+++ app/code/core/Mage/Customer/Model/Resource/Customer.php
@@ -235,9 +235,8 @@ class Mage_Customer_Model_Resource_Customer extends Mage_Eav_Model_Entity_Abstra
      */
     public function changePassword(Mage_Customer_Model_Customer $customer, $newPassword)
     {
-        $customer->setPassword($newPassword)->setPasswordCreatedAt(time());
+        $customer->setPassword($newPassword);
         $this->saveAttribute($customer, 'password_hash');
-        $this->saveAttribute($customer, 'password_created_at');
         return $this;
     }

That means it removes the lines with the - sign and add the lines with the + sign. So the new file should not have the lines:

$customer->setPassword($newPassword)->setPasswordCreatedAt(time());
$this->saveAttribute($customer, 'password_created_at');

But when we check the file app/code/core/Mage/Customer/Model/Resource/Customer.php of the default Magento 1.9.3.9 install, we see the following:

public function changePassword(Mage_Customer_Model_Customer $customer, $newPassword)
{
    $customer->setPassword($newPassword)->setPasswordCreatedAt(time());
    $this->saveAttribute($customer, 'password_hash');
    $this->saveAttribute($customer, 'password_created_at');
    return $this;
}

The problem still exists even on a fresh and clean install of Magento 1.9.3.9.
But when we apply SUPEE-10570v2 over Magento 1.9.3.9, the problem is solved. But the code of Magento 1.9.3.9 is newer and should include the right version of SUPEE-10570.

So we are a bit confused. What should we do in this case? Is this still a Magento bug that they should solve? Any help in here.


texts: Move block after size atributte of product page [Magento 2]

texts:
I want to move a block and put it after size attribute because when I click this button magento detect that I add to cart:

I use this to move after add to cart, but I don´t known to move to the other position:
    <move element="product.size" destination="product.info.addtocart.additional" after=""/>

Thaaaanks!!!


texts: Set NOINDEX, NOFOLLOW on particular products

texts:
My magento store has the following to allow google/search engines to crawl the entire site.

<meta name="robots" content="INDEX,FOLLOW" />

I am now in need for some particular products to have:

<meta name="robots" content="NOINDEX,NOFOLLOW" />

so that google doesn't crawl/index them. Is this possible? Products would be random (i.e not all from one category) so I need to be able to do this on a product by product basis if needed.

I know i could do it on a url basis like:

<?php
$currentUrl = Mage::helper('core/url')->getCurrentUrl();
if ($currentUrl == 'xxxxxxx')
{
    <meta name="robots" content="NOINDEX,NOFOLLOW" />
}
else
{
    <meta name="robots" content="INDEX,FOLLOW" />
}
?>

but there could end up over time to be hundreds/thousands of these.


texts: How to display a custom message before the shipping methods load?

texts: I want to display a custom message before the shipping methods load and hide that message after shipping methods loading done. How can I do that?


texts: Mangeto 2: How to override core abstract class function?

texts:
Magento 2: How to Override Abstract Class for Product Category Indexing Issue?

I need to override below files one function only

magento\vendor\magento\module-catalog\Model\Indexer\Category\Product\AbstractAction.php

protected function isRangingNeeded()
{
    return true;
}


texts: Listing subcategories within a category page

texts:
I have turned 'is anchor' to 'no' on a specific category and now when clicking that category, instead of it showing the sub-categories it now shows a blank page which is 'frontend/base/default/template/catalog/category/view.phtml'.

Should I be modifying that file to display the subcategories of the selected category or is there a more elegant way of doing this?

Ste,


texts: Discount disappearing when customer inputs name, address, etc

texts: I am having an issue where registered customers are able to use a coupon code but customers that are not registered cannot. Basically the customer inputs the coupon code and it looks fine but when they go checkout and type in their info, the coupon disappears. Can anyone help?


texts: Magento 2 - $product->save is not saving/updating data

texts:
I wanted to do simple price update script, that loads data from xml and passes it to product queried by custom attribute "ean".

I am able to get the product by 2 different ways ProductRepositoryInterface and ProductFactory, when i try to save product using interface i get error that "Class string not found..." when i try to save product by using ProductFactory (save method of product model) then nothing happens.

Using Magento 2.1.5

After long hours of googling and trying i have not seen other types of solutions to retrieve, edit and save product.

I have tried to re-index afterwards to delete cache... ) My code is test.php located in magento2 root directory

<?php
use Magento\Framework\App\Bootstrap;

include('app/bootstrap.php');
$bootstrap = Bootstrap::create(BP, $_SERVER);

error_reporting(E_ALL);
ini_set('display_errors', 'On');

$objectManager = $bootstrap->getObjectManager();

$state = $objectManager->get('Magento\Framework\App\State');
$state->setAreaCode('frontend');

/** @var \Magento\Catalog\Api\ProductRepositoryInterface $productInterface */
$productInterface = $objectManager->get('\Magento\Catalog\Api\ProductRepositoryInterface');

/** @var \Magento\Catalog\Model\Product $productModel */
$productModel = $objectManager->get('\Magento\Catalog\Model\ProductFactory')->create();

$file = dirname(__FILE__) . "/Zasoby.xml";
$xml_content = file_get_contents($file);
$xml_content = str_replace(array("stk:", "lStk:", "rsp:", "typ:"), array("", "", "", ""), $xml_content);
$xml = simplexml_load_string($xml_content);

# Quick switch between interface method and model method
$update_using_interface = false;

foreach ($xml->responsePackItem->listStock->stock as $item):

    $item = $item->stockHeader;

    if (!isset($item->EAN)):
        continue;
    endif;

    /** @var \Magento\Catalog\Model\Product $product */
    $product = $productModel->loadByAttribute("ean", $item->EAN);

    if (!$product):
        continue;
    endif;

    # Product is found so lets start update
    echo "Updating product: " . $product->getName() . "<br/>";

    if ($update_using_interface):
        $product = $productInterface->getById($product->getId(), true);
    endif;

    # Update name and price
    $product->setName($item->name);
    $product->setPrice($item->sellingPrice);

    if ($update_using_interface):
        # Uncaught exception 'ReflectionException' with message 'Class string does not exist'
        $productInterface->save($product);
    else:
        $product->save();
        $product->reindex();
    endif;

endforeach;

Thank you for any suggestions


texts: How to exclude products being added to cart based on products attributes?

texts:
How can i set a condition, if pre-ordered products are purchased, no other products can be added to cart?

  How can I set a condition like, if some of the "non-pre-order" products
  is in the cart, not to be able to add a "pre-order" product. Visa verse if
  my cart consists "pre-order" products, not allow "non-pre-order"
  products to be added?

How can I do that?


texts: Change multiple config value programmatically Magento :2

texts:
I know how to change single config value programmatically, by this way

$configData = [
    'section' => 'MY_SECTION',
    'website' => null,
    'store'   => null,
    'groups'  => [
        'MY_GROUP' => [
            'fields' => [
                'MY_FIELD' => [
                    'value' => $myValue,
                ],
            ],
        ],
    ],
];

// $this->configFactory --> \Magento\Config\Model\Config\Factory
/** @var \Magento\Config\Model\Config $configModel */
$configModel = $this->configFactory->create(['data' => $configData]);
$configModel->save();

But now I want to know, can we set multiple config field values by this way or any other way ?


texts: write Jquery event to append text to textbox on checkout page

texts:
I am new to Magento 2.
I have a website, in magento2 which offers some products to be add in cart.
On checkout page, I want to append country ISD code to mobile number textbox next to Country dropdown.
For example, if user select Singapore as Country then +63 should be added to mobile number text box, so that user can add his/her mobile number. So mobile number textbox can have text as +639988776655.
I can achieve this with jQuery, so kindly share where I can write this jquery stuff in magento2 for checkout page.
Any help would be great for me.


texts: Sum of all customer's orders returns 0 on status: complete

texts:
My function returns 0 on total sum of orders from a client when status is set to complete.
When status is set to processing, everything goes O.K. Is it the right way to obtain a complete status?
Also, I want to get all the SKUs from the customer of all orders. I tried to change getGrandTotal to getSku() but it returns nothing.

The code:

$customer_email = Mage::getSingleton('customer/session')->getCustomer()->getEmail();
$collection = Mage::getModel('sales/order')->getCollection()
    ->addFieldToFilter('status', 'complete')
    ->addAttributeToFilter('customer_email', array('like' => $customer_email));

foreach ($collection as $order) {
    //do something
    //echo round($order->getGrandTotal(), 2) . " ";
    $sum += $order->getGrandTotal();
}

echo round($sum,2); ?>


texts: Sales in Base currency, clients sees equivalent local currency

texts: How can I set up my Magento site so customers can see the price of the products in their local currency, but when purchasing it only takes base currency. Therefore the charge on their credit card in is a foreign currency and their bank takes care of the exchange rate.


texts:
I recently updated my Magento environment to 1.9.2.3 and at first I noticed that when I tried to reset my password and clicked on the link in the email it directed me to a blank page. I fixed that now, but when I fill in the form now I get the error:

Your password reset link has expired.

How do I fix this? My customer.xml is the same as the base version of a just downloaded 1.9.2.3


texts: Magento 2 - PHPUnit skip classes that are extended by \PHPUnit_Framework_TestCase

texts:
Today is my first day using PHPUnit, I've installed phpunit6.1, php7.1 and trying to write simple assertEquals test. When I extend my test class with \PHPUnit\Framework\TestCase - everything works nice, but I can't create an object because \Magento\Framework\TestFramework\Unit\Helper\ObjectManager requires \PHPUnit_Framework_TestCase object, not \PHPUnit\Framework\TestCase. When I extend my class with \PHPUnit_Framework_TestCase - phpunit just skip this test.

How to fix that?

Magento version: 2.1.4


texts: Running a single MFTF test that is included within a suite

texts:
I am trying to only run the test StorefrontVerifySecureURLRedirectCheckout. To run it I am using the following command:
vendor/bin/mftf run:test StorefrontVerifySecureURLRedirectCheckout -k
(I have to use -k to skip generating due to an error see the update)

When executing the above command it executes much more tests than just the desired one:

Magento\FunctionalTestingFramework.functional Tests (935) ----------------------
Modules: \Magento\FunctionalTestingFramework\Module\MagentoWebDriver, \Magento\FunctionalTestingFramework\Helper\Acceptance, \Magento\FunctionalTestingFramework\Helper\MagentoFakerData, \Magento\FunctionalTestingFramework\Module\MagentoSequence, \Magento\FunctionalTestingFramework\Module\MagentoAssert, Asserts
--------------------------------------------------------------------------------
AdminAddConfigurableProductWithDropDownAttributeAndCustomSourceTestCest:
Signature: Magento\AcceptanceTest\_MSI_Multi_Mode\Backend\AdminAddConfigurableProductWithDropDownAttributeAndCustomSourceTestCest:AdminAddConfigurableProductWithDropDownAttributeAndCustomSourceTest
Test: tests/functional/Magento/FunctionalTest/_generated/MSI_Multi_Mode/AdminAddConfigurableProductWithDropDownAttributeAndCustomSourceTestCest.php:AdminAddConfigurableProductWithDropDownAttributeAndCustomSourceTest
Scenario --

/******** Beginning execution of MSI_Multi_Mode suite before block ********/
[...]
/******** Execution of MSI_Multi_Mode suite before block complete ********/
[...]
AdminAddConfigurableProductWithDropDownAttributeWithNewSourceTestCest: Admin add configurable product with drop down attribute with new source test
Signature: Magento\AcceptanceTest\_MSI_Multi_Mode\Backend\AdminAddConfigurableProductWithDropDownAttributeWithNewSourceTestCest:AdminAddConfigurableProductWithDropDownAttributeWithNewSourceTest
Test: tests/functional/Magento/FunctionalTest/_generated/MSI_Multi_Mode/AdminAddConfigurableProductWithDropDownAttributeWithNewSourceTestCest.php:AdminAddConfigurableProductWithDropDownAttributeWithNewSourceTest
Scenario --
[..]

It seems like the whole MSI_Multi_Mode suite is being executed.

I've tried it with the example provided in the getting started guide and this works just fine. Only AdminLoginTestCest is executed.

I've compared both tests but I didn't find any difference that could lead to such a behavior.

Update:
I found the following in the official docs:

  If <test> is included in <suite>, it cannot be generated in isolation to the rest of the contents of the suite (see suites for details).

If I understand it correctly is that if a test is included it cannot be run separately.

The test StorefrontVerifySecureURLRedirectCheckout actually is defined in the suite SecureStorefrontURLSuite due to SecureStorefrontURLSuite.xml which includes the group secure_storefront_url.

When executing vendor/bin/mftf run:test StorefrontVerifySecureURLRedirectCheckout without the -k argument as written above it will result in the following error:

In TestGenerator.php line 147:

  Cannot reference test configuration for generation without accompanying suite.

How is it possible to run a single test that is included in a suite?

A possible solution might be to create a new suite that only includes this one test but it doesn't seems more like a hack to me and it's quite some effort to always create or change suites just to run a single test. I wonder if there is any other solution for this problem.

Update 2:
I just verified, it is possible to wrap the single test in a suite and then execute the suite with vendor/bin/mftf run:group SingleTestSuiteName --remove but this IS NOT really an solution/answer I am looking for due to the inconveniences it brings with having to keep changing the suite all the time.


texts: Ajax Update Product/OnePage Checkout Magento1

texts:
Since today i am experiencing a very strangle problem. Without changing anything, i can't update products (stuck on Please Wait...) and onepage checkout is stuck in step 2 (billing). Log files do not display anything and also no errors in console...

Magento 1.9.0.1
Any ideas, because with no errors i have nowhere to start.

Thanks


texts: Magento2 : How to render payment methods on checkout page by default?

texts:
I want to display the payment method list by default. So please help me.
On the checkout page.

In Magento 2.3.1 when I will go to the checkout page then there are 2 steps.

So I want to remove steps and all options must be shown in one step.

I did that but the first time when I will go on the checkout page then payment method list not rendered. Once I click of the next button then It is rendered but I need rendered automatically.


texts: How to add Custom Block between `product.info.media` and `product.info.details` on Product page in Magento 2.3.3?

texts:
Here is my code of catalog_product_view.xml -

<referenceContainer name="content">
    <container after="product.info.media" name='custom-pro-review-section' htmlTag="div" htmlClass="custom_pro_review_section">
        <block class="Magento\Catalog\Block\Product\View" name="second.product.info.review" template="Magento_Catalog::product/view/review.phtml" />
        <block class="Magento\Catalog\Block\Product\View" after="second.product.info.review" name="product-extra" template="product/view/product-extra.phtml"/>
    </container>
</referenceContainer>

and Block is coming between product.info.media and product.info.details section but showing on top of page.

Actual Result (see image)-

Expected Result will be as -

Please help..... Thanks


texts:
I have a small script that create a new Customer in Magento 2 and used to work but sudenly, it does not.

I included a try...catch but do not know how to show the error message in console. I want to be able to return the error phare:

try {

        $this->_customerRepository->save($this->_customerObject);
        $this->answer = array('response' => true);

    } catch (\Magento\Framework\Exception\State\InputMismatchException $ex) {
        $this->answer = array('response' => 'Email exists');
    } catch (\Magento\Framework\Exception\InputException $ex) {
        $this->answer = array('response' => 'bad input', 'ex' => $ex->getErrors());
    } catch (\Magento\Framework\Exception\LocalizedException $ex) {
        $this->answer = array('response' => 'No idea....');
    }

The Exception arised is InputException, and want to return the phrase in the response, because i do not know where is the fault.

getErrors() only return an object and can not see the error message in console.

What should I do?


texts: How to delete a product's category Magento2

texts:
I am trying to delete a product's category in magento 2 using the following code.
  public function deleteCategories($product_id){
        $categoryIds = $this->productCategory->getCategoryIds($product_id);

        $_product = $this->_productModel->load($product_id);
        $CategoryLinkRepository =  $this->_objectManager->get('Magento\Catalog\Api\CategoryLinkRepositoryInterface');

        // all catgeories of a category
        $currentCategories  = $_product->getCategoryIds();
          foreach ($currentCategories as $categoryId) {
              try{
                    $CategoryLinkRepository->deleteByIds($categoryId, $_product->getSku());
              }catch (\Exception $e) {
                $this->_logger->info("Error importing stock for product sku: ".$_product->getSku().". ".$e->getMessage());
            }
         }
 }

But getting this error everytime.
Category does not contain specified product


texts:
New to Magento 2 and not quite understanding the docs. In child Luma theme I am trying to move the currency switcher to the main header area (next to the minicart) but having no luck with it.

In /app/design/frontend/MyVendor/MyTheme/Magento_Theme/layout I placed the following default.xml:

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<move element="currency" destination="header" after="minicart"/>
</page>

The switcher disappears from the panel header, but doesn't appear where I expect. I tried various combinations of before and after blocks and tried to move it to different blocks like maincontent, but in all cases I can't get it to show. There are a couple of previous posts from people trying to move the currency switcher but no successful answers so far. Is it possible? Moving it by phtml didn't work at all.


texts: Magento 2 Extension installData script in modelFactory is necessary?

texts:
I'm working on magento2 custom module. i have to install some data in my custom_table. so i am referencing below script.

i know the idea about $postFactory as describe here
Magento2: How to add pre defined data (installData.php) for Custom Module .

I'm bit confused.
As mentioned below __construct function is calling postFactory:

Is it $postFactory necessary for inseting data??

If yes then my modulename & tabelname both are different so how can i do that ??

<?php
namespace Vendor\Modulename\Setup;

use Magento\Framework\Module\Setup\Migration;
use Magento\Framework\Setup\InstallDataInterface;
use Magento\Framework\Setup\ModuleContextInterface;
use Magento\Framework\Setup\ModuleDataSetupInterface;

class InstallData implements InstallDataInterface
{
    private $_postFactory;

    public function __construct(\Vendor\Modulename\Model\PostFactory $postFactory)
    {
        $this->_postFactory = $postFactory;
    }

    public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context)
    {
        $data = [
            'title' => 'Hello world!',
            'content_heading' => 'Hello world!',
            'content' => 'logn description put here'
        ];

        $this->_postFactory->create()->setData($data)->save();
    }

}


texts: Magento2 backend sales_order_view.xml not able to override template file

texts:
I want to override the template file for backend Order view

I've checked template path and found that this file is called.

vendor/temando/module-shipping-m2/view/adminhtml/templates/sales/order/view/info.phtml

So to override I did following in my module

Vendor/Module/etc/module.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd">
    <module name="Vendor_Module" setup_version="1.0.0"></module>
     <sequence>
            <module name="Magento_Wishlist"/>
            <module name="Temando_Shipping"/>
     </sequence>
</config>

app/code/Vendor/Module/view/adminhtml/layout/sales_order_view.xml

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
    <referenceContainer name="left">
        <referenceBlock name="order_info">
            <action method="setTemplate">
                <argument name="template" xsi:type="string">Vendor_Module::info.phtml</argument>
            </action>
        </referenceBlock>
    </referenceContainer>
</body>
</page>

And I've put info.phtml in the following path
app/code/Vendor/Module/view/adminhtml/templates/info.phtml

But still, it's not working, clear cache and all but still not taking above file.

What can be wrong?


texts: Can I update css in server side less compilation mode in magento 2?

texts: Now, my website has Server side less compilation mode enabled. I want to change CSS for any specific section but it is not updating. If I change the compilation mode client side less then my website has a broken design. So Please tell me, How can I update CSS?


texts: Mini cart with zero price for all the configurable products except first item

texts:
While adding set of configurable products to cart, it gets added and showing correct data in checkout/cart page, whereas in mini cart it is showing zero price for all the configurable products except the first item.

Please check the attachment for your reference.


texts: Magento2: How to restrict customer to require login for add to cart in whole website?

texts:
I need to integrate a functionality where when a user clicks add to cart it should check whether he is a logged in customer or not. If he is a logged in customer the product should be added in cart. Else it should redirect to Login page after logging in the products to be added automatically. I am using event/observer according to this article but no luck.
I am using below approach:-

Using controller_action_predispatch_checkout_cart_add event to check the customer login status and redirect to login page id customer is not logged in.

On customer_login event I am adding the product in cart after customer login.
above solution works on category page, but not working on product detail page.
it give me below error:-
main.DEBUG: URI "/magento/checkout/cart/add/uenc/aHR0cDovL25lanJlZWRlbW8ud2ViZXBvd2VyLmJpei9tYWdlMjMxYi9mdXJuaXR1cmUuaHRtbA%2C%2C/product/1/" cannot be accessed with GET method (Magento\Checkout\Controller\Cart\Add) [] []
Request validation failed for action "Magento\Checkout\Controller\Cart\Add\Interceptor"

Please let me know what is the best practice to achieve this according to Magento2 standard.


texts: after upgrading magento 1.9.3.4 from 1.9.3.3 - Sometime search showing error

texts: I have upgraded magento 1.9.3.4 from 1.9.3.3 sometime search showing this error.


texts: Magento 2.3.1 How to display source or stock name on product page ? MSI Multii Source Inventory

texts:
How to display source or stock name and code on the product page? Where is information about a current stock or source name? Can I use the code from Sourceitem.php on the Product page?

     public function getSourceCode(): ?string
 {
     return $this->getData(self::SOURCE_CODE);
 }

Thanks in advance


texts: How can I add a JavaScript tag attribute in Magento?

texts:
I'm trying to add CloudFlare's RocketLoader JS attribute tag data-cfasync='true' to some of my files manually.

I've learned how to load js files through layout.xml, but I'm not sure how to add the attribute through the XML.

What I have now:

<script type="text/javascript" src="http://website.com/js/prototype/prototype.js">

What I'm trying to get to:

<script data-cfasync="true" type="text/javascript" src="http://website.com/js/prototype/prototype.js">


texts:
Magento 1.9 - rwd Theme.

Hey guys I'd really appreciate your help on this.

I have categories in root category and in one of those categories I have sub-categories.

categories show up in top nav menu however when I mouseover on parent category drop-down doesn't show up with sub categories.

In source I do see UL with all sub-cats but they dont show up on mouseover. I've also changed Maximal Depth under Category Top Navigation from admin panel. NO LUCK is there something I may be missing?


texts: Magento 2 - site looks destroyed after installing a new module

texts:
I installed a very simple hello world module which works.

php bin/magento module:enable black_test

php bin/magento setup:upgrade

However, now my site looks destroyed. The module is working fine, it is just a controller, so the module did not destroyed my site.

How can I fix this?


texts: How to get full file path of magento file using FIREBUG or INSPECT. Mozilla extension. Is there any way.

texts: I am using editor Firebug extension of Mozilla to do temporary editing of my website pages. It is really easy to edit through Firebug & also it is very difficult to locate the file which we are editing. Magento website file structure is very difficult to understand. Is there any way to locate the file which we are editing through Firebug & edit that file for permanent changes. The provided answers does not giving me all full location of files which is i am editing. So is there any easy way to recognize the location of file in Magento file structure.


texts: How to get invoice item list using sql query?

texts:
I am using magento 2 and how can I get list of items on specific invoice?
I tried sql query with sales_invoice and sales_invoice_item table, but I couldn't get it. There are 2 same rows because of the sub-item(matrix item)
Please give some tips. Thanks!


texts: How to override css properties from a specific module?

texts:
I created a custom theme, that inherits from magento/blank theme. And I am able to override and extend css classes that are defined in

vendor/magento/theme-frontend-blank/web/css/source/*.less

using the "Adding structured changes" section in the documentation (http://devdocs.magento.com/guides/v2.1/frontend-dev-guide/css-guide/css_quick_guide_approach.html).

However, the property I want to change is defined in

vendor/magento/theme-frontend-blank/Magento_Newsletter/web/css/source/_module.less

overriding the class in my _module_extend.less doesn't work.

What is the right magento way to do that?

Thanks!


texts: Custom filter in the sales order admin grid giving php strict notice error

texts:
I've been able to add columns to the sales order grid table in admin, but when I try to use the column to search I get an error Strict Notice: call_user_func() expects parameter 1 to be a valid callback, non-static method filterSkus() should not be called statically

Here's the observer function

public function filterSkus($collection, $column)
{
    if (!$value = $column->getFilter()->getValue()) {
        return $this;
    }

    $collection->getSelect()->having(
        "group_concat(`m_sales_flat_order_item`.sku SEPARATOR ', ') like ?", "%$value%");

    return $this;
}

Here's the data helper calling it

public function getSkusColumnParams()
{
    return array(
        'header' => 'SKUs',
        'index' => 'skus',
        'type' => 'text',
        'filter_condition_callback' => array('DR_Salesgridder_Model_Observer', 'filterSkus'),
    );
}

The stack error is coming from call_user_func in Mage/Adminhtml/Block/Widget/Grid.php

protected function _addColumnFilterToCollection($column)
{
    if ($this->getCollection()) {
        $field = ( $column->getFilterIndex() ) ? $column->getFilterIndex() : $column->getIndex();
        if ($column->getFilterConditionCallback()) {
            call_user_func($column->getFilterConditionCallback(), $this->getCollection(), $column);
        }

I made the filterSkus function static, but it gives me the error undefined variable: this. Beyond removing the strict reporting, is there another way?


texts:
We have Paypal Website payments standard in our Magento store.
We are facing below issue with few Paypal orders.
Magento is receiving IPN from Paypal and changing order statuses which are not expected.
Please see attached screen-shot.
Also Magento admin-end is showing IPN is received twice.
But in paypal logs in Magento I cannot see any unusual thing or any error message.

what can be the probable issue here and how this can be fixed. Any help will be appreciated.


texts:
When I have a product with an image and I scroll down, the image in the sticky header is 50x50px, but when I don't have an image and it defaults to the placeholder, the placeholder shows up as 470x470.
I uploaded a 50x50 image for thumbnail, but that didn't help, it's still huge.
Any ideas?
Thanks


texts:
I'm new on magento 2 and i want to import my module from magento 1, this module display the order grid in my module (tutorial for magento 1 :  http://inchoo.net/magento/how-to-create-a-custom-grid-from-scratch/ ).
I don't know how i can do it on magento 2 and i find nothing on the Internet.

Thank you for your help


texts: Moving local.xml outside of the public folder

texts:
I've seen quite a few arguments perpetuating that .htaccess renders the local.xml safe.  You would also need to be sure that proper permissions are in place.  Otherwise with some of the backdoors available, the .htaccess could be rendered useless.  I'm left here to wonder though, why isn't there an easy way to park the local.xml file outside of public_html.

It appears that the directory to local.xml is hardcoded in several files: Security.php, Config.php, Update.php, Notify.php -- to name a few.

Am I overlooking something here? What is the best way to relocate local.xml outside of public_html?


texts: How to add dynamic field in magento collection?

texts:
I have created one magento collection like this to calculate distance from lat long.

$collection = Mage::getModel('module/module')->getCollection()->addFieldToFilter('status',1);
            $collection->getSelect()->columns(array('distance' => new Zend_Db_Expr("( 6371 * acos( cos( radians(23.0130648) ) * cos( radians( latitude ) ) * cos( radians( longitude) - radians(72.4909026) ) + sin( radians(23.0130648) ) * sin( radians( latitude ) ) ) )")))
            ->having('distance <10')
            ->order('distance ' . Varien_Db_Select::SQL_ASC);

But I am getting error SQLSTATE[42S22]: Column not found: 1054 Unknown column 'distance' in 'having clause'.

When I print collection object Distance calculation is right. so what was the problem?

My problem is similar like this question Issue using "having" in Magento collection

I am using pagination on collection, if I remove pagination class then it works perfect.
But I am unable to solve with solution provided.
Here's my pagination code.

In _prepareLayout() function I put this

$pager = $this->getLayout()->createBlock('page/html_pager', 'pager');
          $pager->setAvailableLimit(array(5=>5,10=>10,20=>20,'all'=>'all'));
          $pager->setCollection($this->getCollection());
          $this->setChild('pager', $pager);
          $this->getCollection()->load();
          return $this;

add this function also in block file

  public function getPagerHtml()
  {
    return $this->getChildHtml('pager');
  }

and call this in phtml file as <?php echo $this->getPagerHtml(); ?>


texts: How to visible phone attribute on customer registration page

texts:
I have show phone attribute on registration page. How can i do that

Like email in sign-in information


texts: magento 2 fotorama lightbox on single image

texts:
I need to add a lightbox functionality for zooming single images in blocks. I thought to use magento 2 fotorama lightbox that's used for the product gallery. I would show the block in the product page so the js library would be already loaded. Any advice or help? I don't know how to make it.
Thanks a lot.


texts: Dropdown option in grid inline edit is empty

texts:
I'm using magento v2.2.5 and i created a column with inline edit like this:

xml ui component

 <column name="enabled">
        <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
                <item name="filter" xsi:type="string">text</item>
                <item name="label" translate="true" xsi:type="string">Enabled</item>
                <item name="editor" xsi:type="string">select</item>
                <item name="options" xsi:type="object">Namespace\Module\Model\Source\EnabledOptions</item>
            </item>
        </argument>
    </column>

Namespace\Module\Model\Source\EnabledOptions

namespace Namespace\Module\Model\Source;

class EnabledOptions implements \Magento\Framework\Option\ArrayInterface
{

    public function toOptionArray()
    {
        $result = [];

        foreach (self::getOptionArray() as $index => $value) {
            $result[] = ['value' => $index, 'label' => $value];
        }

        return $result;
    }

    public static function getOptionArray()
    {
        $options['yes'] = __("Yes");
        $options['no'] = __("No");
        return $options;
    }

    public function getAllOptions()
    {
        $result = [];

        foreach (self::getOptionArray() as $index => $value) {
            $result[] = ['value' => $index, 'label' => $value];
        }

        return $result;
    }

    public function getOptionText($optionId)
    {
        $options = self::getOptionArray();

        return isset($options[$optionId]) ? $options[$optionId] : null;
    }
}

but i got an empty options like this:

edit:

after i inspected the browser console, there is an error like this:


texts: Modules default.xml and minicart.phtml files conflict with custom theme

texts:
In a module there a two files that conflict with a custom themes files:

app\code\Magestore\Pdfinvoiceplus\view\frontend\templates\cart\minicart.phtml
app\code\Magestore\Pdfinvoiceplus\view\frontend\layout\default.xml

Removing these two files fix the conflict. The problem is that if I update the module the files properly comes back unless I remember to delete them. I want to ensure it is a permanent fix.