texts: DB error when running grunt exec Magento2

texts:
I am running grunt exec:luma and am getting the following errors:

Processed Area: frontend, Locale: en_GB, Theme: Magento/luma, File type: less.

>>   [Zend_Db_Adapter_Exception]
>>   SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES)
>>
>>
>>   [PDOException]
>>   SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES)
>>
>>
>>
>> dev:source-theme:deploy [--type="..."] [--locale="..."] [--area="..."] [--theme="..."] [file1] ... [fileN]
>> Exited with code: 255.
Warning: Task "exec:luma" failed. Use --force to continue.

Aborted due to warnings.

Steps I have taken are as follows:

Clean theme by command: grunt clean
run command: grunt exec:yourthemename

I don't have a clue why I am getting a DB error can anyone shed any light into this. DB credentials I'm just confused as to why the Grunt task would be even interacting with the DB.

My Magento 2 set up is running on an Nginx server


texts:
I have some serious trouble at the moment. For some reason, everything become non-clickable when viewing pages in mobile view.

For some reason, it only happens when the shown side has a sidebar, so I suspect it might have something to do with the mobile sidebar menu.

Live view of the problem: http://www.propagandashop.dk/belysning
(Change browser width until menu goes mobile)

ANY suggestions are really appreciated.. THanks!


texts: getLoadedProductCollection doesn't have any products in it

texts:
After some hours I'm unable to list the products in categories. (the products are set correctly, 100% sure)

When I access a product direct by typing it's URL (or search) it goes just fine. But somehow the getLoadedProductCollection is always empty.


texts:
My Magento 2 is link to the MCOM (Magento Commerce Order Management).
Currently, I can syncronize orders status between both.

Now, I would like to syncronize return :

If a user want to make a return, he'll call the customer service which will create the return in the MCOM. Then, the MCOM send the return to Magento 2 to create it when I syncronize both.

Presently, I can create RMA in MCOM, but I didn't succeed to syncronize MCOM with Magento to create return in Magento 2. I try to use the same command I used for syncronize orders : php bin/magento oms:orders:sync, without success.

Did you have any idea about how to do that?


texts: Set up multiple Auto Return Urls for Paypal - one for each store view

texts:
i am trying to set up different Auto Return Urls to work with Magento Pyapal payment Standard. I am running Magento 1.8.0.

In my Magento setup i have different store views (one for each language) and i have the store codes active, so one store will be www.storename.com/en/ while the other will be www.storename.com/de/ ....

How can i setup the Auto Return Urls to be store view specific? In my Paypal account i went to Profile → Selling tools → Website preferences and then set http://www.storename.com/paypal/standard/success/ as return url.

I did the same in the sandbox.paypal account because now i am using sandbox for testing purposes.

It still happens that after the payment has been done, Paypal does not automatically redirect to the success page. Instead it shows the Paypal payment confirmation page with 2 links:

Go back to the website: info@storename.com
Go to your account

I am not using the english version of Paypal so maybe the translations differ a little bit, but i hope you got the idea.

Anyway, shouldn't the Auto Return Url get the user directly to the success page on the Magento installation instead of displaying those 2 links? If this is the case, how can i get it to work?

Thanks


texts: Creating a child theme within a child theme in Magento 2.1.7

texts:
so I'm relatively new to Magento and downloaded a theme (Eren - off themeforest) to build a site off. The theme i wanted to use (eren-4) is already a child theme to eren-1 (the parent theme). I searched around but had trouble finding an answer.

So in short, I was wondering how to build and reference a child theme off an existing child theme in Magento 2.1.7?


texts: Getting Element with the id 'X' already exists on the cms pages from adminpanel in Magento 1

texts:
I am using this eventadminhtml_cms_page_edit_tab_content_prepare_form to add an extra field in the cms view page.

This is the code from my observer:

    $model = Mage::registry('cms_page');
    $form = $observer->getForm();
    $fieldSet = $form->addFieldset(
        'url_match',
        [
            'legend' => Mage::helper('cms')->__('Url store match'),
            'class' => 'fieldset-wide',
        ]
    );
    $fieldSet->addField(
        'url_match',
        'text',
        [
            'name' => 'url_match',
            'label' => Mage::helper('cms')->__('Url match'),
            'title' => Mage::helper('cms')->__('Url match'),
            'value' => $model->getUrlMatch(),
        ]
    );

I am getting this error message:Element with id "url_match" already exists ?
The url_match is a custom column and was added via an upgrade. Do you know why I m getting this ? and what should I do to fix it ?

Thank you !


texts: Magento2 error when making reference for a module controller

texts:
I think I am misunderstanding the concepts of reference when it comes to controllers.

Reference class

<?php

namespace Vendor\Module\Controller\Adminhtml\Index;

use Magento\Ui\Controller\Adminhtml\Index\Render;

class Render extends Render
{
    public function execute()
    {
        $component = $this->factory->create($this->_request->getParam('namespace'));
        $this->prepareComponent($component);
        if($this->_request->getParam('namespace')=='product_listing'){
            $this->_response->appendBody((string) $this->customFunction($component->render()));
        }
        else{
            $this->_response->appendBody((string) $component->render());
        }

        return parent::execute();
    }

    protected function customFunction($items){
        //code here...
    }
}

etc/adminhtml/di.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <preference for="Magento\Ui\Controller\Adminhtml\Index\Render" type="Vendor\Module\Controller\Adminhtml\Index\Render" />
</config>

I receive a error:

 Initialization error component, check the spelling of the name or the correctness of the call.

What is wrong here ? What am I missing ?

EDIT :

I also found this https://github.com/magento/magento2/issues/3177 .
They say it was a problem with the nginx configuration, but I am using apache 2.4 ...

Magento Version 2.0.2 CE

Any ideas ?


texts: print copy of order information in transactional email

texts:
How to provide print order information in transactional email.

is there any default template is there?

For example:

"This email is to confirm example.com Order #[Order Number].

Click here [LINK: Print Version of the Order] to see a copy of your order.

Your order will ship shortly.  If you have any questions, please email us."


texts: Disable filter for column in Magento 2 grid component

texts:
There is a great explanation of the Grid Component but I cannot find how to disable filter for a column. I need only ordering for my column because value for this column is calculated.

    <column name="prxgt_is_in_odoo">
        <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
                <item name="filter" xsi:type="string">text</item>
                <item name="label" xsi:type="string" translate="true">Is in Odoo</item>
            </item>
        </argument>
    </column>


texts: Magento 2. Call .phtml (modal) from observer

texts:
I have created a custom .phtml file that contains a modal popup.

I can successfully call this .phtml by adding it to default.xml in layout.

<?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="root">'
            <block class="Magento\Store\Block\Switcher" name="redirectPopup" template="Magento_Store::switch/redirectPopup.phtml" />
        </referenceContainer>
    </body>
</page>

The code above working fine.

But I would like to call this template only if a certain condition is matched. That's why I want to call it from observer in my custom module.

I tried the following code in observer,

public function showRedirectPopup()
{
    $block = $this->layout->createBlock('Magento\Store\Block\Switcher')->setTemplate('Magento_Store::switch/redirectPopup.phtml')->toHtml();
    return $block;
}

I have made sure the function showRedirectPopup() is executed. But it doesn't seems .phtml is being called.

Did I miss anything?

Can we at all call a .phtml from a observer or it has to be called from layout(.xml)?


texts:
When using below code getting "Direct use of $_FILES Superglobal detected" error. Can anyone suggest how to use in Magento2.

$file = $_FILES["r_dea_license"]["name"];
            $array = explode('.', $file);
            $fileName=$array[0];
            $fileExt=$array[1];
            $deaFile='d_'.$fileName."_".time().".".$fileExt;
            $uploader = $this->_fileUploaderFactory->create(['fileId' => 'r_dea_license']);
            $uploader->setAllowRenameFiles(true);
            $uploader->setFilesDispersion(false);
            $uploader->save($media, $deaFile);


texts: How to get product id in CartItemInterface API response?

texts:
When we use this API

https://magento.host/index.php/rest/V1/carts/mine/items

to get Cart Items its gives response like

Array
(
[0] => stdClass Object
    (
        [item_id] => 1234
        [sku] => 123456789
        [qty] => 1
        [name] => Test Product
        [price] => 123
        [product_type] => simple
        [quote_id] => 1234
    )

)

I need to get the product id with that response like .

     Array
  (
  [0] => stdClass Object
    (
        [item_id] => 1234
        [sku] => 123456789
        [product_id] => 1234
        [qty] => 1
        [name] => Test Product
        [price] => 123
        [product_type] => simple
        [quote_id] => 1234
    )

)

I know if we edit this file CartItemInterface.php and add these lines

 const KEY_PRODUCT_ID = 'product_id';
 public function getProductId();
 public function setProductId($productId);

and edit Item.php add these functions

  public function getProductId()
    {
        return $this->getData(self::KEY_PRODUCT_ID);
    }

  public function setProductId($productId)
    {
        return $this->setData(self::KEY_PRODUCT_ID, $productId);
    }

will retun automatically. But I want to implement this in properway. without edit original files.

How to I achieve this.


texts: Products (seemingly) randomly disappearing until reindex

texts:
Curious question, one of my clients keeps noticing that randomly* individual products will disappear from the front end store view.

* Obviously, I know it isn't random, there must be something triggering it, but there is no common event that is immediately obvious.

I've read this question, however this deals with issues during reindex.

Theres 2 things that we've found we can do to bring the products back into the front end;

Simply go into the product and save it
Or run a reindex of the product & catalog related indexes

Has anyone run into anything similar before?

The site is fairly high traffic, but has only around 2000 products and 2 store views (only 1 accessible to the public) running 1.4.1.1


texts: Magento 2: How to solve the error 500 in Web Setup Wizard when installing Amazon Pay?

texts:
I want to install Amazon-Pay in my Magento 2.1.0

But I can't open the [Component Manager] page.

I got the 500 error when I opened the page [Web Setup Wizard] and click to [Component Manager] page.

Additional information:

RuntimeException

File:
/var/www/setup/src/Magento/Setup/Model/PackagesData.php:88
Message:
Couldn't get available versions for package shockwavemk/magento2-module-mail
Stack trace:
#0 /var/www/setup/src/Magento/Setup/Controller/ComponentGrid.php(98): Magento\Setup\Model\PackagesData->syncPackagesData()
#1 /var/www/vendor/zendframework/zend-mvc/src/Controller/AbstractActionController.php(82): Magento\Setup\Controller\ComponentGrid->componentsAction()
#2 [internal function]: Zend\Mvc\Controller\AbstractActionController->onDispatch(Object(Zend\Mvc\MvcEvent))
#3 /var/www/vendor/zendframework/zend-eventmanager/src/EventManager.php(444): call_user_func(Array, Object(Zend\Mvc\MvcEvent))
#4 /var/www/vendor/zendframework/zend-eventmanager/src/EventManager.php(205): Zend\EventManager\EventManager->triggerListeners('dispatch', Object(Zend\Mvc\MvcEvent), Object(Closure))
#5 /var/www/vendor/zendframework/zend-mvc/src/Controller/AbstractController.php(118): Zend\EventManager\EventManager->trigger('dispatch', Object(Zend\Mvc\MvcEvent), Object(Closure))
#6 /var/www/vendor/zendframework/zend-mvc/src/DispatchListener.php(93): Zend\Mvc\Controller\AbstractController->dispatch(Object(Zend\Http\PhpEnvironment\Request), Object(Zend\Http\PhpEnvironment\Response))
#7 [internal function]: Zend\Mvc\DispatchListener->onDispatch(Object(Zend\Mvc\MvcEvent))
#8 /var/www/vendor/zendframework/zend-eventmanager/src/EventManager.php(444): call_user_func(Array, Object(Zend\Mvc\MvcEvent))
#9 /var/www/vendor/zendframework/zend-eventmanager/src/EventManager.php(205): Zend\EventManager\EventManager->triggerListeners('dispatch', Object(Zend\Mvc\MvcEvent), Object(Closure))
#10 /var/www/vendor/zendframework/zend-mvc/src/Application.php(314): Zend\EventManager\EventManager->trigger('dispatch', Object(Zend\Mvc\MvcEvent), Object(Closure))
#11 /var/www/setup/index.php(31): Zend\Mvc\Application->run()
#12 {main}

Any ideas? Pls help, thanks!


texts:
My requirement is adding the same simple products in 2 different configurable products with the prices of the simple products to be different.
For e.g Simple product A added inside Configurable product B has price $20.
Whereas, The same Simple product A added inside Configurable product C has price $30.
How can i achieve this in magento 2.
I want to also know that, when editing the configurations for simple products inside configurable products here https://prnt.sc/t1we8i
When i select the option "Apply unique prices by attrbute" https://prnt.sc/t1wev8 and give different price for the product. It not only changes the price here https://prnt.sc/t1wfx8 but it also changes the price of the default simple product. https://prnt.sc/t1whli
I don't want that.
Can anybody help me in this. If my requirements are not cleared, please comment, i will again explain.


texts: Shopping cart REST API and frontend synchronization

texts:
I was able to sign in using /rest/V1/integration/customer/token and add items to cart. How do I view the cart (items I added using REST API) as a customer from front-end?

I want synchronize api cart with cart frontend.


texts: Simple vs Virtual Products for Virtual Products as Configurable Products

texts:
We have a bunch of Virtual Products in the sense that they are not shipped, but the only way to group them into a Configurable Product is to make them Simple Products. So, it seems that we should arrange our products catalog as Configurable Products containing Simple Products. With that being said:

What are the advantages & disadvantages of going with Simple vs
Virtual Products?
If we went with Virtual Products, I would imagine,
we'd have to modify some core functionality to allow Virtual
Products to be able to be grouped under a Configurable product? How
difficult is this to do?
If we went with Simple Products, we'd need to bypass the shipping step during checkout for those products. How is something like that accomplished?
What are the advantages & disadvantages of said modifications to achieve our desired functionality?


texts: Autoloader tries to include Wordpress files like WPSEO/Frontend.php and fails

texts:
My system.log file reads the below set of 9 items on repeat and just constantly fills up to a gig or more but I can't understand why it thinks these things are installed when they aren't. How do I deal with Varien/Autoload.php so it will stop all this?

2015-06-25T14:35:45+00:00 ERR (3): Warning: include(ReallySimpleCaptcha.php): failed to open stream: No such file or directory  in /home/fantomwo/public_html/store/lib/Varien/Autoload.php on line 94

2015-06-25T14:35:45+00:00 ERR (3): Warning: include(): Failed opening 'ReallySimpleCaptcha.php' for inclusion (include_path='/home/fantomwo/public_html/store/app/code/local:/home/fantomwo/public_html/store/app/code/community:/home/fantomwo/public_html/store/app/code/core:/home/fantomwo/public_html/store/lib:.:/usr/lib/php:/usr/local/lib/php')  in /home/fantomwo/public_html/store/lib/Varien/Autoload.php on line 94

2015-06-25T14:35:45+00:00 ERR (3): Warning: include(WPSEO/Frontend.php): failed to open stream: No such file or directory  in /home/fantomwo/public_html/store/lib/Varien/Autoload.php on line 94

2015-06-25T14:35:45+00:00 ERR (3): Warning: include(): Failed opening 'WPSEO/Frontend.php' for inclusion (include_path='/home/fantomwo/public_html/store/app/code/local:/home/fantomwo/public_html/store/app/code/community:/home/fantomwo/public_html/store/app/code/core:/home/fantomwo/public_html/store/lib:.:/usr/lib/php:/usr/local/lib/php')  in /home/fantomwo/public_html/store/lib/Varien/Autoload.php on line 94

2015-06-25T14:35:45+00:00 ERR (3): Warning: include(All/In/One/SEO/Pack.php): failed to open stream: No such file or directory  in /home/fantomwo/public_html/store/lib/Varien/Autoload.php on line 94

2015-06-25T14:35:45+00:00 ERR (3): Warning: include(): Failed opening 'All/In/One/SEO/Pack.php' for inclusion (include_path='/home/fantomwo/public_html/store/app/code/local:/home/fantomwo/public_html/store/app/code/community:/home/fantomwo/public_html/store/app/code/core:/home/fantomwo/public_html/store/lib:.:/usr/lib/php:/usr/local/lib/php')  in /home/fantomwo/public_html/store/lib/Varien/Autoload.php on line 94

2015-06-25T14:35:45+00:00 ERR (3): Warning: include(Woocommerce.php): failed to open stream: No such file or directory  in /home/fantomwo/public_html/store/lib/Varien/Autoload.php on line 94

2015-06-25T14:35:45+00:00 ERR (3): Warning: include(): Failed opening 'Woocommerce.php' for inclusion (include_path='/home/fantomwo/public_html/store/app/code/local:/home/fantomwo/public_html/store/app/code/community:/home/fantomwo/public_html/store/app/code/core:/home/fantomwo/public_html/store/lib:.:/usr/lib/php:/usr/local/lib/php')  in /home/fantomwo/public_html/store/lib/Varien/Autoload.php on line 94

2015-06-25T14:35:45+00:00 ERR (3): Strict Notice: Static function Minify_Inline::minify() should not be abstract  in /home/fantomwo/public_html/wp-content/plugins/w3-total-cache/lib/Minify/Minify/Inline.php on line 8


texts:
I am using 1.9.1.0. When I Click Continue Button on Shipping Method. The Page Redirect to cart Page. After I analysis the error on js. I have tried disable and enabling the various shipping methods no joy having same issue.
please help me out from the issue.  I have posted the error below. its taken by browser console.

POST https://example.com/checkout/onepage/saveShippingMethod/ 500 Internal Server Error 403ms   c359267...57db.js (line 1530)

"NetworkError: 500 Internal Server Error - https://example.com/checkout/onepage/saveShippingMethod/"

The error 1530 line below:-

this.transport.send(this.body);

The Below Steps are already done:-
1. Changing the file permissions
2. Increasing memory_limit

Error on system.log:-

  2016-11-17T09:21:22+00:00 ERR (3): Strict Notice: Declaration of Sm_Market_Block_Page_Html_Head::addItem() should be compatible with Extendware_EWCore_Block_Override_Mage_Page_Html_Head::addItem($type, $name = NULL, $params = NULL, $if = NULL, $cond = NULL)  in /usr/share/nginx/html/includes/src/Sm_Market_Block_Page_Html_Head.php on line 94

and think Extendware_EWCore is not compatible so i was disabled the module. having no joy. same issue happening.


texts: Multi store URL's of wrong store with GEOIP extension

texts:
I am using Magent0 2.0.6
PHP 7.0.32

I have multiple store views:
 - Dutch
 - English
 - French

And have GeoIP extension installed that check user's IP and redirect to matching store.

But on the frontend catalog page, if I am in the Frech store, the URL's are still of the Dutch store. But If I check the admin panel I have correct url keys stored depending upon each store view.

Does anyone know what could be the issue?


texts:
I'm trying to resize all the images in my 2.3.4 Magento database. I have about 100 images to resize.
When I run the command line instruction, bin/magento catalog:images:resize , it comes back with a message when amost done that it is killed.
Is this a memory issue? Is this a processing issue? A time issue? I would like to do the rest of the images. Is there a way to start the resize at the 50% completed mark or ?


texts: Magento 2 Update Cart Redirects To Homepage

texts:
I've just moved our Magento website to a new server and for some reason the update cart button within the cart redirects the user back to the homepage.

Unsure why this is happening since it is working correctly on my local version and on the old server as it should.

Does anyone know whether this is server related or whether there is anyway to update the coding to ensure it stays on the cart when updating?

Any advice to be able to resolve this?


texts: Error when upgrading from magento 2.2.5 to magento 2.2.8

texts:
When upgrading Magento version 2.2.5 to version 2.2.8 it throws the following error

Problem 1

- Can only install one of: temando/module-shipping-m2[1.3.10, 1.3.7].
- Can only install one of: temando/module-shipping-m2[1.3.10, 1.3.7].
- Can only install one of: temando/module-shipping-m2[1.3.7, 1.3.10].
- magento/product-community-edition 2.2.8 requires temando/module-shipping-m2 1.3.10 -> satisfiable by

  temando/module-shipping-m2[1.3.10].
      - Installation request for magento/product-community-edition 2.2.8 -> satisfiable by magento/product-community-edition[2.2.8].
      - Installation request for temando/module-shipping-m2 (locked at 1.3.7) -> satisfiable by temando/module-shipping-m2[1.3.7].


texts:
I've end up having the following query:

SELECT
  entity_id,
  count(version_id) as number_of_versions,
  max(version_id) as max_version
FROM catalog_product_flat_cl
GROUP BY entity_id
ORDER BY number_of_versions DESC

giving the following output

entity_id  number_of_versions   max_version
    19305                 297       2476959
    20084                 294       2479871
    17728                 293       2471572
    22541                 292       2483741
    22543                 292       2483743
    22131                 292       2471939
    19306                 291       2476960
    18660                 290       2474991
    18674                 289       2475023
    18671                 287       2475020
    18662                 287       2474993
    22387                 287       2478594
    17850                 286       2472048
    17727                 286       2471539

which seem like something is terribly wrong.

So the question is: it safe to store that in a temp table and delete per entity_id where version is smaller then the max version? Like this

CREATE TABLE _temp_table (
  entity_id INT UNSIGNED NOT NULL,
  number_of_versions INT UNSIGNED NOT NULL,
  max_version INT UNSIGNED NOT NULL,
  PRIMARY KEY (entity_id));

INSERT INTO _temp_table
SELECT
  entity_id,
  count(version_id) as number_of_versions,
  max(version_id) as max_version
FROM catalog_product_flat_cl
GROUP BY entity_id
ORDER BY number_of_versions DESC

DELETE FROM catalog_product_flat_cl
USING _temp_table AS tmp
WHERE catalog_product_flat_cl.entity_id = tmp.entity_id
  AND catalog_product_flat_cl.version_id < tmp.max_version;

DROP TABLE _temp_table;

NOTE: I'm not asking for errors in my SQL code above, I'm asking if the general idea of deleting items by hands from the change-log tables is ok.

NOTE: the deletion code above is untested, if you decide to use it on your Magento database - take backup first.

kind of related topics
Changelog tables and optimizations
https://maxchadwick.xyz/blog/magento-enterprise-index-lesson-329


texts: how to print array to csv in standalone script

texts:
hi am trying to put my array data to csv in magento 1.9 where i fetching all the order details using standalone script

my php script

<?php
require_once 'app/Mage.php';
Mage::app();
Mage::app()->getStore()->setId(Mage_Core_Model_App::ADMIN_STORE_ID);
$orderCollection = Mage::getModel('sales/order')->getCollection();

foreach ($orderCollection as $order) {
        $orders['orders'][] = array(
            'id'            => $order->getIncrementId(),
            'store'         => 'magento',
            'status'        => $order->getStatus(),
            'name'          => $order->getCustomerName(),
            'email'         => $order->getCustomerEmail(),
            'telephone'     => $order->getShippingAddress()->getTelephone(),
            'street'        => $order->getShippingAddress()->getStreet(),
            'pincode'       => $order->getShippingAddress()->getPostcode(),
            'city'          => $order->getShippingAddress()->getCity(),
            'weight'        => $order->getWeight(),

        );

     foreach ($order->getAllItems() as $item) {
       $orders['orders']['items'][] = array(
            'id'            => $order->getIncrementId(),
            'name'          => $item->getName(),
            'sku'           => $item->getSku(),
            'Price'         => $item->getPrice(),
            'Ordered Qty'   => $item->getQtyOrdered(),

        );

       $fp = fopen('test_export.csv', 'w');

foreach ($orders as $fields) {
    fputcsv($fp, $fields);
}

fclose($fp);

    }
    }
print_r($orders);

echo "<pre>"; print_r($orders);

output:-

Array ( [orders] => Array ( [0] => Array ( [id] => 100000001 [store] => magento [status] => complete [name] => pramod mishra [email] => pramod.mishra@netsmartz.net [telephone] => 01234567890 [street] => Array ( [0] => plot no-10 ) [pincode] => 160101 [city] => chandigarh [weight] => 10.0000 ) [items] => Array ( [0] => Array ( [id] => 100000001 [name] => test [sku] => test [Price] => 10.0000 [Ordered Qty] => 1.0000 ) ) ) )


texts: How to export/import admin settings in M2?

texts:
Having set many settings in the back end, how does one export those so that they could be applied to another installation of Magento 2? (Or, for that matter, just review them all by eye in one go without having to poke through the UI for each one or few of them.)

Of particular interest are attributes and attribute sets, and all the extensive settings in Stores > Configuration

(I am already aware of Product import and export, System > Export and Import, but these don't cover the items I ask about here.)

This is for Magento 2.1.x CE.


texts: Can't apply "sale rule" in cart without reload page

texts:
How I can determine what "sales rules" is applied after changing set of items in cart without reloading page. Tried something like this, but correct rules applied after reloading page. Magento 1.9.0.1

$cart = Mage::getSingleton('checkout/cart');

$quote = $cart->getQuote();

$quote->removeAllItems();

$quote->addProduct($product, 1);

$quote->collectTotals();

$quote->save();

$cart->save();

$cart->init();

$quote = $cart->getQuote();

$quote->collectTotals();

if($quote->getAppliedRuleIds())

foreach (explode(',',$quote->getAppliedRuleIds()) as $ruleId) {

    $rules[] = Mage::getResourceModel('salesrule/rule_collection')->getItemById($ruleId);

}


texts:
i create block in magento admin panel and i Calling template in it,the code is this (dynamic data)

  {{block type="core/template" template="catalog/category/sub.phtml"}}

My problem is here, my block cache by magento and it doesnt work correctly,
how can i disable cache for this Specified block?


texts: magento 2.3 redirect all product urls without category path to urls with category path

texts:
I want to redirect all product URLs without a category path to their category path URLs for SEO purposes.

  Example - Redirect mywebsite.com/product-name.html to
  mywebsite.com/category1/sub-category/product-name.html.

I am thinking to override the observer on the event when a url is hit in magento.
How to find that event?

Please help.


texts:
Is there a way to fire a fotorama click event from a template file?

What I am trying to do is have the functionality where, when the user selects an options from the dropdown from the catalog-product-view page, it fires a click event that will select a photo associated with that item.

Code:

app/design/frontend/Vendor/Module/Magento_Catalog/templates/view/option/wrapper.phtml

<?php

$required = '';
if ($block->hasRequiredOptions()) {
    $required = ' data-hasrequired="' . __('* Required Fields') . '"';
}

?>
<div class="product-options-wrapper" id="product-options-wrapper"<?php
/* @escapeNotVerified */ echo $required; ?>>

      <?php echo $block->getChildHtml('', true);?>


texts: Catalog Page - Replace Filter Dropdown by Simple Links

texts:
I wish to replace the drop-down (position, name, price) on the catalog page by simple links.

www\app\design\frontend\base\default\template\catalog\product\list\toolbar.html


texts: Send Custom image in Abandoned cart email

texts:
We are sending abandoned cart email to customers successfully with help of below code. In email we are sending Product image.

<?php foreach ($this->getQuote()->getAllVisibleItems() as $item): ?>

<img src="<?php echo $this->getImageUrl($item->getProduct(), 100) ?>"/>

<a href="<?php echo $item->getProduct()->getProductUrl() ?>"><?php echo $item->getName() ?>

    <?php echo $this->getFormattedPrice($item->getPrice()) ?>

<?php endforeach ?>

We are allowing Customer to Upload Custom image on Product Image & once customer Add to cart that product ,  We need to send Custom Image in Abandoned Cart email.

we are using below code for that , but its not sending custom image in email

<?php if ($this->getQuoteImage($item)): ?>
    <img src="<?php echo $this->getQuoteImage($item) ?>" />
<?php endif ?>

we are saving custom image in table : sales_flat_quote_item_option & column : value

image is saving in this path : media/custom_options/quote/2/0/image1.png

what i am missing to send custom image in Abandoned cart email.


texts: How can I use a different theme for checkout?

texts:
I am having to work with a site that has quite a poor theme that really needs to be redone completely. I am not able to do that now but I do need to make the checkout and customer areas fully functional and visually appealing. The default rwd theme is a better starting point than the rubbish theme the site has.

Therefore, how can I change the layout of large parts of the site, e.g. the secure areas, to be a different design package/theme that only inherits from the built in themes?

If I could make just the checkout page work from the base themes/package that would be great.


texts: Check Bulk SKUs against existing Product's Skus during import

texts:
How can we check Bulk SKUs(in custom DB table) against existing Product SKUs ,
and if SKU from custom table is not present in product collection than need to create a product with that SKU.

What currently I am doing is looping and checking, but this seems is'nt a good approach.

Any other way of doing this more efficiently ?

$feed_products = Mage::getModel('custom_module/customproduct')->getCollection();

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

foreach ($feed_products as $part) {

    $id = Mage::getModel('catalog/product')->getIdBySku($part['sku']);

    if ($id) {
        //echo 'Exists'.$part['sku'].'
';
        //no Action
    } else {
        echo 'Doesnot Exists'.$part['sku'].'
';
    }
}


texts:
I am trying to install Magento 2.3 with PWA studio, but when I run below command I am getting an error

yarn run build

error

  ".graphqlconfig" file is not available in the provided config directory: /var/www/html/magento/pwa-studio
  Please check the config directory.

Please help me!.


texts: Add customers order comment to 'Order Confirmation' transaction email

texts:
When the customer places an order on the frontend they have the ability to add a comment to their order. What i would like to do is add this comment to the transaction email 'Order Confirmation' I checked in the listed variables but i can't seem to see a variable that would print this information, however in the same template this is used:

{{var order.getEmailCustomerNote():escape|nl2br}}

Is this the order comment? cause if it is, it is not displaying for me. How would i go about adding the customers order comment to this template or will i need to write a custom module?

does this functionality/variable already exist to display the order comment?

Thanks


texts:
I am having an issue with Paypal sending IPN messages to my Magento 1.6.2 store a short time (30 minutes or so) after an order has been completed.
When the message is received, the order is marked as "Processing" again.
The problem here is that these orders are automatically downloaded into our backoffice Sage 200 system every 15 minutes, and marked as "Exported" in Magento at that time, so that the export schedule doesn't download them twice, and therefore create a duplicate order in Sage 200 (it only downloads orders marked as "Processing").

It doesn't happen to all orders, so I'm not sure why it happens at all?
Any pointers on how to debug, and more importantly, prevent this from happening, would be greatly appreciated!


texts:
How can I override the following file for Magento-2.2.2

vendor/magento/module-checkout/view/frontend/web/template/minicart/content.html

Is there something different between .html and .phtml ??
As I have no problem with .phtml files overriding.

This is what I have done to override:

Copy the content from:
vendor/magento/module-checkout/view/frontend/web/template/minicart/content.html
Paste the content and make little change in here:
app/design/frontend/VendorName/theme-name/Magento_Checkout/web/template/minicart/content.html
Perform all these:
php bin/magento setup:upgrade
php bin/magento -f setup:static-content:deploy
php bin/magento indexer:reindex
php bin/magento cache:flush
Browser's cache is also cleared!

After doing  all the things, no change in frontend.

Anyone know what to do?


texts: Magento2 multistore - redirect url without store code to default storeView url

texts:
Not sure if this is a bug in this project, or a Magento2 bug itself
The question is site is configured to use store code in urls, and that's working fine... but urls without any store code are loading too, causing SEO problems due to content duplicity

Example: "en" is the store code of default storeView
http://ourproject.com/home -> loads fine
http://ourproject.com/en/home -> loads fine
http://ourproject.com/home should redirect 301 to http://ourproject.com/en/home

Any ideas about how to force (in a clean way) any url to use store code of default storeView?
update
We use Apache as webserver


texts:
I am just new in magento. I have installed magento on my localhost. After installing I have tried to login as admin, But I can't be able to login. I have tried in different browsers, But all browsers are redirecting to the login page itself. I have tried the solution given in this question. But it was producing error.

Please any one help me to solve this issue.


texts:
I'm currently using PowerShell's Invoke-RestMethod to access Magento APIs.  My problem is I'm trying to pass some searchCriteria in a $body variable to look for a specific 'increment_id'.
Here is the code:

    $body = @{
'searchCriteria' = @{
         'filterGroups' = @{
                 'filters' = @{
                         'field' = 'increment_id'
                         'value' = '878'
                         'condition_type' = 'eq'
                     }
                }
            }
        }

Invoke-RestMethod -Uri $uri -Headers $header -Body $body -OutFile "C:\order.txt"

When this command is run, I get a response that contains all of the orders on our site.  At this point, I'm just trying to learn my way through using the Invoke-RestMethod command, but my end goal is to use this command to retrieve the latest order that was placed on the Magento site.

Thanks,
Trevor


texts:
I have created a custom attribute called price_incvat and, following the basic instructions here mashed up with some answers found elsewhere on this site, I have tried to create a module that uses an observer to populate the attribute field in a product with the price of the product plus VAT (20%). I don't really know what I'm doing so of course it hasn't worked. Here's my config.xml

<?xml version="1.0" encoding="UTF-8"?>

<config>
    <modules>
         <cvnstore_IncVatAttribute>
                <version>0.0.1</version>
         </cvnstore_IncVatAttribute>
    </modules>
    <global>
        <models>
            <cvnstore_incvatattribute>
                   <class>cvnstore_IncVatAttribute_Model</class>
            </cvnstore_incvatattribute>
        </models>
        <events>
            <catalog_product_save_before>
                  <observers>
                      <cvnstore_incvatattribute>
                        <class>cvnstore_incvatattribute/observer</class>
                        <method>incVatUpdate</method>
                        <type>singleton</type>
                      </cvnstore_incvatattribute>
                  </observers>
              </catalog_product_save_before>
           </events>
     </global>
</config>

And my Observer.php

class cvnstore_IncVatAttribute_Model_Observer
    {
        public function incVatUpdate(Varien_Event_Observer $observer)
            {
                $product = $observer->getEvent()->getProduct();
                $price = $product->getPrice();
                $product->setPriceIncvat($price*1.2);
            }
    }

I will be very grateful to anyone who takes the time to set me straight.


texts: Magento 1.9 - When I open my site opens a page of advertising

texts: my problem of my site is this...when i open my site opens a page of advertising. How can I eliminate this malware from my site?


texts: Modifications at /simple/Magento_Sales/templates/email/items.phtml is not working

texts:
We are currently modifying the email template. We want to add another column to the order summary table for the product thumbnail.
So we modified the following files:
Magento_Sales/templates/order/totals.phtml

Magento_Sales/templates/order/items.phtml

Magento_Sales/templates/order/items/renderer/default.phtml

Magento_Sales/templates/email/items.phtml

Magento_Sales/templates/email/items/order/default.phtml

After the modification, this is the result.

Our expected result should be

Upon investigation, it seems that our modification in "Magento_Sales/templates/email/items.phtml" is not working (Magento is not accepting our modifications?)
Do you have an idea why is this happening?
Other details:
Magento version: 2.4.0
We also overridden


texts: What purpose have category attribute sets?

texts:
Since Categories are EAV Models, they also have an attribute set. All categories, which are created from the admin panel get the default attribute set. This is set by the controller (\Mage_Adminhtml_Catalog_CategoryController::saveAction).

On the other side, when I create a category programatically and don't set the attribute set id, the id 0 is saved to the entity table. The category is shown in frontend and backend anyway and seems to have all attributes.

Also the import module Avs_Fastsimpleimport hardcodes the attribute set id to 0 in the category import (\AvS_FastSimpleImport_Model_Import_Entity_Category::_saveCategories).

It seems that the attribute set id of categories doesn't matter. So what purpose has this and should I set the attribute set id when I create categories programmatically?


texts:
Can anyone let me know what is good practice for adding custom js file in a custom plugin?
should I add it to skin's js folder or should i add it to root's js folder?


texts: Newsletter subscribed but no confirmation mail

texts:
If I subscribe to the newsletter as guest I get a email to confirm my subscribtion but after I confirm I don't get a confirmation mail that I am subscribed now.

How can I change this to get the confirmation mail?


texts: Magento 2 Canonical url for home cms page

texts: As per SEO expert I need to have domain url as canonicalurl. As per magento 2 settings doesnt allow it to be empty. attached screenshot shows same. I get https://www.portablerestroomtrailers.com/homepage. It should be https://www.portablerestroomtrailers.com/


texts: MySQL 5.5 vs 5.6: Are there any Magento 1.9 benchmarks?

texts: Since there are mixed results floating around the web regarding performance of Mysql 5.6, I was wondering if anyone has tested it with both 5.5 and 5.6 and noticed any differences?


texts:
How can we achieve below?

if a customer selects options from layered navigation and then goes to a product page, and then back to the category/search view, all of their selections are wiped away.  Is there a way to hold those selected options so customers don’t have to re-filter?

How can I set layered navigation filters pro-grammatically?


texts: Logged In or Not check works only in Customer pages not other pages Magento 2

texts:
User logged in or not checking not works in other pages such as Product, Category and other static pages but its works well on customer pages like Dashboard, Address book, Orders etc...

Here is my helper: app/code/MyVendor/MyUserModule/Helper/Data.php

<?php
        namespace MyVendor\MyUserModule\Helper;
        class Data extends \Magento\Framework\App\Helper\AbstractHelper
        {

            public function __construct(
                \Magento\Framework\App\Helper\Context $context,
                \Magento\Customer\Model\Session $customerSession
            ) {
                $this->customerSession = $customerSession;
                parent::__construct($context);
            }

            public function isLoggedIn()
            {
                return $this->customerSession->isLoggedIn();
            }
            public function userLoggedDetails()
            {
                return $this->customerSession->getCustomer();
            }
        }
?>

And phtml like this

<?php
    $customerSession = $this->helper('MyVendor\MyUserModule\Helper\Data');
    if($customerSession->isLoggedIn()) {
        echo "Welcome ".$customerSession->userLoggedDetails()->getName();
    }else{
        echo "Login";
    }
?>

Also I noticed logged in or not checking works well on all pages while call  ObjectManager directly, like this way

$om = \Magento\Framework\App\ObjectManager::getInstance();
$customerSession = $om->create('Magento\Customer\Model\Session');

but this method not recommended by experts, so should follow Constructor injecting proper method, Anyone know what I missed, please.


texts: Magento Connect Manager is Broken post Migration

texts:
Magento Connect Manager shows an error "Unable to save settings" when changing settings, and "No file was uploaded" when trying to install an uploaded package from a tgz file.

I'm using Magento CE 1.8.1 on PHP 5.3.3

All permissions have been set to 777.


texts: Magento 2 CE : Add child navigation items to navigation menu

texts:
We have added some custom navigation items to the navigation using default.xml and is working just fine, but for the life of me I can't figure out how to add child items to these parent navigation items.

My goal is to add direct links to catalog filters -- such as Mens or Womens under each parent navigation item.`

Here is the XML I'm using, many thanks in advance!

<?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="catalog.topnav">
           <block class="Magento\Framework\View\Element\Html\Link\Current" name="Shoes">
                <arguments>
                    <argument name="label" xsi:type="string">Shoes</argument>
                    <argument name="path" xsi:type="string">shoes</argument>
                </arguments>
          </block>
           <block class="Magento\Framework\View\Element\Html\Link\Current" name="Shorts">
                <arguments>
                    <argument name="label" xsi:type="string">Shorts</argument>
                    <argument name="path" xsi:type="string">shorts</argument>
                    <argument name="class" xsi:type="string">shorts</argument>
                </arguments>
            </block>
       </referenceContainer>
    </body>
</page>


texts: Magento Upgrade/Roadmap/Migration from 1.9 to 2.0

texts:
As we all know, Magento 2.0 is now available.
Many of us are running an older version of Magento (atm).

In my opinion, we need to build a roadmap to migrate Magento to the newest version.

For older roadmaps/upgrade tips:

- 1.7 to 1.9: Magento upgrade from 1.7 to 1.9

- 1.6 to 1.9:
Best way to upgrade Magento 1.6.2.0 to 1.9.0.1

Did someone already upgraded/migrated magento to the newest version? Do you have any suggestions, tips or marks?

Hopefully we can help each other to upgrade succesfully to the newest version of Magento.

Cheers


texts: Trigger shipping email manually using order id in magento2

texts:
I want to trigger shipping email manually , while hitting file i tried below but mail is not triggered please tell me any option available to sent email?

$convertOrder = $objectManager->create('Magento\Sales\Model\Convert\Order');
        $shipment = $convertOrder->toShipment($order);

        // Loop through order items
        foreach ($order->getAllItems() AS $orderItem) {
            // Check if order item has qty to ship or is virtual
            if (! $orderItem->getQtyToShip() || $orderItem->getIsVirtual()) {
                continue;
            }
            $qtyShipped = $orderItem->getQtyToShip();
            // Create shipment item with qty
            $shipmentItem = $convertOrder->itemToShipmentItem($orderItem)->setQty($qtyShipped);
            // Add shipment item to shipment
            $shipment->addItem($shipmentItem);
        }
        $shipment->register();
        $shipment->getOrder()->setIsInProcess(true);
        try {
            // Save created shipment and order
            $shipment->save();
            $shipment->getOrder()->save();
            // Send email
                $objectManager->create('Magento\Shipping\Model\ShipmentNotifier')
                ->notify($shipment);
echo "mail success";
                $shipment->save();

        }


texts: Product review form not displaying on product view pages

texts:
I have tried this solution and many other solutions to display review form on product view page but it doesnot help.

I applied these code in catalog.xml class catalog_product_view in top,root and content but every time i see no result.


texts: White screen Magento homepage after migration settings

texts:
When going to our base url we get a white screen on the homepage:

http://95.85.37.169/

We migrated from magento 1.9.0.1 to 2.0.7 and cannot figure out why this is crashing now.

I cannot figure out why it is crashing. This is the code for the homepage where it crashes after:

<body data-container="body" data-mage-init='{"loaderAjax": {}, "loader": { "icon": "http://95.85.37.169/pub/static/frontend/Smartwave/porto/nl_NL/images/loader-2.gif"}}' class="cms-index-index page-layout-custom-static-page-one">
        </body>

Anybody has a clue?


texts: How to keep billing info saved on checkout step if page refreshed

texts:
I wanted to find out if anyone knows of a way to keep billing info saved in Magento Onepage Checkout billing step if the page is refreshed. The reason is probably obvious but in the scenario that a customer choose to edit their cart having reached the end it would be painful to force them to re-enter their billing info all over again...

I have enabled persistent shopping cart but it isn't saving the data after page refresh so I would be grateful if anybody knew of another way that they could share with us please.


texts: Magento 2.1.8/2.1.9: Unable to create subcategory

texts:
I am able to create new root categories (and sub-categories of those), but if I try to create a new subcategory in "Default Category" (or any of its subcategories), I receive the following exception:

  main.CRITICAL: InvalidArgumentException: indexMethod must be one of  in /home/site/websites/www.mysite.com/htdocs/vendor/magento/framework/DB/TemporaryTableService.php:104

It may or may not be related, but the catalog_url_rewrite_product_category table is completely empty.

I have tried reindexing, clearing caches, compiling, etc. All to to no avail.

Has anyone else experienced this?


texts: Magento 2 How to create simple module that echoes text on checkout success page?

texts:
I have tried all examples found on Magento forums but I can't make it work.

I need to get Order ID and customer email on checkout success page.

Here's my module structure:

TV2M/GoogleSurvey/registration.php

<?php
\Magento\Framework\Component\ComponentRegistrar::register(
    \Magento\Framework\Component\ComponentRegistrar::MODULE,
    'TV2M_GoogleSurvey',
    __DIR__
);

TV2M/GoogleSurvey/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="TV2M_GoogleSurvey" setup_version="1.0.0" schema_version="1.0.0">
    </module>
</config>

TV2M/GoogleSurvey/Block/Onepage/Success.php

<?php
namespace TV2M\GoogleSurvey\Block\Onepage;
use \Magento\Framework\View\Element\Template;

class Success extends \Magento\Checkout\Block\Onepage\Success
{
    public function getGoogleSurvey()
    {
        return "my@email.com";
    }
}

Module is activated, setup upgrade, cache clean...

In my theme folder, I have created a phtml file called by layout XML. File is loaded correctly. But when I call my function it returns nothing: echo $block->getEmail();

I have also tried to add di.xml:

TV2M/GoogleSurvey/etc/frontend/di.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <preference for="Magento\Checkout\Block\Onepage\Success" type="TV2M\GoogleSurvey\Block\Onepage\Success" />
</config>

Can someone please tell me how to access getGoogleSurvey() function? Which files are necessary in my module? Thanks in advance.


texts: Magento 2.3.5: Attribute value is changing automatically after every hour

texts:
I have created a custom attribute with Yes/No values in Magento 2.3.5. Its value is changing automatically after every hour from Yes to No. I can't figure out what is changing its value. Can any know a method to figure it out or know a way to debug this issue?
I have a lot of third-party extensions on my site but can't figure out which extension is changing this value.


texts: Do we setup cron base on local time or UTC time

texts:
I have a system cron that run every 15 minutes that invoke the magento cron.sh. Inside the  magento module config.xml, I setup crontab to run at 1 am

<crontab>
    <jobs>
        <catalogrule_apply_all>
            <schedule>
                <cron_expr>0 1 * * *</cron_expr>
            </schedule>
            <run>
                <model>catalogrule/observer::dailyCatalogUpdate</model>
            </run>
        </catalogrule_apply_all>
    </jobs>
    <events>
        <catalog_product_get_final_price>
            <observers>
                <catalogrule>
                    <class>catalogrule/observer</class>
                    <method>processAdminFinalPrice</method>
                </catalogrule>
            </observers>
        </catalog_product_get_final_price>
    </events>
</crontab>

Is this 1 AM the local time or the UTC time? because I think magento is using UTC time only when store data into db.


texts: Magento 1.9.x - Add class="{{title}}" to CustomOptions frontend Output

texts:
Looking for a way to add the Product > Custom Options > Select Option "Title" also as class to the same option entry.

Default Custom Options Select Frontend Output:

<select>
 <option value="1">Title</option>
</select>

What I'm after...:

<select>
 <option value="1" class="Title">Title</option>
</select>

No need for an additional admin field + DB entry. If the title is used as input for the .class name would be great.
Thanks.


texts: Magento 2 - Manage Stock + ERP - Stock Reservation and Salable Quantity issue

texts:
We have Magento 2.3 integrated with an ERP to manage our stock levels, everything seems to be working fine until we have noticed a problem with products with low stock levels.

Example:

Product 'A' has 20 qty in Magento which is correctly synchronized with the ERP.

An order is placed to buy 10 units of product 'A' in Magento.

Magento creates a stock reservation for 10 units but in a few minutes the ERP will come and deduct the qty from 20 to 10.

Because Magento has 10 reserved now the product shows out of stock in the frontend even though we have 10 available.

Any ideas on how to solve it?

Thank you very much.


texts: How to Change Product Price as per selected options on List Page?

texts:
I want to show Configurable Product Options on category Page for that i have added this code in my list.phtml. it shows the options of the configurable products.

<?php if($_product->isConfigurable()): ?>
                <?php $attributes = $_product->getTypeInstance(true)->getConfigurableAttributesAsArray($_product); ?>
                <?php foreach($attributes as $attribute): ?>

<?php echo $attribute['label']; ?>

                     <select name="super_attribute[<?php echo $attribute['attribute_id'] ?>]" id="attribute<?php echo $attribute['attribute_id'] ?>">
                        <option> <?php echo $this->__('Choose an option') ?></option>
                        <?php $values = $attribute['values']; ?>
                        <?php foreach($values as $value): ?>
                            <option value="<?php echo $value['value_index']; ?>" price="<?php echo $value['pricing_value']; ?>"><?php echo $value['label']; ?></option>
                        <?php endforeach; ?>
                    </select>
                <?php endforeach; ?>
<?php endif; ?>

But the problem is

1.how to change Product price according to selected options?

In some products there are two configurable options and the values of second one depends on the First option Selected(on product page).

How to Do the same on List page?


texts: Magento 2 Customer last_login_at column not exporting

texts: I am unable to export the last_login_at column which is in the customer_log table in System -> Export -> Customer Main File area. Could you please help me out?


texts: What `catalog_product_index_eav_idx` is used for?

texts:
I am trying to understand better the indexer process and see it I can find a way to optimize it.

In particular, since it is the biggest table on my DB, I am focused on this table catalog_product_index_eav_idx:

It contains association between products and their attribute values (all attributes or only some ? )
Many records are the same the only difference is the storeview ( It think this could be changed to reduce the space on the table )
I cannot find any point it the code ( except the reindex part ) where this table is actually used ( what is the purpose of this table, also given the fact there is a product_flat table ? )

Thanks


texts: Invalid map filename when running data migration tool from custom extension

texts:
I tried to create a custom module to create a custom configuration for Magento 2 data migration tool, like this:

app/code/Vendor/Migration/etc/module.xml

<?xml version="1.0" ?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
    <module name="Vendor_migration" setup_version="1.0.0">
        <sequence>
        <module name="Magento_DataMigrationTool"/>
    </sequence>
  </module>
</config>

app/code/Vendor/Migration/composer.json

{
    "name": "vendor/module-migration",
    "description": "Providing config for migration",
    "config": {
        "sort-packages": true
    },
    "require": {
        "magento/framework": "*",
        "magento/data-migration-tool": "*"
    },
    "type": "magento2-module",
    "autoload": {
        "files": [
            "registration.php"
        ],
        "psr-4": {
            "Vendor\\Migration\\": ""
        }
    },
    "version": "1.0.0"
}

app/code/Vendor/Migration/registration.php

<?php
\Magento\Framework\Component\ComponentRegistrar::register(
    \Magento\Framework\Component\ComponentRegistrar::MODULE,
    'Vendor_Migration',
    __DIR__
);

app/code/Vendor/Migration/etc/opensource-to-opensource/1.9.3.8/config.xml

...
<options>
        <map_file>app/code/Vendor/Migration/etc/opensource-to-opensource/1.9.3.8/map.xml</map_file>
        <class_map>app/code/Vendor/Migration/etc/opensource-to-opensource/1.9.3.8/class-map.xml</class_map>
...
</options>
...

when I run the migration, I got the following error:

php bin/magento migrate:settings -r -a app/code/Vendor/Migration/etc/opensource-to-opensource/1.9.3.8/config.xml

  Invalid map filename:
  /var/www/M2/vendor/magento/data-migration-tool/app/code/Vendor/Migration/etc/opensource-to-opensource/1.9.3.8/class-map.xml

it seems it still call the vendor module path as a prefix


texts: find all applied coupon code/rules for an order

texts:
Is it possible to find out all coupon codes was applied for an specific order?

i can only found out 1 coupon codes was applied for an order in sales_flat_order table. In the table, only 1 field was storing a coupon code (last code applied).

anyone know how to do that?


texts:
I have shifted my store from Magento Enterprise to Magento Go, now I need to require to import orders from enterprise to go but there is no functionality in magento for this and also I didn't find any extension for this.
So, I tried to use magento api to create order in go by taking order info from enterprise.
But I am getting following issues.

Api is not setting customer email id in newly created order via api.
If I tried to create an order on existing email, it is throwing exception and creating order as guest user only.
It is also throwing exception if it doesn't find same coupon code, payment method and shipping method.
How can I fetch customer id in magento go via api, as I needed it to create orders for registered customers.

How can I resolve all the above issues?


texts: Magento2.2.5 issue getting custom attributes to show correctly

texts:
I have a Magento2.2.5 based website and have edited the list.phtml file to use 3 custom attribute fields for products which we use to format the names in a specific way. My issue is some products have no value in the field we call item_subname_3 so what is happening on the list.phtml file is for items that dont have a value in the item_subname field it is just showing the previous products value over and over again. I tried setting the variable $item_subname_3 to blank before then grabbing the custom attribute value but that does not seem to work. Any suggestions on how I can get the desired outcome? thank you

 <?php
     //echo $_helper->productAttribute($_product, $_product->getName(), 'name');
     $productId = $_helper->productAttribute($_product, $_product->getId(), 'name');

     //show products names using custom item_name fields
     $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
     $_productdata = $objectManager->get('Magento\Catalog\Model\Product')->load($productId);
     $item_subname = $_productdata->getData('item_subname');
     $item_subname_2 = $_productdata->getData('item_subname_2');
     $item_subname_3 ='';
     $item_subname_3 = $_productdata->getData('item_subname_3');

     echo "
$item_subname";
     echo "
$item_subname_2";
     if($item_subname_3 != ''){ echo "
$item_subname_3"; }
     echo "
";
   ?>


texts: Magento Multi-store Products not Displaying

texts:
I have setup two store fronts in Magento as domain1.com and domain2.com.  Everything seems to be set up properly as changing the domains will display both different themes and different categories as specified in the backend.

However, my second root category for domain2.com does not display any products in it in both the front end and back end. The secondary root is set active and also as anchor. It contains two subcategories which display fine on store front except for the fact that the products I have placed in them are not displaying.

In the backend when editing the categories I can fill both root categories with products. But if I select the secondary store front from the View drop down, I am unable to add any products into this category.  Only when all store views is selected can I see any products in the backend.

Has anyone experienced this issue before or have an idea as to where my configuration may be wrong?

Thanks

Update: Even changing the root category of the secondary store to the original root category still displays no products while the original domain displays fine.


texts: How do I prevent shipping price from being discounted when applied to cart?

texts:
My cart in 1.9.2.2 is discounting the shipping cost for some reason. Set at a flat $ 25 and when applied to cart, it equals $ 23.07. Have tried different amounts and different shipping methods with the same result. Calculating an unwanted discount for shipping by approximately 8%?
Thanks!


texts: Set first configurable product as default image

texts:
I have a product with different configuration, but my default product can't be buy (it has no image).

I want to show on the store the first configurable product of this not available for purchase product instead of an empty image


texts: Magento 2 Cart Memory Exhaustion issue, with customer

texts:
Running Magento 2.1.10 CE, with multiple stores.

Client requires login to access the site

Running into an issue where one of the client is having a problem with cart.
They have added 53 products in their cart, but when they try to update the cart, by adding a new item or editing quantity of an existing, The allowed memory gets exhausted. No matter how much i increase the memory size (now 3GB), it still get exhausted, pointing to a memory leak. This also happens on checkout page. (before showing the payment methods)

I created a test user account on the site and replicated the above user cart. For this user, i have no issues, i can add more items, update quantities for already added ones, and even complete the checkout.

I have checked the values for the both customers, and they are pretty much similar apart from unique values such as email etc

I am currently running out of idea how to debug it further.
I tried writing a script to modify the cart, but i still get memory issue for that particular user

The site is setup on an amazon server, using a combination of redis, varnish, setup on nginx


texts:
I was trying to override execute function of Magento\CatalogUrlRewrite\Observer\ProductProcessUrlRewriteSavingObserver using preference in di.xml

<preference for="Magento\CatalogUrlRewrite\Observer\ProductProcessUrlRewriteSavingObserver"
type="Aceturtle\ExcludeSimpleProductUrlRewrite\Observer\ProductProcessUrlRewriteSavingObserver" />

But it doesn't seem to be firing the execute method mentioned in e thoverridden class. I want to exclude/skip simple product urls to be saved in url_rewrite table which is done in above observer. What is the process to override an observer file? Is there a different process I can follow to skip records for simple products to be saved in url_rewrite table to have less table size(Simple products are not visible anywhere on the site).

My observer program looks like

 <?php
    namespace Aceturtle\ExcludeSimpleProductUrlRewrite\Observer;
    .....
    class ProductProcessUrlRewriteSavingObserver extends \Magento\CatalogUrlRewrite\Observer\ProductProcessUrlRewriteSavingObserver
    {
    ....
    public function execute(\Magento\Framework\Event\Observer $observer){
      if($product->getTypeId() == 'simple')
        {
          return;
        }
    .....
    } }


texts: How to enable PayPal Website Payments Standard & Express Checkout at the same time?

texts:
We were asked to enable PayPal Express Checkout for a client (in addition to Website Payments Standard).

I understand that the default behaviour in Magento is to have only one PayPal-based solution enabled at a time, and when you enable one of the other PayPal solutions it informs you that the other will be turned off:

The client wants to continue to be able to offer PayPal Website Payments Standard as a payment option at checkout for those customers who don't want to use Express Checkout or who miss the Express Checkout button on the cart page.

How can we enable both Website Payments Standard and Express Checkout at the same time?

This other thread asks the same question but the only comment that was added does not answer the question:

https://stackoverflow.com/questions/24901121/enable-both-paypal-standard-and-paypal-express-checkout-payment-methods-in-magen

The store is running on Magento CE 1.7.0.2.


texts:
I'm writing a payment module for Magento 2 right now and I'm checking it against the "Magento Extension Quality Program Coding Standard" CodeSniffer(https://github.com/magento/marketplace-eqp).

For every of my classes that are using a (checkout) session object, the CodeSniffer responds with the following warning:

Session object MUST NOT be requested in constructor. It can only be passed as a method argument.

I'm getting the session object in the following way:

/**
 * Checkout session object
 *
 * @var \Magento\Checkout\Model\Session
 */
protected $checkoutSession;

/**
 * Constructor
 *
 * @param  \Magento\Checkout\Model\Session $checkoutSession
 * @return void
 */
public function __construct(\Magento\Checkout\Model\Session $checkoutSession)
{
    $this->checkoutSession = $checkoutSession;
}

Is there a correct way to obtain the session object?
I couldn't find anything in the Magento 2 core code.
I could only find code where it is used in exactly the same way I use it.


texts: Magento2: How can customize fulltext to like in admin product grid search?

texts:
I want to customize fulltext search with like in product admin grid in Magento2.3. Please find below screenshot:

I have checked Module-catalog search for admin grid but unable to do customization.
Anyone have an idea for that, How can do this?


texts: How To Reinitialize Injected Class In Magento 2

texts:
I am having an issue when my class get called multiple times I need to reinitialize my class to send request and get data properly.

I am calling an API so I am using httpClient to call my api.

My class

<?php

namespace ModuleNameSpace\Modulename\Model\Api;

    class ApiModel
    {

        public function __construct(
            \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig,
            \Psr\Log\LoggerInterface $logger,
            \Zend\Http\Headers $headers,
            \Zend\Http\Request $request,
            \Zend\Http\Client $client
        ){
            $this->scopeConfig = $scopeConfig;
            $this->logger = $logger;
            $this->httpHeaders = $headers;
            $this->httpRequest = $request;
            $this->httpClient = $client;
        }

        private function callApi(){
            $this->httpClient->reset(); // Tried this to reset but this does not work

            $this->httpHeaders->addHeaders($this->getHeaders());

            $this->httpRequest->setHeaders($this->httpHeaders);
            $this->httpRequest->setUri($this->apiUrl);
            $this->httpRequest->setMethod($this->apiMethod);

            $options = [
               'adapter'   => 'Zend\Http\Client\Adapter\Curl',
               'curloptions' => [CURLOPT_FOLLOWLOCATION => true],
               'maxredirects' => 0,
               'timeout' => 60
            ];

            $this->httpClient->setOptions($options);

            return $this->httpClient->send($this->httpRequest);
        }

    }

However If I reinitialize in dirty way it works fine

$httpHeaders = new \Zend\Http\Headers();

Is there a way around when class in injected ?


texts:
i tried to reformat date and time in magento.

from
$order->getCreatedAtStoreDate()

i can get result =  Feb 22, 2015 6:44:52 PM, but when i tried to reformat using this code

Mage::getModel('core/date')->date('Y-m-d h:i', strtotime($order->getCreatedAtStoreDate()));

i get result = 2015-02-22 10:44

i dont know what's wrong with it, please give me any advice.

thank you


texts: Turpentine Module crash to clear Varnish ESI cache for client

texts:
My bug is the same of tile in this post.
The log in /magento/var/log/system.log is:

2015-09-24T22:59:28+00:00 WARN (4): TURPENTINE: Failed to clear Varnish ESI cache for client: 7iil0pit3svj0oa30lmk5rvtf7
2015-09-24T23:01:45+00:00 WARN (4): TURPENTINE: Error in Varnish action result for server [127.0.0.1:6082]: Got unexpected response code from Varnish: 107
yufhrmorpdgfjlzuyuwnoxchxkgcdvjb

Authentication required.

2015-09-24T23:01:45+00:00 WARN (4): TURPENTINE: Failed to clear Varnish ESI cache for client: 7iil0pit3svj0oa30lmk5rvtf7

And in admin magento when i change options in VARNISH options in turpentine says the same error:

What is this, and how i can solve? thanks in advance


texts:
When you look in the core code of Magento 2, in Framework/Exception, you see that there is many different kinds of Exceptions. Most of them are very obvious by their name, but what is the purpose of these ones :

LocalizedException ;
StateException ;
IntegrationException.


texts: How to set a mage/cookies cookie expiration date to the user's session

texts:
Default jQuery method

In my JS (loaded using Require JS) I'm setting a cookie like so:

$.cookie('hideStickyBanner', 1);

This sets a cookie with the expiration date of session which is exactly what I need.

Magento method

But when I try using the mage/cookies method the expiration date defaults to approx 4 days time.

$.mage.cookies.set('hideStickyBannerMagento', 1);

Question

How can I use the $.mage.cookies.set(); function but have the expiration date be the user's session?

I tried this but the expiration still defaulted to 4 days time:

$.mage.cookies.set('hideStickyBannerMagento', 1, {
    expires: 0
});


texts: Error on checkout "Carrier with such method not found:"

texts:
I am creating custom shipping extension, while on checkout my custom rate shown as:

But i am getting error when check this carrier to place order.
Error is:


texts: Alphabetically Sort The State/Province Drop Down

texts:
I have an issue in sorting alphabetically those items in the state/region drop down.

// File: Mage/Directory/Helper/Data.php (line:150)
$json = Mage::helper('core')->jsonEncode($regions);
Mage::log($json);

I debugged above line and had checked the order in this var $json as expected. However, when json data comes to client-side, somehow that json object sorted itself based on the region_id. Is there a way to stop this auto-sort?


texts: Class not found error while extending core helper

texts:
I am trying to extend the core helper class But found the below error..
Fatal error:  Class 'Mage_Kishore_Kp_Helper_Data' not found

Below are the path of my files..
1. app/etc/modules/Kishore_Kp.xml
2. app/code/community/Kishore/Kp/etc/config.xml
3. app/code/community/Kishore/Kp/Helper/Data.php

These are my files..

1.Kishore_Kp.xml

<?xml version="1.0"?>
<config>
<modules>
    <Kishore_Kp>
        <active>true</active>
        <codePool>community</codePool>
        <depends>
            <Mage_Core/>
            <Mage_Catalog/>
        </depends>
    </Kishore_Kp>
</modules>
</config>

2. config.xml

<?xml version="1.0" encoding="UTF-8"?>
<config>
<modules>
    <Kishore_Kp>
        <version>1.0.0</version>
    </Kishore_Kp>
</modules>

<global>
    <helpers>
        <kishore_kp>
            <class>Kishore_Kp_Helper</class>
        </kishore_kp>
    </helpers>
</global>

<frontend>
    <routers>
        <kishore_kp>
            <use>standard</use>
            <args>
                <module>Kishore_Kp</module>
                <frontName>kpswitcher</frontName>
            </args>
        </kishore_kp>
    </routers>
</frontend>
</config>

3.Data.php

<?php

class Kishore_Kp_Helper_Data extends Mage_Core_Helper_Abstract
{
const FULL_SITE_COOKIE = 'USE_FULL_SITE';

public function getMobileToDesktopUrl() {
echo "helllllo";exit;
}

}

I am calling this helper in the footer.phtml as..

    <a href="<?php echo Mage::helper('kishore_kp')->getMobileToDesktopUrl() ?>">View

can any one says what am I doing wrong ?
These are the only files related to the module.I have given all the files here.
So can any one find some error in this code, please inform..
Thanks.


texts: High memory usage of parent categories collection

texts:
I have a function which collect products parent categories:

function getParentCategories($catId, $catsList) {
            $category = Mage::getModel('catalog/category')->load($catId);
            if($category->getParentCategory()->getId()!=2){
                $catsList[] = $category->getParentCategory()->getId();
                return $this->getParentCategories($category->getParentCategory()->getId(),$catsList);
            } else {
                return $catsList;
            }

which cause high memory usage:

  FastCGI sent in stderr: "PHP message:
   PHP Fatal error:  Allowed memory size of 4294967296 bytes exhausted (tried to allocate 72 bytes) in /app/code/local/Mage/Core/Block/Template.php on line 415" while reading response header from upstream...

memory limit is 4G !!!! and even this is not enough.
Can you help me with this function?

Magento 1.7.0.2


texts:
I was wondering if the CSV import would update customer records or does it just create new ones?

As last time i did an import using dataprofiles using an email address and postcode i already had on the database, the whole database got corrupted


texts:
I am struggling with adding captcha in few forms, have gone through its module I find it really intresting but not getting clear idea ! If anyone is having clear concept please describe .
thanks!


texts: Getting Price Format with getAttributeRawValue

texts:
I have this code to get the price of related products in new order email:

<?php echo Mage::getResourceModel('catalog/product')->getAttributeRawValue($relatedProductId, 'price', $storeId); ?>

It outputs the price but in the incorrect format like this 19.9700 with extra zeros. I've tried several ways to get it to remove the extra zeros but everything I can find Google doesn't show how this is done with getAttributeRawValue. How can I get the show the correct price format like 19.97? Thank you


texts:
So, I'm enjoying using the hackathon Magento Composer installer, but I'm struggling to understand how others use it in relation to a deployment service. Currently I'm using DeployHQ, and yes, I can set it to deploy and run composer when there is an update to the repo, but this doesn't make sense to me now.

My main composer repo, containing just the json file of all of the packages I want to include in my build, only gets updated when I add a new package to the list.

When I update my theme, or custom extension (which is referenced in the json file), there is no "hook" to update my deployment service. So I have to log in to my server and manually run composer (which takes the site down until it's finished).

So how do others manage this? Should I only run composer locally and include the vendor folder in my repo?

Any answers would be greatly appreciated.


texts: Adding a block inside a block already in a container

texts:
I have a third-party module and I'm trying to inject a block of my own (a CMS block) between two of their blocks. I'm doing something wrong because I can get my block to appear at the very end or the very beginning but can't get it in the location I want it.

Here's their layout:

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <head>
        <script src="https://www.google.com/recaptcha/api.js" src_type="url"/>
    </head>
    <body>
        <referenceContainer name="content">
            <block class="TemplateMonster\Blog\Block\Post\View" name="blog.post" template="TemplateMonster_Blog::post/view.phtml">
                <block class="Magento\Framework\View\Element\Template"
                       name="blog.social.sharing"
                       template="TemplateMonster_Blog::post/social_sharing/social_sharing.phtml"
                       ifconfig="tm_blog/social_sharing/general/enabled">
                    <block class="TemplateMonster\Blog\Block\Post\SocialSharing\AddThis\Icons" name="blog.social.sharing.icons" as="social_sharing_icons" />
                </block>
                <block class="TemplateMonster\Blog\Block\Post\View\Comments" name="blog.post.comments" as="comments" template="TemplateMonster_Blog::post/view/comments.phtml" />
                <!-- I want my block to appear here -->
                <block class="TemplateMonster\Blog\Block\Post\View\Products" name="blog.post.products" as="products"  template="TemplateMonster_Blog::post/view/products.phtml" />
                <block class="TemplateMonster\Blog\Block\Post\View\Posts" name="blog.post.posts" as="posts"  template="TemplateMonster_Blog::post/view/posts.phtml" />
            </block>
        </referenceContainer>
        <referenceContainer name="sidebar.additional">
            <!-- ... SNIP ... -->
        </referenceContainer>
        <move element="page.main.title" destination="main" before="-" />
    </body>
</page>

And in my theme I use the following in the equivalently named location:

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceContainer name="content">
            <!--<referenceBlock name="blog.post">-->
                <block class="Magento\Cms\Block\Block" name="blog.engagement" before="blog.post.products">
                    <arguments>
                        <argument name="block_id" xsi:type="string">blog-engagement</argument>
                    </arguments>
                </block>
            <!--</referenceBlock>-->
        </referenceContainer>
    </body>
</page>

So regardless of what I might use for "before" it always appears at the end. I'm thinking that it's because the block I'm trying to target is itself contained inside the "blog.post" block. The commented out referenceBlock line was me trying to get there but if I uncomment that element, my block doesn't appear on the page at all. I get the same result (element does not appear on the page) if I try to reference the block without the container.

What am I doing wrong?


texts: Cannot run setup:di:compile, generated directory file permissions

texts:
I am trying to set up a local instance of Magento. However, when I try to run php bin/magento setup:di:compile I get the following error:
  Class Magento\Cron\Model\DeadlockRetrierInterface does not exist
  Class Wyomind\CronScheduler\Plugin\Cron\Observer\ProcessCronQueueObserver\Interceptor generation error: The requested class did not generate properly, because the 'generated' directory permission is
  read-only. If --- after running the 'bin/magento setup:di:compile' CLI command when the 'generated' directory permission is set to write --- the requested class did not generate properly, then you mu
  st add the generated class object to the signature of the related construct method, only.

It seems the problem is that the generated directory file permissions are read only but I have run chmod -R 777 generated, when I run ls -la it shows this directory permissions are drwxrwxrwx. I've run all kinds of permissions commands from other answers and from the Magento Docs, but still get the same error message. Can anybody help?


texts: Unable to add category and products in magento 1.9.2.1

texts:
I am unable to add/save categories and products the save/save and continue edit button are unclickable .
I have double checked the file folder permission on host (644 and 755)
I am using godaddy(linux)
Here is my browser's console


texts: Magento search not working after Reindexing

texts:
I have recently started working on Magento.
I had to fix search issue wherein the products were not displayed on the frontend for some values of attribute "brand" even if the products exist for that brand in the database.

So i did Re indexing and cleared the cache, but these steps broke up my full search. i.e. full search functionality stopped working and also listing of products by categories. I did re indexing and cache clear again but it could not fix the issue.

I was able to fix the listing by categories issue when i found out that "catalog_product_index_price" was empty after re indexing. I repopulated the table with my backup data.
But I'm still  not able to fix the search.Can anyone tell me how i can fix this.
What database tables are related to search?? and  where the query is generated??


texts: Explanation of UI Component Grid in Magento 2

texts:
Is there a good explaination and/or sample of the bare minimum configuration needed to create a UI Component Grid in Magento 2?

I know there are myriad core components, such as

./vendor/magento/module-catalog/view/adminhtml/ui_component/product_listing.xml

However, these XML files are expansive, and there's little explanation about what each node does, and how you'd use this to build a grid from scratch.

There's also this sample module, but it

Appears to be fore a form
Lacks any context/explanation about what each node does

I'm looking for the "getting started" information that would let me build a grid for my own CRUD model collection.


texts: Magento 1.9 - How to get Order Comments History?

texts:
My code :

<?php

require_once('app/Mage.php');
umask(0);
Mage::app();

// try{

$orders = Mage::getModel('sales/order')->load('10');
foreach ($orders as $order) {
    $orderComments = $order->getAllStatusHistory();
    print_r($orderComments);

    }

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

How to get Comments History of the order?

Status :  Pending-> Processing-> Awaiting Shipment-> Shipped-> Complete


texts: local grunt database errors, when I have a vagrant magento2 box

texts:
I have a vagrant box (debian) with a Magento2 installation for development. Everything works nice, but changing css/less is very very slow (because everytime I have to remove pub/frontend and var/view_processing/*), developing a theme is not nice in Magento2... :(

That's why I have installed NPM + Grunt on my local Mac. But when I run grunt exec:theme I always get an error:

  [Zend_Db_Adapter_Exception]
  SQLSTATE[HY000] [2002] No such file or directory

I understand that my local Grunt cannot connection my database (because I have a vagrant box), but how can I work with Grunt on my LOCAL environment (ex. PHP Storm), without database connection errors?


texts: Mysterious user from hell in Magento 2.1

texts:
I have installed magemonkey mailchimp extension via composer:

composer require ebizmarts/magento2-magemonkey

And then when I try run:

php bin/magento setup:upgrade

I get an error:

[Zend_Db_Adapter_Exception]
  SQLSTATE[HY000] [1045] Access denied for user
'ifit_test_db'@'localhost' (using password: YES)

I have never created that user, and my site is running ok. When i try:

grep -r ifit_test_db

for that user, the command line is telling me:

app/etc/env.php:        'dbname' => 'ifit_test_db',
app/etc/env.php:        'username' => 'ifit_test_db',

When I open my app/etc/env.php file I dont see that dbname or username. I see the dbname and username that I set before. So where the hell is that user comming from?


texts: Magento 2: Site not working after delete pub/static folder manually

texts:
I am running Magento 2.1 in developer mode. I manually deleted everything in the pub/static/ folder, and then ran the deploy command.

I then cleared cache, I am now getting this error I can't solve?
Any advice?

1 exception(s): Exception #0 (Magento\Framework\Exception\FileSystemException): The path "_requirejs/frontend/AZ/az/en_US/requirejs-config.js:
///home/xxx/public_html/xxx/pub/static/home/xxx/public_html/xx/pub/static/" is not writable


texts: How can i fixed security patch for magento 1.9.0.1?

texts:
I have test currently my site on
https://www.magereport.com and it's says to install some security patch. like

Security patch 6482 (XSS),

Security patch 7405,

Security patch 6788 (secrets leak),

Security patch 5344 (Shoplift),

Security patch 6285 (XSS, RSS).

I don't know how to fixed this. if i am directly install on my site any risk to loss or break the site?


texts: Automated tests: orders, product views and usability for Magento 2

texts:
I'm looking for a way to automate testing on multiple websites. Now I'm pretty new to the testing part of Magento 2 and there seems to be a lot of ways to test in Magento 2, like unit testing, functional testing, etc.

They all seem to be more code based testing. That part we already covered. I am looking for a way to test the part on the frontend, more automated.

Things like open productspage and report errors in JS and PHP, same for categorypage, CMS pages, create testorder and see if adding to cart until checking out causes any error.

A lot of terms are on the internet. Unit Testing, Performance Testing, Automated Regression Testing and the meaning of the terms vary a lot, depending which blog/post/site you are visiting.

What I need: test features like add product to cart, view cart, go to checkout, actual finish the order from checkout, create account as new customer etc. Frontend usability.

Question 1: what kind of testing am I looking for, e.g. unit test?

Question 2: should I use Magento standard testing methods or are there proper 3rd party testingsolutions which might meet my requirements?

Sorry for tl;dr, but I'm a noob when it comes to automated testing.


texts: Importing Only Customers and Orders after Site is Complete

texts:
Is it possible to migrate only Customers and Orders part,

if I modify map files if rest of the website is complete? or will it through error in that case.


texts: Dynamically create add to cart block for each final configurable option, Helper for $this

texts:
I am working on a project where on the product page instead of the normal configurable options, there are some configurable options and then the database is queried to see if particular vendors carry the product. It then displays the list of vendors via javascript as shown below.

I want the add to cart block to show up next to EACH vendor. Because this is all dynamically created, I had to pass the vendor ID to an "add to cart" script that I created. I took the original app/design/frontend/base/default/template/catalog/product/view/addtocart.phtml and made my own as seen below. The following php file is called via ajax. The original addtocart.phtml had a bunch of $this variables. I need to simulate $this (whatever model, helper its referring to) so that this block works. I am without much success. Can someone see what I am doing wrong or what I could do differently? Thanks so much!

    <?php require_once('/var/www/Staging/public_html/app/Mage.php'); ?>
<?php umask(0); Mage::app();?>
<?php $value = $_POST['value'];?>

<?php $block = Mage::getModel('catalog/product');?>
<?php $_product =  Mage::registry('current_product'); ?>
<?php //if($_product->isSaleable()): ?>

        <?php //if(!$_product->isGrouped()): ?>
        <?php echo $block->__('Qty:') ?>
        <input type="text" name="qty" id="qty" maxlength="12" value="<?php echo $block->getProductDefaultQty() * 1 ?>" title="<?php echo $block->__('Qty') ?>" class="input-text qty" />
        <?php //endif; ?>
        <button type="button" title="<?php echo $buttonTitle ?>" class="button btn-cart" id='$value'><?php echo $buttonTitle ?></button>
        <?php echo $block->getChildHtml('', true, true) ?>

    <?php //endif; ?>


texts:
I might be going mad but I thought in the settings in Magento you could force the products to use the associated products price. As at the moment I have to work out what to add onto the price, which is getting messy.

If someone could point me in the right direction I would appreciate i.


texts: Is it worth paying for Litespeed + LiteMage Cache on a Magento 2 site, or can I do just as well with Varnish, Turpentine, Redis, etc.?

texts:
I am in the process of setting up a new Magento 2.3 store with Apache, Varnish (probably Turpentine) and Redis. All requests will be via HTTPS (SSL). I recently became aware of the Litespeed Web Server, LiteMage Cache and the company's Magento extension. I wonder if I should switch from Apache to Litespeed?

The advertisements show this combination massively outperforming Apache + Varnish as well as Nginx + Varnish + Turpentine. Here's a quote from an advertisement:

It is up to six times faster than Apache
It is three times faster than Apache in SSL
With its LiteMage cache, LiteSpeed makes Magneto pages to run up to 75 times faster
It increases PHP performance by 50%

I'm skeptical. Should I believe any of those claims? I see a lot of ads and promotions from those making money from this combo (hosting companies) but I'm not finding much independent benchmarking. Litespeed's benchmark page is here. They claim:

  LiteSpeed Web Server with LiteMage Cache was up to 3 times faster than nginx with Varnish, and 4 times faster than Apache with Varnish.

If LiteSpeed + LiteMage Cache is really that much faster, why aren't more people discussing it here? I find very few questions related to it.

I would rather not get locked into a proprietary solution if I can do as well or nearly as well with the widely used free solutions. Looking for advice. The purpose of this post is to gets the facts from reliable sources who have experience rather than from advertisements promoting a for-profit product. I would spend the money for LiteMage, but only if it is really worth it based on real-world experience from folks here. Thanks.


texts: How to add "Add Selected to cart" button in magento 2.1

texts: In magento 2.1 add all to cart option is there from wishlist, i want to do Add selected to cart from wishlist, can anyone suggest me solution please.


texts: upgraded Magento 1.9.3.0 from 1.9.2.3 admin Images not showing & search broken

texts:
I recently upgraded to Magento ver. 1.9.3.0 from  1.9.2.3 everything seemed to go ok. Except after I clicked on the Refresh button, I got an Internal Server Error. So I fixed permissions via SSH to -

find . -type f \-exec chmod 644 {} \;
find . -type d \-exec chmod 755 {} \;
find ./media -type d \-exec chmod 775 {} \;
find ./var -type d \-exec chmod 775 {} \;
find ./media -type f \-exec chmod 664 {} \;
find ./var -type f \-exec chmod 664 {} \;
chmod 640 ./app/etc/*.xml
chmod 550 mage

The web site came back and both the front and back end seemed to be working fine. But I then noticed that search on the front end wasn't working. It says - "Your search returns no results" no matter what I search for. And in the admin side if I click -> Catalog -> Manage Products -> If I click on a product I get a page with an error that says -

Fatal error: Undefined class constant 'XML_NODE_PRODUCT_MAX_DIMENSION' in
 /home/myserver/public_html/app/design/adminhtml/default/default/template/catalog/product/helper/gallery.phtml
 on line 111

So I saw the file mentioned was gallery.phtml so I uploaded the older file from my backup and the older file allows the page to display correctly but when I click on Images on the left the page shows but without the images. The images show on the front end fine. I even tried to re-upload the images but that didn't help either. I downloaded the 1.9.3 package and put in a good current file and I got the same original problem I had after the upgrade.

So I have 2 issues that I know of -

I can't search on the front end. Update - Advanced Search works normal. Update - I found I had an extension installed called - Catalog Search Refinement I uninstalled it and the search is working!
The image won't display with the old gallery.phtml installed and with the current gallery.phtml installed I get the error above. Update - I was looking at the file gallery.phtml and saw the call for Mage_Catalog_Helper_Image::XML_NODE_PRODUCT_MAX_DIMENSION I found a file named - Image.php in app/code/local/Mage/Catalog/Helper I think this file was being referenced instead of the one in app/code/Mage/Catalog/Helper So I copied the file over and now the page works and displays the images. I went a step further and renamed the file to .bak so that the correct file would be called and the page is working and the front end seems to be ok. I don't know why the file was copied over to the local folder. I paid to have my website upgraded with a new theme the last time and suspect they couldn't get something to work so they copied the modified file over to the local folder.


texts: Magento 1.9.3.6 Item (Mage_SalesRule_Model_Rule) with the same id "192" already exist

texts:
Item (Mage_SalesRule_Model_Rule) with the same id "192" already exist
Trace:
#0 /home/site/web/website.com/public_html/lib/Varien/Data/Collection/Db.php(582): Varien_Data_Collection->addItem(Object(Mage_SalesRule_Model_Rule))

     public function load($printQuery = false, $logQuery = false)
    {
        if ($this->isLoaded()) {
            return $this;
        }

        $this->_beforeLoad();

        $this->_renderFilters()
             ->_renderOrders()
             ->_renderLimit();

        $this->printLogQuery($printQuery, $logQuery);
        $data = $this->getData();
        $this->resetData();

        if (is_array($data)) {
            foreach ($data as $row) {
                $item = $this->getNewEmptyItem();
                if ($this->getIdFieldName()) {
                    $item->setIdFieldName($this->getIdFieldName());
                }
                $item->addData($row);
                $this->addItem($item);
            }
        }

        $this->_setIsLoaded();
        $this->_afterLoad();
        return $this;
    }

#1 /home/site/web/website.com/public_html/lib/Varien/Data/Collection.php(741): Varien_Data_Collection_Db->load()

    public function getIterator()
    {
        $this->load();
        return new ArrayIterator($this->_items);
    }

This error working after click product on list for view detail


texts: How to call helper function observer in magento2

texts:
I am trying to call helper function on observer custom module in Magento2 but Unable to call helper in observer.

Please help me if anybody have this solution. I am waiting for all your positive response.


texts: Magento 2: Which tables copy for importing all orders, customers, reviews

texts:
Which tables do I have to copy for importing all orders (incl. invoices ...), customers (incl. guests) and their orders of course, reviews, statistics, logs and so on.

My problem:
I have 2 Magento2 databases. The first database has all products, categories, cms pages, blocks, configurations and so on. But second database has latest orders, but not correct products, categories and so on. The second database has all new orders and so on from data migrations tool from delta mode. But I can not run migration in database 1 again, because to many things where changed. So I only need all orders, customers and so on - all datas which are updated by migrations tool in delta mode.


texts: Magento2: Received unknown parameter: cross_border_classification error in Stripe

texts:
I am using Magento ver. 2.3.1
I have installed the Stripe payment method and installed the supportive php library.
Configured with test account.
I am testing the stripe payment method with test mode and I am getting below error:-
Received unknown parameter: cross_border_classification

If any one have idea about it please help me Thanks


texts: Is there any Module to create text on product (tshirt), upload images on product

texts:
I want to make a custom module to personalize products, such as add text on tshirt, upload images on products and then save it as final product.

I have searched many links, but all extensions are paid.