texts: Magento 2.4.1 setup:install problem : "the default website isn't defined. Set the website and try again."

texts:
I downloaded magento 2-2.4.1.zip. Unzipped it to /var/www/html/magento24/ - my local folder for local domain http://magento24.local configured by nginx on ubuntu20.04.
I had done composer update or install and next use this command:
bin/magento setup:install --base-url=http://magento24.local \
 --db-host=localhost --db-name=magento24 --db-user=user24 --db-password=1234 \
 --admin-firstname=Magento --admin-lastname=User --admin-email=user@example.com \
 --admin-user=admin --admin-password=test1234 --language=en_US \
 --currency=USD --timezone=America/Chicago --use-rewrites=1

This stopped on step 4:
[Progress: 4 / 818]
Installing database schema:

In WebsiteRepository.php line 159:

  The default website isn't defined. Set the website and try again.

I tried different way. To download magento2.4.1 by composer from magento repository:
php /bin/composer1/composer.phar create-project --repository-url=https://repo.magento.com/ magento/project-community-edition=2.4.1 .

But this first throw problems with composer version (first i use coimposer 2.0.x, next uses 1.0.0alpha - different errors php7.3 and php7.1 fpm)


texts: How to call Tier price field in custom admin form?

texts: In my custom Admin form I want to add the tire price field. How to achieve this? What needs to be use as render?


texts: Theme-Related Exception thrown after restart

texts:
This is my first Magento project and I am using DevBox Magento 2.1.6 CE. I installed a custom theme and have it running. However, when I restart my Magento set-up (using "./m2devbox-init.bat") I get the Required parameter 'theme_dir' was not passed error.

Checking the core_config_data table shows the correct theme_dir id. My backend shows the correct them selected. The only way to get my theme working again is to:

In backend, switch to Magento Luna Theme.
Clear cache
Reselect custom theme
In database, manually change custom theme Type attribute from "1" to "0".
Clear cache

Why does this keep happening on start-up?


texts: CSP Reports being thrown, even after allowing links in whitelist

texts:
I created a new module to allow urls, and have them not make noise about csp.

I have a csp_whitelist file under /etc, and I've added all of my links to it (and cleared the cache), but the warnings are all still there.

I've tried with and without *. before the urls, and that didn't make a difference

here's a sample of the file:

<?xml version="1.0"?>
<csp_whitelist xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Csp/etc/csp_whitelist.xsd">
    <policies>
        <policy id="style-src">
           <values>
               <value id="zendesk-main" type="host">static.zdassets.com</value>
               <value id="fontawesome" type="host">fontawesome.com</value>
               <value id="google-font" type="host">fonts.googleapis.com</value>
               <value id="bootstrap-cdn" type="host">maxcdn.bootstrapcdn.com</value>
            </values>
        </policy>
    </policies>
</csp_whitelist>


texts: "Use Default Value" Not Save After Migration Magento 2.3.2

texts:
"Use Default Value" gets unchecked, when product data is saved

"Use default value" being ignored for certain fields in multiple store mode

MAGENTO 2 “USE DEFAULT VALUE” STORE VIEW SCOPE FIX

Check This Link But Not Success.

  After Migration Use Default Value Not Save When Product Have
  Migrated Attribute Set.

Example :-

I Have a 2 Attribute Set

Default (Magento Default Attribute Set)
Migration_Default (After Migration Generate Attribute Set)

  When Product Attribute Set is Migration_Default Use Default
  Value Not Save.

And Also Is There Any Way To Combine Those 2 Attribute on Migration Process...

Using This Link I Got Temporary Solution...

Add This Code In This File /vendor/magento/module-ui/view/base/web/js/form/form.js

        // HACK for product - use default value...
            if($('input[name="product[name]"]').length){
                $(".admin__field-service").each(function(i, v){
                    if($(this).find("input").attr("type") == "checkbox"){
                        var name = $(this).find("input").attr("name");
                        var checked = $(this).find("input").prop("checked");
                        var value = 0;
                        if(checked){
                            value = 1;
                        }
                        source.set('data.'+name, value);
                    }
                });
            }
        // HACK for product - use default value...

  And Also Debug form.js in line no.310 i'm also gettting
  use_default value Array (this.source.data.use_default)

  But in Magento not Getting Any use_default Array


texts: Shell script slows down to crawl until caches are cleared

texts:
I have written a small shell script, run via the command line. The script uses a naming schema for our product images to set the images to the corresponding products.

However, sometimes the script seems to take ages for each product, up to 20 seconds. I was never sure what caused this, and have sometimes used a whole weekend just to assign images to all our products.

By accident I had the script display open when I cleared the caches because of some changes I made somewhere else. Strangely enough, that sped up the process immensely. Instead of up to 20 seconds, the script was doing 2 products a second.

Checking my discovery further, I can see how with time the products/second decline, and after a few hours getting as slow as I remember it being.

I am interested in the why of the slowdown, and why it speeds up when clearing the caches. I have not tried to identify which specific cache it is, I just select all caches and clear them (all 8 cache types in the list).

Attached is the script.

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

  $mediaDir = 'media/import';
  $mediaDirDest = $mediaDir . DS . 'done';

  $allImages=array();

  echo "Reading and sorting files ...\n";
  foreach(glob($mediaDir . DS . '*.jpg') as $image) {
    if(strpos($image, '_')!==false) {
      $imageParts=explode('_', basename($image));
      $sku=$imageParts[0];
    } else {
      //Assume somebody fux0red up
      $imageParts=explode('.', basename($image));
      $sku=$imageParts[0];
    }

    if(!array_key_exists($sku, $allImages)) {
      $myArray=array();
      $myArray[]=basename($image);
      $allImages[$sku]=$myArray;
    } else {
      $myArray=$allImages[$sku];
      $myArray[]=basename($image);
      $allImages[$sku]=$myArray;
    }
  }

  echo "Now processing ...\n";

  foreach ($allImages as $sku => $images) {
    echo "Processing SKU $sku.\n";
    $product = Mage::getModel('catalog/product')->loadByAttribute('sku',$sku);

    //Remove link from image to product
    $mediaApi = Mage::getModel("catalog/product_attribute_media_api");
    try {
      $items = $mediaApi->items($product->getId());
      foreach($items as $item) {
        $mediaApi->remove($product->getId(), $item['file']);
      }
    } catch (Exception $exception) {
      print_r($exception);
      die;
    }

    //Set no image as standard
    foreach($product->getStoreIds() as $storeId) {
      echo "Removing all images from SKU $sku in store ID $storeId.\n";
      $product->setStoreId($storeId)->setImage(false)->setSmallImage(false)->setThumbnail(false)->save();
    }

    usort($images, 'sortByLength');

    $product->setStoreId(0);

    //Now to do some serious adding
    foreach($images as $key => $image) {
      if($key===0) {
        echo "Setting image $image as primary image for SKU $sku.\n";
        $product->addImageToMediaGallery($mediaDir.DS.$image,array('image', 'small_image', 'thumbnail'),false,false);
      } else {
        echo "Setting image $image as additional image for SKU $sku.\n";
        $product->addImageToMediaGallery($mediaDir.DS.$image,null,false,false);
      }
    }

    try {
      echo "Saving SKU $sku after adding all images.\n";
      $product->save();
    } catch (Exception $e) {
      print_r($exception);
      die;
    }

    //Move images
    foreach ($images as $image) {
      $source=$mediaDir.DS.$image;
      $destination=$mediaDirDest.DS.$image;

      if(!rename($source,$destination)) {
        echo "Renaming of $source to $destination failed! Aborting.\n";
        die;
      }
    }
  }

  function sortByLength($a,$b) {
    if($a == $b) return 0;
    if(strlen($a)===strlen($b)) {
      return strcmp($a,$b);
    } else {
      return (strlen($a) < strlen($b) ? -1 : 1);
    }
  }


texts: I want to change the position of the coupon code in Magento2 checkout to the top above the address form field. I know the two checkout_index_index.xml file in magento_checkout and magento_sales_rules but i don't know how to change them for the sort order.


texts: Magento2.2 Getting error after upgrade module

texts:
I am using Magento2.2 after upgrade module than comes this error on frontend side if any one idea reply me

Class Amasty\ShopbyBase\Helper\PermissionHelper does not exist


texts: Manufacturer problem by adding brand name

texts:
Every time if I try to add a new product-brand-name,

I get this error: The value of Admin must be unique

as you can see it here on the photo


texts: Running magento2 commands in Windows XAMPP

texts:
I am using XAMP for magento2. I am not able to run commands and getting error:

  php is not recognized as an internal or external command, operable
  program or batch file

I try these commands: C:\xampp\htdocs\magento2>php bin/magento indexer:reindex, php\bin\magento indexer:reindex


texts: How to put meta title for url in magento

texts:
If I search with name in google I am getting like this.

But I need like this.

How can I achieve this one ?

Thanks in Advance
Somu N


texts:
I get this error repeatedly daily 4 - 5 times.

  SQLSTATE[HY000]: General error: 1205 Lock wait timeout exceeded; try restarting transaction

This time I restart my phpmyadmin but it happens again and again. I am not able to point out this problem.

I am using Magento ver. 1.9.0.1 in website. I have 7000+ products. In Server I have 16GB RAM.

How to fix this issue?


texts:
I try to take the final product list after the checkout, so I create an observer for that.
I found a list of all dispatched events in Magento 2.1 which looks like this:

dispatched-events

I tried a lot of events, which is work properly, but nothing seems to work for the final checkout button.

I also tried checkout_cart_save_after but this event is before the final checkout button, and checkout_type_onepage_save_order_afterbut this event is not working.

Does anyone know how to solve this problem? Or which event is responsible for this?


texts: How to use the category page layout update to insert a cms block in the category.products block?

texts:
I am trying to add a CMS block in-between the Category page description and the products list for a single category page. I believe I would need to use the Custom Layout Update to add the CMS block. If I reference the Content block, I can get the cms block to display at the top of the content with this:

<reference name="content">
 <block type="cms/block" name="cutlery_page_addition" before="product_list">
    <action method="setBlockId"><block_id>cutlery_page_addition</block_id></action>
 </block>
</reference>

But how would I target a child block of the content block? I tried this with no luck:

<reference name="category.products">
 <block type="cms/block" name="cutlery_page_addition" before="product_list">
    <action method="setBlockId"><block_id>cutlery_page_addition</block_id></action>
 </block>
</reference>

Any help would be greatly appreciated. Thanks


texts:
I am trying to set up OAuth access to an API for a site running 1.9.3.2. All of the Magento instructions say:

  You can register your application by selecting System > Web Services > REST - OAuth Consumers and clicking Add New in the Admin Panel.

Source

The problem with this is that the dashboard I am looking at does not have any "REST - OAuth*" options in the System menu.

I haven't been able to find any configuration anywhere to enable this or any plugin that may be conflicting and I am at a loss as to why these options are here when everything seems to indicate they should just always be in that menu.

Is there something that needs to be enabled somewhere that I am unaware of? Or something that could conflict and cause these menu items to not appear?


texts: Order shipment creation takes around 2 mins in magento 2

texts: While creating shipment for order in magento2 is very slow. It takes around 2 mins for complete the process. How to solve this.


texts: How to Implement Recurring Order Remainder Notification for Customer?

texts: How can I create module like monthly regular customer received notification like, your monthly order is ready, get it. How can I do this for my customer.


texts:
I want to import bulk products using csv template in Magento.

I am unable to import a column tax_class_id.

I have given the value as eg: MA001234.

The datatype used in backend is 'int'.


texts:
Hello is there any alternative condition for below condition. I'm using Magento 1.7.0.2.

$action = Mage::app()->getFrontController()->getAction();

if ($action->getFullActionName() == 'sales_order_reorder')  {
// Some code here
}

I got null $action.


texts: Product import problem. Cannot be used with directory

texts:
I have a problem with import product. When i try import using this option, also import not working when i use "Advanced Pricing" but when i try use for example "Customer Addresses" import working correctly.

My exception.log call me error like
 [2021-05-14 06:39:32] main.CRITICAL: Path "/var/www/html/store/var/importexport//DhrGxu1C7TTHZiuhYqftgqXk3seWjyZr.csv" cannot be used with directory "/var/www/html/store/pub/media/" {"exception":"[object] (Magento\\Framework\\Exception\\ValidatorException(code: 0): Path \"/var/www/html/store/var/importexport//DhrGxu1C7TTHZiuhYqftgqXk3seWjyZr.csv\" cannot be used with directory \"/var/www/html/store/pub/media/\" at /var/www/html/store/vendor/magento/framework/Filesystem/Directory/PathValidator.php:63)"} []
I set up permission 777 to var and pub folder. I have created directory like:
var/export
var/import
var/import_hisotry
var/importexport
Please Help


texts: Edit frontend footer link from admin panel configuration section magento 2

texts:
I have a custom module that displays a custom link in the footer section in frontend.
Further, I have created my module specific configurations in the admin panel.

I would like to add option to admin panel for Disable/Enable the link on frontend's footer.

How can I achieve this? Please help.

I have added the footer link in frontend in view/frontend/layout/default.xml

        <referenceBlock name="footer_links">
        <block class="Magento\Framework\View\Element\Html\Link\Current" name="Name">
            <arguments>
                <argument name="label" xsi:type="string">My custom link</argument>
                <argument name="path" xsi:type="string">path/to/link</argument>
            </arguments>
        </block>

My system.xml is like,

        Module

        <tab>mytab</tab>
        <resource>Vendor_Module::configuration</resource>

        <group id="quotes" translate="label" type="text" sortOrder="5" showInDefault="1" showInWebsite="1" showInStore="1">
            Group Name

            <field id="enabled" translate="label comment" sortOrder="7" type="select" showInDefault="1" showInWebsite="1" showInStore="1">
                Enable the link
                <comment>select from the dropdown</comment>

                <source_model>Vendor\Module\Model\Config\Source\Module</source_model>
            </field>
        </group>
    </referenceBlock>

The Vendor\Module\Model\Config\Source\Module contains,

    /**
 * @return array
 */
public function toOptionArray() {
    return [
        ['value' => 'Yes', 'label' => __('Yes')],
        ['value' => 'No', 'label' => __('No')],
    ];
}


texts: How to assign a guest cart to a customer with rest API. I've try PUT /carts/{cartId} when I’m log as a customer to assign a guest cart to the customer https://devdocs.magento.com/redoc/2.3/customer-rest-api.html#operation/quoteCartManagementV1AssignCustomerPut. If I’m trying right after I’ve log in I got a error because the customer already have a cart assign and if I try right after proccess the transaction, I’m getting 404 saying there’s not entity at the cartId


texts:
I can't update layout using reference Block.
This is my site block: custom.topnav. See screenshot

This is the code of the Extension Ves Mega Menu

            <?xml version="1.0"?>
            <!--
            /**
             * Venustheme
             *
             * NOTICE OF LICENSE
             *
             * This source file is subject to the Venustheme.com license that is
             * available through the world-wide-web at this URL:
             * http://www.venustheme.com/license-agreement.html
             *
             * DISCLAIMER
             *
             * Do not edit or add to this file if you wish to upgrade this extension to newer
             * version in the future.
             *
             * @category   Venustheme
             * @package    Ves_Megamenu
             * @copyright  Copyright (c) 2016 Venustheme (http://www.venustheme.com/)
             * @license    http://www.venustheme.com/LICENSE-1.0.html
             */
            -->
            <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
                <head>
                    <css src="Ves_All::lib/owl.carousel/assets/owl.carousel.css" />
                    <css src="Ves_All::lib/bootstrap/css/bootstrap-tiny.css" />
                    <css src="Ves_Megamenu::css/font-awesome.min.css" />
                    <css src="Ves_Megamenu::css/animate.min.css" />
                    <css src="Ves_Megamenu::css/styles.css" />

                    <!-- Enable Off canvas menu css
                    <css src="Ves_Megamenu::css/megamenu-offcanvas.css" />
                -->
                </head>
                <body>
                    <referenceBlock name="custom.topnav">
                        <block class="Ves\Megamenu\Block\Menu" name="catalog.topnav" template="Ves_Megamenu::topmenu.phtml">
                            <arguments>
                                <argument name="alias" xsi:type="string">mainmenu</argument>
                            </arguments>
                        </block>
                    </referenceBlock>
                    <referenceContainer name="before.body.end">
                        <block class="Magento\Framework\View\Element\Template" name="magemenu.js" template="Ves_Megamenu::js.phtml" />
                    </referenceContainer>
                </body>
            </page>

What am i doing wrong?


texts: Is there any possibility to login Magento 2 front-end customer through Rest API

texts: I'M trying login Magento-2 front end customer through rest api but if browse api url through browser then only the customer logged in, and if excute that api through php script then the customer not logged in. is there any better way to log in front end magento-2 customer through rest API


texts: how to Create multiple controller and define them in config file in magento

texts:
I need to create multiple controllers in one custom module of me.
How do I define all of them in my xml file.


texts: Magento 2 - Update multiple products programmatically

texts:
I'm trying to update products programmatically but I got only first product from array updated. All of products in array have status "2" (disabled) in DB. I'm using $this->productRepositoryInterface - it's \Magento\Catalog\Api\ProductRepositoryInterface

$productSkus = ['A1', 'A2', 'A3'];

foreach ($productSkus as $sku) {
    $productToSave = $this->productRepositoryInterface->get($sku);
    echo "Product {$productToSave->getId()} is loaded and ready to update".PHP_EOL;
    $productToSave->setStatus(1);
    $this->productRepositoryInterface->save($productToSave);
}

After that code executed - I got only A1 set to "Enabled". Other products keeping be disabled. Echo says it's loading everytime new product to be updated. Magento 2.2.4 EE (CE is also affected)


texts:
I'm using MAGMI to import products to my Magento store.
There's an option for product positioning inside categories.
But I'm not using it right or it's not working.

On this page: http://sourceforge.net/apps/mediawiki/magmi/index.php?title=On_the_fly_category_creator/importer

It is saying this:

 Item positioning

From magmi 0.7.18 , category_ids column has been enhanced with item positioning. This feature is also supported in category importer from version 0.2+ (since category importer plugin is roughly a category_ids generator)

Sample

store,sku,....,categories
admin,00001,.....,cat name with \/ in the name and positioning::3 <= here we "escaped" the tree separator with a backslash , the category will be created as "catname with / in the name and positioning"
                                                                     sku 00001 will be set with position 3 in the category

So how exactly should I use product positioning?


texts: Magento 2: How to add invoice date to invoice email template?

texts:
I need to add the date of invoice creation to the invoice email template in format like this: d.m.YYYY (example: 25.12.2020).
How can I achieve this?


texts: Does Magento2 send an email when order is cancelled by default?

texts: I have custom functionality where orders can be canceled. I was wondering if M2 has some settings that sends automatic email to customer whose order was canceled? Or I need to implement it myself? If I need to implement it myself, I should follow this How to send mail programmaticlly in magento2?? Thank you.


texts: Get orders id in DESC using magento soap api

texts:
$session = $client->login('Sandbox', 'ek7PswHDZtHDWtY0O3xLcyUYFIBUtFMW');

$orders = $client->call($session, 'order.list');

This gets the order in ASC order by default. I want to get orders in DESC orders and also want to add a limit.


texts: Displaying a list of Websites in a drop down

texts:
In my Magento 1.9, I have the below snippet that gives me the list of "Stores" that are available in one Single Website as a drop down format.

<?php if(count($this->getStores())>1): ?>

 <?php $locale = Mage::app()->getStore()->getName(); echo $locale; ?>

    <?php foreach ($this->getStores() as $_lang): ?>
        <?php $_selected = ($_lang->getId() == $this->getCurrentStoreId()) ? ' class="selected"' : '' ?>

            <a <?php echo $_selected ;?> href="<?php echo $_lang->getCurrentUrl() ?>" title="<?php echo $this->htmlEscape($_lang->getLocaleCode()) ?>"><?php echo $this->htmlEscape($_lang->getName()) ?><?php echo substr($this->htmlEscape($_lang->getLocaleCode()), 0, 2) ?>

    <?php endforeach; ?>

<?php endif; ?>

I am trying to change the above logic by displaying the list of Stores that are across different Websites.

Because, I have 2 websites, and there are 1 store in each of them

I have tried replacing getStores() with getWebsites() but didn't work.


texts: Add attribute link in admin panel is showing as page isnt working!

texts:
When we try to create an additional attribute from the admin panel,it shows the following error:
This page isn’t working
restaurantware.local is currently unable to handle this request.
HTTP ERROR 500


texts: Separate shipping method - rates for each store at checkout

texts:
What i want to achieve is the following.
I'll be having a multi-store or multi-website Magento. Haven't decided yet.
There's going to be one single front for all those stores-websites.

During checkout i want the user to pay shipping rates based on the stores he has purchased items from. Meaning.

He buys 1 item from store A
He buys 2 items from store B.

At checkout ( he'll only do 1 payment btw ) there's going to be two extra shipping rates applied to his order.
One from store A for the 1 item, and one from store B for the 2 item. He'll also be able to pick different shipping methods between stores.

Is this something ( at least on some point ) achievable on Magento CE 2 ?

I know i'll probably have to write some code for it but giving me a few hints ( like using something like multishipping ) will be appreciated.


texts: Minimum number of PHP modules needed to run Magento

texts:
We have the following Modules installed at Rackspace for the old Magento server. They have a new server I am hoping to pair this down. What are the minimum required?

php54-pecl-memcache-3.0.8-1.ius.centos6.x86_64
php54-mysql-5.4.38-1.ius.centos6.x86_64
php54-mbstring-5.4.38-1.ius.centos6.x86_64
php54-ioncube-loader-4.7.4-2.ius.centos6.x86_64
php54-cli-5.4.38-1.ius.centos6.x86_64
php54-mcrypt-5.4.38-1.ius.centos6.x86_64
php54-pecl-apc-3.1.13-2.ius.centos6.x86_64
php54-xml-5.4.38-1.ius.centos6.x86_64
php54-soap-5.4.38-1.ius.centos6.x86_64
php54-gd-5.4.38-1.ius.centos6.x86_64
php54-pear-1.9.5-2.ius.centos6.noarch
php54-pecl-lzf-1.6.2-8.ius.centos6.x86_64
php54-pecl-redis-2.2.5-1.ius.centos6.x86_64
php54-imap-5.4.38-1.ius.centos6.x86_64
php54-process-5.4.38-1.ius.centos6.x86_64
php54-bcmath-5.4.38-1.ius.centos6.x86_64
php54-pdo-5.4.38-1.ius.centos6.x86_64
php54-intl-5.4.38-1.ius.centos6.x86_64
php54-odbc-5.4.38-1.ius.centos6.x86_64
php54-pspell-5.4.38-1.ius.centos6.x86_64


texts: Why I received the error "Could not receive Stock Item data" in admin product grid?


texts: New customers in wrong group with valid VAT id

texts:
Customers who have registered with a valid VAT id are put in the general group by default.

Customer configuration:
- Enable Automatic Assignment to Customer Group is set to Yes
- Group for valid VAT id - intra Union is set to 'B2B - no vat'

When i debug the code, isValid method for Tax validation returns true

So all params are ok but still the person go's into the wrong group (general)

What is more bizarre to me is, when i go the customer in the backend and save the customer without changing anything, the customer goes into the correct group.

Any feedback on this would be really appreciated.

Thanks

Edit: Apparently the customer gets in the general group initially even with a valid VAT id. After success the customer gets the following message:

"Your VAT ID  was successfully validated. You will not be charged tax.
Thank you for registering with ....
If you are a registered VAT customer, please click here to enter your billing address for proper VAT calculation"

If the customer doesn't click the link he stays in general group, if he clicks the link and re enters the information with his VAT, he will be in the B2B group.

Is there a workaround for this so people get in the right group initially?


texts: how to solve Magento vulnerability issue

texts:
Magento website scan report says that it has some issue about security in website.following scan report says about my website vulnerability.

vulnerability Name: Php Info File
vulnerability Name: Web Application Transmits login credentials without encryption
vulnerability Name:Basic authentication over HTTP

How to solve vulnerability from website.this above solve vulnerability points in my website.
AND other thing is website is under ssl nd secure by htttps

How to solve above points.I need some guide above points I do not understand how to approach above this points.
All patch installed in website.


texts: Magento 2 : Child theme not displaying Products

texts:
I've created child theme based on(Parent) default luma theme.

I had this setup with My Magento 2.2.3 with Sample Data.

Child theme is working fine, I enabled it.
But problem i am getting is that after enabling child theme sample data is missing at frontend.

But i can able to access products and categories by URL

Does anybody gone through this issues ? Is there anything i am missing ??

Any help would be really helpful.

I've followed This tutorial for creating child theme.

I also run setup:upgrade ,setup:static-content:Deploy ,indexer:reindex , Cache:clean but still not working.

Thanks in Advance.


texts: how to find the shipping method code in magento

texts:
As we have shipping method code for each shipping method.

I want to know how to find that shipping method code


texts: How to trace the content $this->getChildHtml() inside head.phtml file

texts:
I am in head.phtml file and need to change the content of <?php echo $this->getChildHtml() ?> as there is no name inside getChildHtml(), i don't know thow to look in layout file then.

I almost opened all files in active theme but didn't find the google script that i want to update.

I found a similar question here same question
but not understood how to trace.


texts: Check if product exists within a specific category Magento 2

texts:
I want to check whether a product exists within a specific category and if true show message.
At the moment I am having to do this via strpos using the Name attribute value.
   <?php if (strpos($_product->getName(),"Hello") !==false): ?>

A message goes here.

   <?php endif; ?>

Is there any way to do similar using either category name or ID?


texts:
Question from new in Magento. I have configurable product (magento2.4) and I need to add show/hide link or button on product page which hides field 1 (input) and shows field 2 (input) and on next click shows field 1 and hides field 2.
Thanks in advance.


texts: Magento2 : Manage currency format in multi-language website

texts:
I have website with two language French and English in which currency format is not matching in both store.If product has price 14,751.89 € then it will show

FR Store : €14,751.89
En Store : 14 751,89 €

I want to change both by 14751.89 €
How can I do that?


texts: Uncaught ArgumentCountError: Too few arguments to function?

texts:
I have namespace\module\Block\Display.php:

 <?php

 namespace Magento\History\Block;

 class Display extends \Magento\Framework\View\Element\Template
 {

    private $productRepository;

    public function __construct(

          \Magento\Catalog\Api\ProductRepositoryInterface $productRepository
        )
        {

            $this->productRepository = $productRepository;

         }
    public function getProductBySku($sku)
    {
        $order = $this->productRepository->get($sku);
        foreach ($order->getAllItems() as $item)
        {
            echo $item->getName();
        }
    }
}

And in this file .phtml, I have :

<?php
 $order = $block->getLayout()->createBlock('Magento\History\Block\Display');
 echo $order->getProductBySku();
?>

When I run, I have this error:

Can anyone help? Thanks


texts:
What is the Magento way to avoid multiple form submissions? Ideally I'd like to disable the submit button on the form "submit" action and set a flag to check if the form has been already submitted.

But looking at Magento's VarienForm I've seen there is already a hook for the submit option, so I was dubious if it's ok to reuse that action.


texts:
after install magento I have error:

An error has happened during application run. See exception log for details.

in exception:

main.CRITICAL: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'magento2.core_config_data' doesn't exist, query was: SELECT `main_table`.* FROM `core_config_data` AS `main_table` {"exception":"[object] (Zend_Db_Statement_Exception(code: 42): SQLSTATE[42S02]: Base table or view not found: 1146 Table 'magento2.core_config_data' doesn't exist, query was: SELECT `main_table`.* FROM `core_config_data` AS `main_table` at W:\\domains\\localhost\\vendor\\magento\\framework\\DB\\Statement\\Pdo\\Mysql.php:110, PDOException(code: 42S02): SQLSTATE[42S02]: Base table or view not found: 1146 Table 'magento2.core_config_data' doesn't exist at W:\\domains\\localhost\\vendor\\magento\\framework\\DB\\Statement\\Pdo\\Mysql.php:91)"} []

How can I rewrite the path to the database? Ty for answer


texts:
I would like to disable the newsletter-module of Magento 2.2.5.

Tried via console:

php bin/magento module:disable Magento_Newsletter

But there are to many dependencies:

Unable to change status of modules because of the following constraints:
Cannot disable Magento_Newsletter because modules depend on it:
Magento_Store: Magento_Store->Magento_Catalog->Magento_Customer->Magento_Newsletter
Magento_Directory: Magento_Directory->Magento_Backend->Magento_Customer->Magento_Newsletter
Magento_Eav: Magento_Eav->Magento_Backend->Magento_Customer->Magento_Newsletter
Magento_Theme: Magento_Theme->Magento_Customer->Magento_Newsletter
Magento_Customer: Magento_Customer->Magento_Newsletter
Magento_Backend: Magento_Backend->Magento_Customer->Magento_Newsletter
Magento_AdminNotification: Magento_AdminNotification->Magento_Backend->Magento_Customer->Magento_Newsletter
Magento_Indexer: Magento_Indexer->Magento_Backend->Magento_Customer->Magento_Newsletter
Magento_Cms: Magento_Cms->Magento_Theme->Magento_Customer->Magento_Newsletter
Magento_Catalog: Magento_Catalog->Magento_Customer->Magento_Newsletter
Magento_Payment: Magento_Payment->Magento_Quote->Magento_Customer->Magento_Newsletter
Magento_AdvancedPricingImportExport: Magento_AdvancedPricingImportExport->Magento_Customer->Magento_Newsletter
Magento_Config: Magento_Config->Magento_Backend->Magento_Customer->Magento_Newsletter ...

Is that normal?


texts: What parts of the model layer can be bypassed in the interest of performance optimization

texts:
I'm currently seeing that for a database table with a very simple schema (about 5 fields), it's inserting new records at a rate of just under ~50 inserts / second, in my local development environment (SSD drive) - this is with no observers on the model populating associated tables.

Using direct SQL I'm seeing quite an improvement - ~1800 inserts / second.  We're thinking about attempting to optimize the performance of our models, but of course we don't want to lose all of the nice stability and flexibility that the Magento core gives us.

I'm wondering whether someone has gone this route before and whether there are some easy wins in terms of components of the model layer that can be bypassed relatively safely that will give significant performance boosts.

  Things like:

  Class name resolution
  before and after save events
  Event dispatches
  Transactions
  etc.

UPDATE: I lied, there actually were some additional queries firing off of observers or afterSave()'s, which I saw when I inspected the database query log.  Benchmarking against a totally simple entity actually gives me ~300 rows / second with Magento models - only MySQL overhead are transactions.


texts:
I'm trying to add a multiselect attribute to magento 2 customers. It works perfectly when adding text / input value, but cannot figure how to add multiselect. Here is my code :

$customerSetup->addAttribute(Customer::ENTITY, 'allowed_brands', [
        'type' => 'text',
        'label' => 'Allowed brands',
        'input' => 'multiselect',
        'required' => false,
        'visible' => true,
        'user_defined' => true,
        'sort_order' => 1000,
        'position' => 1000,
        'system' => 0,
        'backend' => 'Magento\Eav\Model\Entity\Attribute\Backend\ArrayBackend',
        'option' =>
          array (
            'values' =>
            array (
              'Option 1',
              'Option 2',
              'Option 3',
              'Option 4',
            ),
          ),
    ]);


texts: Create and save duplicate item (with custom option) in cart

texts:
In fact just copy and save existing cart item.
Programmatically course.
In cart we have item - "A" with custom option, need clone "A" -> to (create) "B"
"B" full double "A" besides id.


texts:
I want to change the settings of my imported product images. Now it looks like this:

           Base image   Small image   Thumbnail   highresimages   highresimages2   highresimages3   highresimages4
No image   x            x             x           x               x                x
image1.jpg
image2.jpg
image3.jpg

I want it to look like this:

           Base image   Small image   Thumbnail   highresimages   highresimages2   highresimages3   highresimages4
No image
image1.jpg x                                      x
image2.jpg                                                        x
image3.jpg                                                                         x
image4.jpg                                                                                x

I want to do it as a bulk operation. All products has the same structure for the image. The first image is always first, second image is always second etc.


texts:
I'm trying to use table rates, I have 3 rates:

for items between 0 and 150 lbs: $19.99
for items between 150 and 155 lbs: $79.99
for items over 155 lbs: $99.99

On top of those I want to offer free shipping for all items over $150 but one brand, let's say "Tesla", so I've created a cart promotion rule, where I specified cart price to be over $150 and the brand IS NOT Tesla.

All Tesla items are somewhere between 150 and 155 lbs.

Everything works fine if the customer adds to cart a Tesla item first, the shipping price is $79.99.

However if the customer is adding to cart a product with free shipping, and after that is adding a Tesla item, the shipping price is $19.99, which is wrong, it should be either $79.99 either $99.99.

Any idea why is this happening?

I'm using Magento 2.1.3  CE on Centos 7 with php 7.0.14


texts: We just want to know what would be the json params to create coupon code from magento2 rest API. The API we are using to generate the coupon code is /rest/V1/coupons


texts:
I deploy on server my magento site with docker + plesk
all is correct but i cant edit or change permission on path /etc

I can't edit local.xml with my correct db data.


texts: How to override wishlist sidebar file in my own module?

texts:
I want to override sidebar.phtml file of wishlist module in my own module.

Please guide me.

Thanks,


texts:
I have 2 different websites A and B.

Now I want to show some product from B to A.

Which means, some Product in A website will be the same as in B website. Now I want to import these products from B website to A website.

How I can do this?


texts: How to check if user entered wrong credentials?

texts:
I've edited tm/firecheckout/checkout/link.phtml to display a modal window in shopping cart when the user is not logged in.

I've set it up that when a user enters the wrong credentials (setBeforeAuthUrl) it stays on /checkout/cart/. Otherwise the user is redirected to /firecheckout/.

This is the code:

<?php if ( $this->isPossibleFireCheckout() ): ?>
<?php if ( ! Mage::getSingleton( 'customer/session' )->isLoggedIn() ): ?>
    <?php
    // If credentials are invalid, stay on page. Otherwise send to checkout.
    Mage::getSingleton( 'customer/session' )->setBeforeAuthUrl( Mage::getUrl( 'checkout/cart' ) );
    Mage::getSingleton( 'customer/session' )->setAfterAuthUrl( Mage::getUrl( 'firecheckout' ) );
    ?>
    <button onclick="toggleCheckoutModal()" id="toggleCheckoutModal" type="button"
            class="button btn-proceed-checkout btn-checkout<?php if ( $this->isDisabled() ): ?> no-checkout<?php endif; ?>">
        <?php echo $this->__( 'Proceed to Checkout' ) ?>
    </button>

X

        <?php echo $this->getLayout()->createBlock( 'customer/form_login' )->setTemplate( 'persistent/customer/form/login.phtml' )->toHtml(); ?>

<?php else: ?>
    <button type="button" title="<?php echo $this->__( 'Proceed to Checkout' ) ?>"
            class="button btn-proceed-checkout btn-checkout<?php if ( $this->isDisabled() ): ?> no-checkout<?php endif; ?>"<?php if ( $this->isDisabled() ): ?> disabled="disabled"<?php endif; ?>
            onclick="window.location='<?php echo $this->getCheckoutUrl() ?>';">
        <?php echo $this->__( 'Proceed to Checkout' ) ?></button>
<?php endif ?>
<?php endif ?>

What I want to do is show a error-message (using the global-messages div) after a user has entered wrong credentials and is redirected back to the checkout/cart/ page. Is this possible?

I've googled around, but can't seem to find anything related to this.


texts: I need to know where does magento2 store extension files after compilation as i am making changes in extension i need to always run commands, if i don't want to run commands for some time as we can make change for css in pub/static folder


texts: How to add filter option in product details page?

texts:
I have a category called perfume in my website.
I manage to show the default filter in the left side of this category.
I want to add the same default filter in the product detail page only for the perfume category products.

List Page

Details Page

I updated the edit cateogry > custom design > custom Layout Update with below lines.

<reference name="product_list">
<action method="setTemplate"><template>catalog/product/perfume.phtml</template></action>
</reference>
<reference name="product.info">
<action method="setTemplate"><template>catalog/product/perfume-view.phtml</template></action>
</reference>
<remove name="left.newsletter" />

How can i add this filter in the perfume category product details page?


texts: Magento2 Getting issue on Reindex SQLSTATE[42000]: Syntax error or access violation: 1070

texts:
Getting issue on Reindex, I was about to create a new customer attribute,
How can i fix this, I also need is_used_in_grid = true

  Customer Grid indexer process unknown error: SQLSTATE[42000]: Syntax
  error or access violation: 1070 Too many key parts specified; max 16
  parts allowed, query was: CREATE TABLE IF NOT EXISTS
  customer_grid_flat


texts: wyswig editor issue in magento 2 enterprise edition

texts:
Added below code into Ui component layout file but In enterprice version it is showing default page builder functionality not showing wyswig editor

<field name="content">
    <argument name="data" xsi:type="array">
        <item name="config" xsi:type="array">
            <item name="label" xsi:type="string" translate="true">Content</item>
            <item name="formElement" xsi:type="string">wysiwyg</item>
            <item name="source" xsi:type="string">post</item>
            <item name="sortOrder" xsi:type="number">70</item>
            <item name="wysiwyg" xsi:type="boolean">true</item>
            <item name="dataScope" xsi:type="string">content</item>
            <item name="additionalClasses" xsi:type="string">admin__field-wide</item>
            <item name="validation" xsi:type="array">
                <item name="required-entry" xsi:type="boolean">true</item>
            </item>
        </item>
    </argument>
</field>


texts: How add custom style max width 1024 Magento 2?

texts:
I have:

.media-width(@extremum, @break) when (@extremum = 'min') and (@break = @screen__m) {
    padding: 50 px;
}

Css looks: @media (min-width: 768px) { padding 50px }

Need make: @media (max-width: 1024px) { padding 10px }
I try change style in app/design/frontend/Vendor/default/Magento_Theme/web/css/sourse/_module.less


texts: Remove Compare from Product List in Magento 2.1.6

texts:
I need to delete the compare button from product list but I don't know how to to do it in Magento 2.1.6.

Under [vendor]/[theme]/Magento_Catalog/templates/product/

I deleted the following in list.phtml:

<?php
   $compareHelper = $this->helper('Magento\Catalog\Helper\Product\Compare');
                                ?>
   <a href="#" class="action tocompare" title="<?php echo $block->escapeHtml(__('Add to Compare')); ?>"
      aria-label="<?php echo $block->escapeHtml(__('Add to Compare')); ?>"
      data-post='<?php /* @escapeNotVerified */ echo $compareHelper->getPostDataParams($_product); ?>'
       role="button">
       <?php /* @escapeNotVerified */ echo __(' ') ?>

and deleted the following in listing.phtml

. 'getAddToCompareUrl($_product) . '" class="action tocompare">'
. '' . __('Add to Compare') . '

It didn't work.


texts: Magento2: how to handle data if FPC is enable

texts:
I have scenario where I am adding data in custom session variable from helper.
when I am  accessing that data on Phtml by helper call it is not retrieving as FPC is enable.

If I disable FPC then it is retrieving.

Please suggest what is the best way to bypass FPC in above scenario.

Note: data is retrieving from helper not from block as we can bypass block but in this case I am using helper.


texts:
I have a slide that displays products in magento. Every time the user clicks on the buy button, I need the span of that button to change to remove and the other buttons to be disabled for the click and when the user clicks the remove button, the span of the button changes to buy. This should all be done using jQuery so that the page was not updated, but even researching I have no idea how I could do this.

Button code:

<button type="button" title="<?php echo Mage::helper('core')->quoteEscape($this->__('Add to Cart')) ?>" class="button btn-cart" onclick="addCartao('<?php echo $_product->getId(); ?>')" name="cartaoMensagem" id="cartaoMensagem"><?php echo $this->__('Add to Cart') ?></button>


texts: Subcategory filter showing (0) products even though there are many products

texts:
My subcategory filter in the sidebar shows that there are 0 products in some of the categories but then you click on them and there are loads of products in them.
This only happens with some of the categories though.
Check out this link to see what I mean.
https://realboysrealtoys.co.uk/accessories.html


texts: How Can I Open the Modal Dialog Box in Checkout Authentication?

texts: I want to make it so that when any User buys a product, when checkout is clicked on then the first modal dialog box opens to either login or use a guest account to purchase the product.


texts: How to save image custom attribute in magento

texts:
how to save image custom attribute in magento 2

I'm a newbie. I have trying to follow this ticket but the file ProductSaveAfter.php don't work. And has an warning:

  Warning: Invalid argument supplied for foreach() in
  D:\xampp\htdocs\hebes2\app\code\MGS\Mpanel\Plugin\Product.php on line
  14

Please help me!

Dcw\Vm\Observer\ProductSaveAfter.php :

<?php

namespace Dcw\Vm\Observer;

use Magento\Framework\Event\ObserverInterface;

class ProductSaveAfter implements ObserverInterface {

    protected $request;
    protected $resource;

    /**
     *
     * @param \Magento\Framework\App\RequestInterface $request
     * @param \Magento\Framework\App\ResourceConnection $resource\
     */
    public function __construct(
        \Magento\Framework\App\RequestInterface $request, \Magento\Framework\App\ResourceConnection $resource
    ) {
        $this->request = $request;
        $this->resource = $resource;
    }

    public function execute(\Magento\Framework\Event\Observer $observer)
    {
        print_r($this->request->getPostValue());exit;
        $data = $this->request->getPostValue();

        if (isset($data['product']['media_gallery']['images'])) {
            // print_r($images);exit;
            $connection = $this->resource->getConnection();
            $tableName = 'catalog_product_entity_media_gallery'; //gives table name with prefix
            $product = $observer->getProduct();
            $mediaGallery = $product->getMediaGallery();

            if (isset($mediaGallery['images'])) {
                foreach ($mediaGallery['images'] as $image) {
                    //Update Data into table
                    $vmValue = !empty($image['vm']) ? (int)$image['vm'] : 0;
                        $sql = "UPDATE " . $tableName . " SET vm = " . $vmValue . " WHERE value_id = " . $image['value_id'];
                        $connection->query($sql);
                }
            }
        }
    }

}

Dcw\Vm\Plugin\Product.php :

<?php

namespace Dcw\Vm\Plugin;

class Product
{
    /**
     * @param \Magento\Catalog\Model\Product $subject
     * @param \Magento\Framework\Data\Collection $result
     * @return mixed
     */
    public function afterGetMediaGalleryImages(\Magento\Catalog\Model\Product $subject, $result)
    {
        foreach ($result as $key => $image) {
            if ($image['vm']) {
                $result->removeItemByKey($key);
            }
        }

        return $result;
    }
}

Dcw\Vm\Plugin\Product\Gallery.php :

namespace Dwc\Vm\Plugin\Product;

class Gallery
{
    public function afterCreateBatchBaseSelect(
        \Magento\Catalog\Model\ResourceModel\Product\Gallery $subject,
        \Magento\Framework\DB\Select $select
    ) {
        $select->columns('vm');

        return $select;
    }
}

Dcw\Vm\etc\di.xml :

<?xml version="1.0"?>
<!--
/**
 * Copyright © 2015 Magento. All rights reserved.
 * See COPYING.txt for license details.
 */
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">

    <preference for="Magento\ProductVideo\Observer\ChangeTemplateObserver" type="Dcw\Vm\Observer\ChangeTemplateObserver" />
    <type name="Magento\Catalog\Model\ResourceModel\Product\Gallery">
        <plugin name="afterCreateBatchBaseSelect" type="Dcw\Vm\Plugin\Product\Gallery" sortOrder="10" disabled="false"/>
    </type>

</config>

Dcw\Vm\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">
    <type name="Magento\Catalog\Model\Product">
        <plugin name="afterGetMediaGalleryImages" type="Dcw\Vm\Plugin\Product" sortOrder="10" disabled="false"/>
    </type>
</config>


texts: When using Data Migration tool I get exception undefined index

texts:
I've successfully installed Data migration tool.

I have a magento 1.9.1.0 and magento 2.1.3 runing locally on MAMP under OSX Sierra.

The magento 1 is running under htdocs/magento1 and magento 2 is running in htdocs/magento2, so I access to them with localhost:8888/magento1 and localhost:8888/magento2.

The database name in magento1 is hello and the database name in magento 2 is hello-test, none of them use prefixes.

When I try to do a migration from magento 1 to magento 2 I get an error:

[Exception] Notice: Undefined index: name in /Applications/MAMP/htdocs/magento2/vendor/magento/data-migration-tool/src/Migration/ResourceModel/Adapter/Pdo/MysqlBuilder.php on line 82

The configxml that I configured is:

<source>
    <database host="localhost:8888/magento1/" user="root" password="1234"/>
</source>
<destination>
    <database host="localhost/magento2/" user="root" password="1234"/>
</destination>
<options>
    <crypt_key><![CDATA[abcd1234]]></crypt_key>
</options>

And the command I use to init the migration is:

php bin/magento migrate:settings /Applications/MAMP/htdocs/magento2/vendor/magento/data-migration-tool/etc/ce-to-ce/1.9.1.0/config.xml

What can be failing? I've been searching in google for a while but I find nothing...

Edit: I passed the xml in a xml validator and I see some errors:

this line <database host="localhost:8888/magento1/" user="root" password="1234"/>
display the error cvc-complex-type.4: Attribute 'name' must appear on element 'database'.

this line <database host="localhost:8888/magento2/" user="root" password="1234"/>
display the error cvc-complex-type.4: Attribute 'name' must appear on element 'database'.

and this xml reference to ../../config.xsd and this file displays the error InvalidRegex: Pattern value '[-/A-Za-z0-9\._]+\.(xml|dist)' is not a valid regular expression. The reported error was: ''-' is an invalid character range. Write '\-'.'.
on this line <xs:restriction base="xs:string">

edit 2:
if change the config.xml to

<source>
    <database host="127.0.0.1:8888/magento1/" name="hello" user="root" password="1234"/>
</source>
<destination>
    <database host="127.0.0.1:8888/magento2/" name="hello-test" user="root" password="1234"/>
</destination>

then the error is:

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

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


texts: Magento 2 - checkout - iframes and firefox - browser history back button

texts:
While being in Checkout and having an iFrame on /checkout/#payment page, by trying to get back to previous page checkout/#shipping by using the browser back button the content of checkout/#shipping is loaded in my iFrame and the page URL is still consisting as /checkout/#payment instead of checkout/#shipping.

I've to reload this page twice to get to checkout/#shipping.
This is only happening in FireFox.
Functionality of browser history back is working for Chrome and Safari fine, but not for Firefox.


texts: Magento Go Translation fails with error message Translation is absent in source locale translation file

texts:
I am trying to translate a Magento Go interface into Norwegian and I am using the files from the support website.  When I try to upload the translation, it ignores a few entries with an error message "Translation is absent in source locale translation file", any clues on how this can be overcome, since it is Magento Go, I am a little unfamiliar with how this can be resolved.  Any help is appreciated.

Thanks, happy to provide any clarifications.


texts: What is the work flow of ui component and block file in magento 2?

texts:
In Magento 2 UI components structure are bit difficult to learn and no more reference are found for clearly understand How to work with UI Components.

My concern is that How block is dealing with Ui Component xml file.

How to define Relation between Block File and UI Components in Magento 2

If somebody take any small example and explain the flow of that then i think it's really helpful for me.

Thanks in advanced


texts: Magento 2 overriding Magento\Catalog\Block\Product\View

texts:
I have made a module to override Magento\Catalog\Block\Product\View. I want to add some standard things to the MetaTitle and MetaDescription on the product page. Specifically for empty descriptions.

Alters

I alter the title string and save with

$this->pageConfig->setTitle($myString).

The same goes for the description

$this->pageConfig->setDescription($myOtherString)

Problem

The MetaTitle and MetaDescription on the product page stay the same.

Possible causes and solutions

I have investigated and ruled out the following:

Cache
Third party modules
Module related problems (magento setup:upgrade,...)

Debug

When I echo the string I want to set I get the following error:

a:4:{i:0;s:282:"Warning: Cannot modify header information - headers already sent by (output started at /app/code/[MyVendor]/[MyModule]/Block/Product/View.php:61) in /www/vendor/magento/framework/Stdlib/Cookie/PhpCookieManager.php on line 125";i:1;s:1702:"#0 [internal function]: Magento\Framework\App\ErrorHandler->handler(2, 'Cannot modify h...', '/data/sites/web...', 125, Array)
#1 /www/vendor/magento/framework/Stdlib/Cookie/PhpCookieManager.php(125): setcookie('mage-messages', '[]', 1533729078, '/', '', false, false)
#2 /www/vendor/magento/framework/Stdlib/Cookie/PhpCookieManager.php(98): Magento\Framework\Stdlib\Cookie\PhpCookieManager->setCookie('mage-messages', '[]', Array)
#3 /www/vendor/magento/module-theme/Controller/Result/MessagePlugin.php(85): Magento\Framework\Stdlib\Cookie\PhpCookieManager->setPublicCookie('mage-messages', '[]', Object(Magento\Framework\Stdlib\Cookie\PublicCookieMetadata))
#4 /www/vendor/magento/framework/Interception/Interceptor.php(152): Magento\Theme\Controller\Result\MessagePlugin->afterRenderResult(Object(Magento\Framework\View\Result\Page\Interceptor), Object(Magento\Framework\View\Result\Page\Interceptor))
#5 /www/var/generation/Magento/Framework/View/Result/Page/Interceptor.php(26): Magento\Framework\View\Result\Page\Interceptor->___callPlugins('renderResult', Array, Array)
#6 /www/vendor/magento/framework/App/Http.php(139): Magento\Framework\View\Result\Page\Interceptor->renderResult(Object(Magento\Framework\App\Response\Http\Interceptor))
#7 /www/vendor/magento/framework/App/Bootstrap.php(258): Magento\Framework\App\Http->launch()
#8 /www/index.php(39): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http))

But I think this is more an issue of the echo than error due to code error.

I mainly followed this logic. Is there another logic I should follow or does anyone have an idea of why the metainfo does not change?

Thanks for your time!


texts: Programmatically add image to media gallery in Magento2

texts:
I am looking at this article on the Gallery API in Magento2. I am testing the code samples in my browser

var api = $('[data-gallery-role="gallery"]').data('gallery');

However, this returns undefined... The first part does return an element

$('[data-gallery-role="gallery"]')

The later part is what seems to not be working as expected. Any idea what's wrong?


texts: magento order API determine if product belongs to a bundle

texts:
I am extracting new orders in Magento using API. I would like to know how I can tell if this is a simple product, bundle or component of a bundle.

To get details I use soapObject method for sales_order.info

$details = $this->soapObject->call($this->sessionId, 'sales_order.info', $orderId);

when I dump details, it looks like this:

array(15) {
  ["product_id"]=>
  string(3) "232"
  ["weight"]=>
  string(6) "1.0000"
  ["sku"]=>
  string(12) "BD22"
  ["name"]=>
  string(28) "BUNDLED_PRODUCT22"
  ["qty_ordered"]=>
  string(6) "2.0000"
  ["price"]=>
  string(6) "0.0000"
  ["discount_percent"]=>
  string(6) "0.0000"
  ["discount_amount"]=>
  string(6) "0.0000"
  ["base_discount_amount"]=>
  string(6) "0.0000"
  ["discount_invoiced"]=>
  string(6) "0.0000"
  ["base_discount_invoiced"]=>
  string(6) "0.0000"
  ["tax_percent"]=>
  string(6) "0.0000"
  ["tax_amount"]=>
  string(6) "0.0000"
  ["row_weight"]=>
  string(6) "0.0000"
  ["price_incl_tax"]=>
  string(6) "0.0000"
}


texts:
I need to split my orders for every item (because I need an order status and delivery note for every single item in my cart).

I tried to do this according to following resources:

Magento2 Split Order Based on Vendor

How to split order in magento 2

Magento multiple order on one checkout or order splitting

But I can not get it to work, the first order is created and the second crashes. (Having onepage-checkout enabled)

What am I doing wrong?

  Magento/Quote/Model/QuoteManagement.php

public function placeOrder($cartId, PaymentInterface $paymentMethod = null)
{
    $quote = $this->quoteRepository->getActive($cartId);
    if ($paymentMethod) {
        $paymentMethod->setChecks([
            \Magento\Payment\Model\Method\AbstractMethod::CHECK_USE_CHECKOUT,
            \Magento\Payment\Model\Method\AbstractMethod::CHECK_USE_FOR_COUNTRY,
            \Magento\Payment\Model\Method\AbstractMethod::CHECK_USE_FOR_CURRENCY,
            \Magento\Payment\Model\Method\AbstractMethod::CHECK_ORDER_TOTAL_MIN_MAX,
            \Magento\Payment\Model\Method\AbstractMethod::CHECK_ZERO_TOTAL,
        ]);
        $quote->getPayment()->setQuote($quote);

        $data = $paymentMethod->getData();
        $quote->getPayment()->importData($data);
    }

    if ($quote->getCheckoutMethod() === self::METHOD_GUEST) {
        $quote->setCustomerId(null);
        $quote->setCustomerEmail($quote->getBillingAddress()->getEmail());
        $quote->setCustomerIsGuest(true);
        $quote->setCustomerGroupId(\Magento\Customer\Api\Data\GroupInterface::NOT_LOGGED_IN_ID);
    }

    $this->eventManager->dispatch('checkout_submit_before', ['quote' => $quote]);

    $tempQuote = $quote;

    foreach($tempQuote->getAllItems() as $tempItem) {

        foreach($quote->getAllItems() as $item) {

            $quote->getItemsCollection()->removeItemByKey($item->getId());
        }

        $quote->getItemsCollection()->addItem($tempItem);
        $quote->setTotalsCollectedFlag(false)->collectTotals();
        $order = $this->submit($quote);
        $orders[] = $order;
        $quote = $tempQuote;

        if (null == $order) {
            throw new LocalizedException(
                __('An error occurred on the server. Please try to place the order again.')
            );
        }

        $this->checkoutSession->setLastQuoteId($quote->getId());
        $this->checkoutSession->setLastSuccessQuoteId($quote->getId());
        $this->checkoutSession->setLastOrderId($order->getId());
        $this->checkoutSession->setLastRealOrderId($order->getIncrementId());
        $this->checkoutSession->setLastOrderStatus($order->getStatus());

    }

    $this->eventManager->dispatch('checkout_submit_all_after', ['orders' => $orders, 'quote' => $quote]);

    return $orders;
}

I edited the core files just for testing. I'll build a plugin or an overwrite for the placeOrder method once it works.


texts:
How to call static block in front end of site?
Exact steps to display it by taking example of identifier: 'footer-link'

How can I do it?


texts:
I don't know why my function is not load, this code:

include_once('Mage/Adminhtml/controllers/Catalog/Product/AttributeController.php');

class Singsys_ColorSelector_Override_Admin_Catalog_Product_AttributeController extends Mage_Adminhtml_Catalog_Product_AttributeController {

public function saveAction() {
    Mage::log('ExampleText:', null, 'mylog.log');
}
}

And my config.xml

    <routers>
        <adminhtml>
            <args>
                <modules>
                    <Singsys_ColorSelector_Override before="Mage_Adminhtml">Singsys_ColorSelector_Override_Admin</Singsys_ColorSelector_Override>
                </modules>
            </args>
        </adminhtml>
    </routers>

Any hints, why my saveAction not work? When I write log in Mage class all is ok. I have also conflict in another module, when I write this function in another module function is work. I try switch off conflicts module in admin and in code, but this is not help.


texts:
I need to get product stock quantity for the item, how to get that

$products = Mage::getModel('catalog/product')->getCollection();
$products->addAttributeToSelect(array('name', 'thumbnail', 'weight' ,'price','description'));

foreach ($products as $product) {
    $p['products'][] = array(
        'id'        => $product->getId(),
        'sku'       => $product->getSku(),
        'name'      => $product->getName(),
        'description'   => $product->getDescription(),
        'weight'      => $product->getWeight(),
        'created at'    => $product->getCreatedAt(),
        'pirce'     => Mage::helper('core')->currency($product->getPrice(), true, false), //." ".$currencyCode,
    );
}


texts:
Magento 2: Same Event with Multiple Observer in Different Module causes redirection issue

To solve: Magento 2: Can we call one observer in another observer?

I have followed below code

magento\app\code\Custom\Second\etc\module.xml

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
    <module name="Custom_Second" setup_version="1.0.0">
        <sequence>
            <module name="Custom_First" />
        </sequence>
    </module>
</config>

magento\app\code\Custom\First\etc\frontend\events.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">
    <event name="checkout_cart_product_add_after">
        <observer name="first" instance="Custom\First\Observer\FirstObserver" />
    </event>
</config>

magento\app\code\Custom\Second\etc\frontend\events.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">
    <event name="checkout_cart_product_add_after">
        <observer name="second" instance="Custom\Second\Observer\SecondObserver" />
    </event>
</config>

My second observer is & causing issue :- Magento 2: Observer not redirecting to checkout page


texts: Price of the product does not change for configurable products in magento 2

texts:
I have configurable products on my site, which consists of simple products with attributes color and Product length.
When i select color and Product length, the price of the product does not change and it still shows the minimal price only.
https://nimb.ws/0X32hd
https://nimb.ws/WYT0ek
The prices are properly set in backend.
In console it is showing this error
Uncaught Error: cannot call methods on priceBox prior to initialization; attempted to call method 'option'
at Function.error (jquery.js:259)
at HTMLDivElement.<anonymous> (widget.js:186)
at Function.each (jquery.js:376)
at jQuery.fn.init.each (jquery.js:142)
at jQuery.fn.init.$.fn.<computed> [as priceBox] (widget.js:182)
at $.<computed>.<computed>._UpdatePrice (swatch-renderer.js:946)
at $.<computed>.<computed>._UpdatePrice (widget.js:100)
at $.<computed>.<computed>._OnChange (swatch-renderer.js:817)
at $.<computed>.<computed>._OnChange (widget.js:100)
at $.<computed>.<computed>._AmOnChange (swatch-renderer.js:193)


texts: How to display attribute value label instead of numeric value on response of /V1/products/:sku and /V1/products/?searchCriteria?

texts:
I have one multi-select attribute(filter_cuff). Its value is Single Button Cuff,Two Button Cuff,Single Button Rounded,Double Button Rounded. When I call /v1/products/:sku API, it shows response like:

custom-attributes{"attribute-code":"filter_cuff","value":"20"}

I want to show its value i.e. Single Button Rounded instead of 20. How can it possible?

Please Help me.


texts: Set all products in Stock with custom message from quantity 0 and below

texts:
I want to have all the products always in stock but if the quantity is 0 or below to show a custom message instead of "in stock".
Magento 1.9.2


texts:
I might be off topic, but I don't where to ask.
DaMysql crashes quite often during night scripts. Some are Databases backups, but not all.

How could I address this issue ? I am sure there are many.


texts: Set Lifetime Session but Around a Week Expired Session--AGAIN and AGAIN in Magento 2.2.4

texts:
i want to set lifetime session but after around 1 week session has expired

session.gc_maxlifetime 31536000  and Adding

admin/security/session lifetime to 31536000 in core_config_data but still issue session expire in magento 2.2

I didn't delete cookies  I want to make it for a lifetime.

Any Suggestion?

Thanks


texts: Substitute existing Customer EAV Attributes

texts:
In a Magento CE 1.7.0.2 shop I have custom EAV attributes for customer and customer addresses (eav_entity_type 1 and 2), such as:

name_one
name_two
name_three
telephonetel

instead of the standard ones:

firstname
lastname
company
telephone

A lot of customers and orders exist with this custom structure. Now I want to change the attributes back to the Magento standard fields to avoid problems with third party modules.

When I change the customer address field template in the backend, I suppose that afterwards in the existing datasets the related attribute data is missing in frontend and backend.

What is the best way to change back the attributes but still preserve information of the existing customer and order data?

I think of this way:

Change customer address template in backend
Adjust frontend template for registration, customer account address fields, checkout, etc.
Copy data from old custom attributes to the original standard magento attributes: Can somebody give me an example how to implement this?


texts: Get product name and url within phtml file - Magento 2

texts:
This must be relatively simple to do - but I am really struggling.
I have created a new phtml file 'newfile.phtml' that appears in the catalog\product\view section and displays the word 'hello' on the product page. I want to update this so it includes the product name and the product url. I have tried using the following:
<?php echo $product->getData('name'); ?>

However, nothing is returned with the above.
Can anyone suggest the cleanest way to get current product name from within a standard .phtml file?
Thank you.


texts:
I am trying to add a second step to "Add to cart" process for bundle products. The goal is to display a bundle product summary page with confirmation before adding the bundle product to the cart. I did found a way to add another step for checkout process and it is explained in magento 2 developers guide but I was not able to find similar solution for add to cart process. Is there a way that I can achieve this.

Thanks in advanced


texts:
I've attempted to create a template with the block type "catalog/product_list_toolbar" so that I can get the number of products currently in the category collection, in the same way as in toolbar.phtml. However, the collection is null when I inspect it in my custom template. If I inspect the contents of $this in my template, I have the following:

array(2) {
["module_name"]=>
 string(12) "Mage_Catalog"
["type"]=>
 string(28) "catalog/product_list_toolbar"

In my local.xml, my layout instruction is simply as follows.

<reference name="catalog.leftnav">
        <block type="catalog/product_list_toolbar" name="filter_trigger"
               template="catalog/product/list/filter.phtml" />
    </reference>

Am I missing something obvious here? All I want to be able to do as output:

$this->__('%s product(s) found', $this->getTotalNum())


texts: Do I always have to add new column in DB (by creating InstallSchema file) when I'm defining Extention Attribute (scalar) for an entity, or it's being done automatically somehow?


texts: How to fix URL rewrites massively via SQL?

texts:
I had migrated my store from Magento 1 and I'm having many URLs that contain .html.html in the final of the string.

I want to update all my 88187 URL rewrites, replacing .html.html to .html

I already checked my URL suffix and prefix, and the product and category URLs registered in the admin panel.

How could I do that via SQL in the url_rewrite table?


texts: Magento 2 : Update Custom Column Value in Sales Order Grid Table

texts:
I have added custom column in sales_order_grid table and values are showing in backend but how to update that column's value if customer has edited it from frontend order view?
Anyone please help!

installer code

$setup->getConnection()
    ->addColumn(
        $setup->getTable($ordergridTable),
        'custom_column',
        [
            'type' => \Magento\Framework\DB\Ddl\Table::TYPE_SMALLINT,
            'unsigned'  => true,
            'nullable'  => false,
            'default'   => '0',
            'comment' =>'Custom column'
        ]
    );

    $setup->getConnection()->addIndex(
    $setup->getTable($ordergridTable),
    $setup->getConnection()->getIndexName(
    $setup->getTable($ordergridTable),
    ['custom_column']
    ),
    ['custom_column']
    );

Below is code from my model where i am saving it in sales_order table:

public function setFav($order,$orderId,$favId)
{

    $order = $order->create();
    $order->load($orderId);
    if($favId==0){
       $order->setCustomColumn(1);
    }else{
       $order->setCustomColumn(0);
    }
    $order->save();
}

It is saving in sales_order table but need to save/update in sales_order_grid at same time.
Thanks


texts: Magento 2 How to dynamically change custom attributes when click on the color attributes in the configurable product?

texts:
I need dynamically change custom attribute on the configurable page when I click to the swatch color attribute. On this purpose I programmatically created custom attributes with options on the admin panel, where I can save for every product his own custom attributes.

I figure out how to call my custom attributes  on simple products but I can't to do this with configurable product.

I see when I change color attribute - price is changed for every simple product(it's default thing), how to do same but with my custom attributes?

I have one idea but I don't know how this one implement. So I know how to get current product id when you clicked on the color attribute(through js code)
then I  need  pass this id data to the controller via ajax.
I need to know how exactly to do this, how to pass js data through ajax to controller and then call needed block on the category page every time when I click on the color attribute? ?
When I will be know how to do that I get with this id data -  custom attribute values and call this template in the needed place.

So main question is: How to dynamically change custom attributes when click on the color attributes in the configurable product?
And does it exist another way to achieve this ?
But if you have another solutions I ready to apply them.


texts: Magento 1.9 - get product attribute on checkout for sales_order_place_after

texts:
I want to store an attribute value as an order comment when an order is placed.

Here is my code:

class Easylife_Meta_Model_Observer
{
    public function autocomment($observer)
    {
        $_product->getProduct();
        $comment = $_product->getDeliveryTime();
        $order = $observer->getEvent()->getOrder();
        $history = $order->addStatusHistoryComment( $comment, false);
        $history->setIsCustomerNotified(false);
        $order->save();
    }
}


texts: What is my magento admin dashboard login url

texts:
I recently installed magento on web and don't remember login

these links are not working and throw

  Whoops, our bad...

  The page you requested was not found, and we have a fine guess why.

  If you typed the URL directly, please make sure the spelling is
  correct.

  If you clicked on a link to get here, the link is outdated.

http://localhost:8888/Magento/admin

http://localhost:8888/Magento/index.php/admin

http://localhost:8888/Magento/administrator

http://localhost:8888/Magento/index.php/administrator

i am using MAMP on mac yosemite and there is no local.xml in app/etc but yeah di.xml is there. thanks in advance


texts: Load only certain attributes and map them, by collection

texts:
So I am using this code:

$connection = Mage::getSingleton('core/resource')->getConnection('core_read');
$IDs = implode(',', $products);
$sql = 'SELECT * FROM `catalog_category_product` WHERE product_id IN ('.$IDs.')';
$results = $connection->fetchAll($sql);
foreach ($results as $result) {
  $this->_backupPositionData[$result['product_id'].'-'.$result['category_id']] = $result['position'];
}

to acquire from the DB the rows with relevant information and loop through them to map them, etc.

But, as we all know, using direct SQL is not the most beautiful thing. So I wanted to know whether it's possible to use loading of collection somehow to perform the same operation (until the foreach).

The problem here is that I might have to make this fetching for thousands of products, and SQL is the fastest in performance in that case. Is it possible somehow with collection or other object loading technique to do the same ?

UPDATE:

I have the IDs of the products (the database saved IDs). What I need is to acquire and map the category id and position to each product id.

In few words - I need the final result array to look like that:

array["product_id-category_id"]["position"]

P.S. I am overwriting the _saveProductCategories() function from Mage_ImportExport_Model_Import_Entity_Product and in line 1069 instead of 'position' => 1 I pass certain element of my array. :)


texts: Admin Dashboard taking 3 minutes to load after login in Magento 2.3.4

texts:
I am noticing very slow initial load of Admin Dashboard (Magento 2.3.4) after the user logs in to admin area. If you refresh the screen after log in, then everything is working normal, also store front has no performance issues (admin also working normally after initial 3 minute wait after you click Login).
I have observed processes on the server and there doesn't seem anything unusual that would cause high load. The URL of the request that is taking 3 minutes is /adminurl/admin/dashboard/index/key/..../ but as mentioned before, if I refresh the page, the same URL takes only 0.6s and all other parts of this Magento has normal response times, it's just this first load after the login.
What could be the reason for this?


texts:
I am creating an app for Magento 2 but there is no any API for a customer to check if user/customer is authenticated or not.
Followed : http://devdocs.magento.com/swagger/index.html#/

But there is not any solution.


texts:
I run Magento 1.9.4 and need to have some numbers on a custom dashboard.
I need a SQL query to get amount of sales from a specific category. And also the sales this month from same category. I need to do this from a SQL query because the Dashboard is an external site on same server with DB access


texts: how to show a block in all pages under right column except category page

texts:
I want to show a block in all pages under right column except category page.
So to identify category page Mage::registry('current_category').
Where to specify this condition and how to show right column except category page.


texts:
I want to rewrite bundle options, i.e getProduct()  in my project. This is my code:

            <bundle>
            <rewrite>
                <catalog_product_view_type_bundle_option_select>Dima_Jumagaliev_Block_Admin_Product_Bundle_Select</catalog_product_view_type_bundle_option_select>
                <catalog_product_view_type_bundle_option_multi>Dima_Jumagaliev_Block_Admin_Product_Bundle_Multi</catalog_product_view_type_bundle_option_multi>
                <catalog_product_view_type_bundle_option_radio>Dima_Jumagaliev_Block_Admin_Product_Bundle_Radio</catalog_product_view_type_bundle_option_radio>
                <catalog_product_view_type_bundle_option_checkbox>Dima_Jumagaliev_Block_Admin_Product_Bundle_Checkbox</catalog_product_view_type_bundle_option_checkbox>
            </rewrite>
        </bundle>

and php file:

class Dima_Jumagaliev_Block_Admin_Product_Bundle_Checkbox extends Mage_Bundle_Block_Adminhtml_Catalog_Product_Composite_Fieldset_Options_Type_Checkbox {

public function getProduct()
{
    if (!$this->hasData('product')) {
        if(!is_null(Mage::registry('current_product'))) {
            $this->setData('product', Mage::registry('current_product'));
        } else {
            $productId = Mage::app()->getRequest()->getParam('productId');
            $product = Mage::getModel('catalog/product')->load($productId);
            $assotiatedProducts = $product->getTypeInstance(true)->getAssociatedProducts($product);
            $this->setData('product', $assotiatedProducts[0]);
        }
    }
    return $this->getData('product');
}

but still it doesn't work. Can anybody help me, please?


texts: How can i change firstname and lastname on billing address with a value from another field

texts:
I've added a new field(fullname ) on the checkout billing address using a plugin on Magento\Checkout\Block\Checkout\LayoutProcessor, and I also hide the firstname and lastname.
Now I want to populate the first and last name with the value from full name ( split the value where we have empty space)
My problem is that I don't know how to do that.
I've tried in my abstract js Custom_Checkout/js/checkout/abstract to assign the value like this :
setFirstLastNameFromFullName : function(){
    console.log(quote)
    var fullValue = this.value();
    var address = quote.billingAddress();
    address.firstname = fullValue.substr(0,fullValue.indexOf(' '));
    address.lastname = fullValue.substr(0,fullValue.indexOf(' ')+1);
},

but is not working. Code from the plugin:
    if (isset($jsLayout['components']['checkout']['children']['steps']['children']['billing-step']['children']
        ['payment']['children']['payments-list']['children']
    )) {
        $paymentList = &$jsLayout['components']['checkout']['children']['steps']['children']['billing-step']['children']
        ['payment']['children']['payments-list']['children'];

        foreach ($paymentList as $key => $payment) {

            $jsLayout['components']['checkout']['children']['steps']['children']['billing-step']['children']
            ['payment']['children']['payments-list']['children'][$key]['children']['form-fields']['children']
            ['city_id']['sortOrder'] = 110;

            $jsLayout['components']['checkout']['children']['steps']['children']['billing-step']['children']
            ['payment']['children']['payments-list']['children'][$key]['children']['form-fields']['children']
            ['firstname']['visible'] = false;

            $jsLayout['components']['checkout']['children']['steps']['children']['billing-step']['children']
            ['payment']['children']['payments-list']['children'][$key]['children']['form-fields']['children']
            ['lastname']['visible'] = false;

            if (isset($payment['component']) AND $payment['component'] === 'Magento_Checkout/js/view/billing-address') {
                $billingConfiguration = &$jsLayout['components']['checkout']['children']['steps']['children']['billing-step']['children']
                ['payment']['children']['payments-list']['children'][$key]['children']['form-fields']['children'];

                $billingConfiguration = $this->setFullName($billingConfiguration, 'billingAddress');
            }
        }
    }

    return $jsLayout;
}

/**
 * Set "Full Name"
 * @param array $shippingConfiguration
 * @return array
 */
private function setFullName(array  $addressConfiguration, $scope){

    $addressConfiguration['full_name'] = [
        'component' => 'CUstom_Checkout/js/checkout/abstract',
        'config' => [
            'customScope' => $scope.'.full_name',
            'template' => 'ui/form/field',
            'elementTmpl' => 'ui/form/element/input',
            'options' => [],
            'id' => 'full-name'
        ],
        'dataScope' => $scope.'.full_name',
        'label' => __('First and Last Name'),
        'provider' => 'checkoutProvider',
        'visible' => true,
        'validation' => [
            'required-entry' => true,
            'validate-firstlast-name' => true
        ],
        'sortOrder' => 0,
        'id' => 'full-name',
    ];

    $addressConfiguration = $this->makeTrackableFirstLastName($addressConfiguration);

    return $addressConfiguration;
}

private function makeTrackableFirstLastName(array  $addressConfiguration){
    $addressConfiguration['firstname']['tracks']['value'] = true;
    $addressConfiguration['lastname']['tracks']['value'] = true;

    return $addressConfiguration;
}

Does anyone know how can i do this?


texts: Magento 2: UI Listing Component for a CRUD Model

texts:
Assuming I have a custom Magento 2 CRUD/AbstractModel model setup with a

Model Class
Resource Model Class
Resource Model Collection Class

What is the bare minimum ui_component configuration I need to create a product grid listing?


texts:
Am using Magento 1.9.3 with coolbaby theme. I have a problem in Place Order.

When i click Place Order button showing some error in console those error is in  following image


texts:
How to retrieve manufacturer id?

$api = new maRest("www.host.com/magento/");
$api->connect("user","xxxxxxx");
$manufacturers = array(
    "option" => array(
        'label' => "Sony",
    )
);
$manufacturer = $api->post("products/attributes/manufacturer/options", $manufacturers);
echo $manufacturer->id;

https://github.com/ezael/magento-2-api-made-easy


texts:
I have implemented holepunching of header in magento, and even though I have got it working on a per customer basis, I need the ability to take this one level deeper by making it work on diff cart item counts too.

Here is my code.

    class AD_PageCache_Model_Container_Header extends Enterprise_PageCache_Model_Container_Abstract {

    protected function _getIdentifier() {
        return $this->_getCookieValue(Enterprise_PageCache_Model_Cookie::COOKIE_CUSTOMER, '');
    }

    // public function getCacheKeyInfo() {
    //  $info = parent::getCacheKeyInfo();
    //  die('boo');
    //  $info['cart_count'] = Mage::helper( 'checkout/cart' )->getCart()->getItemsCount();

    //  return $info;
    // }

    protected function _getCacheId() {
        //return 'CONTAINER_HEADER_' . md5($this->_placeholder->getAttribute('cache_id') . $this->_placeholder->getAttribute('cart_count') ) . '_' . $this->_getIdentifier();
        return 'CONTAINER_HEADER_' . md5( $this->_placeholder->getAttribute('cache_id') . $this->_getIdentifier() );
    }

    protected function _renderBlock() {
        $blockClass = $this->_placeholder->getAttribute('block');
        $template = $this->_placeholder->getAttribute('template');

        $block = new $blockClass;
        $block->setTemplate($template);
        return $block->toHtml();
    }

}

My understanding from what I have been reading from holepunching threads on Magento is that Mage app is not initialized when FPC cache is serving the request, so basically the method of adding a placeholder attribute can't work, since

  Mage::helper( 'checkout/cart' )->getCart()->getItemsCount();

won't work, right?

And even though how is that it should be, but it didn't seem to run at all, like I placed a die() call in there but nothing happened.

So what I am missing? And how can I retrieve the cart items count so that it can be used to build the cache ID?

Progress: I found

  Enterprise_PageCache_Model_Cookie::COOKIE_CART

but this changes only once upon cart updation. After that it stays same. This is weird, this feels like the solution but its behavior says otherwise.

I couldn't find cart items count in session either. So the only way I currently see to do this would be to save the cart quantity in session whenever it updates and then use that in _getIdentifier().

I found that observers are inconsistent for cart. For addition, updation the events are dispatched but for removal, it doesn't. So I guess I can add my observer to price updation of the quote somehow, if that is consistent in having observers?

Also, I did read  Full Page Cache invalidation on cart (quote) change but itt handles using

  Enterprise_PageCache_Model_Cookie::COOKIE_CART

which doesn't work well in my case, although I think the problem lies inside it. What/How? I am not sure.

  Also the current version of EE we have running doesn't even have
  Advanced folder under Model/Container. I am using EE 1.10.1.1

Any suggestions?


texts: Attribute dropdown not showing on product page Magento1.9.2.1

texts:
I am using Magento 1.9.2.1 , I have faced problem on product details page(view.phtml file).

In this not show color attribute dropdown. Only empty dropdown show.

I have set up all setting in admin but not showing color dropdown. I have used another attribute like size than same problem showing.

Please help me this issue.


texts: Export and import all attributes and attribute sets from one Magento to other

texts:
i tried to Import Attributes via the following tutorial:
how to export and import all attributes and attribute sets from one magento to other?
how to export and import all attributes and attribute sets from one magento to other?

it worked fine for first time, except, that the data in field is_visible_on_checkout couldn't been imported.

So i tried a second time and now i get the following message:
Attribute [Delivery time] could not be saved: Attribute with the same code already exists.

Is there a way, that i overwrite existing data?

Also i do not know how to import Attribute sets and assign the attributes to the right sets without doing manually. I do not want to use a Extension, i would like to do it via PHP script.

Many thanks for your help!


texts: How to add and use custom js in admin configuration creating custom module

texts: I am creating custom module. I want to add js file in admin configuration. How can i include and use js in magento 2.x.


texts:
Apologize if this is a duplicate question, I've tried almost every solution there is. I'm tasked with adding a menu in the RWD theme (1.9) that lists the products categories, that will also allow me to go to each category landing page.

I' am seriously stuck. This is the last thing I've tried.

So this is in template/catalog/category/category.phtml
https://gist.github.com/anonymous/218a1198e8d9364ee611

And this is in layout/catalog.xml
https://gist.github.com/anonymous/dee56616ad7862240595

The above didn't add anything, nothing appeared.

This is a fresh localhost install and my first time using Magento. I am really confused here.

What am I doing wrong?


texts: Best seller code not showing simple children of configurables

texts:
I am using the code below (similar all over the web) to retrieve bestsellers by sku. However it on works on simple products (that are visible) and on simple products (not visible/child products) that are ordered directly by sku, using either EE 1.12 'Order By Sku' or by ordering the child sku directly from the Admin.

It is not showing the same exact sku on the same order when it is ordered as a size of a configurable product.

Am I missing something? Correct store, doesn't seem visibility matters.

$_product = Mage::getResourceModel('reports/product_sold_collection')
                ->addAttributeToSelect('*')
                ->addOrderedQty()
                ->addAttributeToFilter('sku', $sku)
                ->setOrder('ordered_qty', 'desc')
                ->getFirstItem();


texts:
I have a product named C.I.D

However, I am not able to search it in Magento 2.0

I guess it's related to the dot character.

Anyone got idea on how to fix it?

Thanks


texts: Regions dropdown in account creation form

texts:
I have added additional country regions to Magento's directory_country_region and directory_country_region_name tables. My understanding is that when a country is selected for which regions are stored then a drop down will automatically be added to the "create account" form in the cart when that country is selected. The drop down does appear for countries that are already listed in the regions tables. However, if the country for which I have just added new regions is selected then there is just a plain text input to type the region name/code into.

I have added the country to the "State is required for" field in config. The new region IDs dont start exactly where the existing ones finish up. The existing ones go as fat as approx 480 and I've started at 600 - does that matter?

Thanks a lot


texts: Magento 2 Could not acquire lock for cron group: default

texts:
We just migrated our Magento 1 site to Magento 2. At some during the process, the default cron group stopped running. This was after data migration and possibly right after the first test orders were placed. It's hard to pinpoint the exact time. The only error we can see related to this is:

report.WARNING: Could not acquire lock for cron group: default, skipping run [] []

We have tried truncating the cron table, removing cron and reinstalling it, flushing the cache, updated the default group to run on a separate process, and running just the cron group. Every time we ran the command php-7.1 bin/magento cron:run --group default, the above error logged.

Initially the index group was doing the same thing, but resolved itself.

We only noticed that certain tasks weren't running when the order and shipping grids weren't updating.

We are running Magento 2 Commerce v2.3.1.


texts: How can I include additional headers in every 401 Magento2 response?

texts:
How can I include some additional headers every time server needs to send 401 responses?
I tried adding it in Magento\Framework\Controller\Result\Json render() method like:

if ($response->getHttpResponseCode() == 401)
            $response->setHeader('WWW-Authenticate','/V1/integration/admin/token', true);

But that did not worked.

So I tried adding it in Magento\Framework\App\Response\HTTP in setNoCacheHeaders(), setPrivateHeaders() and setPublicHeaders()
like:

if ($response->getHttpResponseCode() == 401)
            $response->setHeader('WWW-Authenticate','/V1/integration/admin/token', true);

But that did not worked as well. Any ideas?


texts: Why is the content showing in my footer links on the page different then what the admin content block shows?

texts:
I have a theme that I extended from Luma, I have verified that it is extended properly and working well. I am able to override template/layouts just fine.

I am trying to alter the home page footer links. If I go into

  vendor/magento/module-theme/view/frontend/layout/default.xml

I can see the following code for the footer_links.

<referenceContainer name="footer-container">
    <container name="footer" as="footer" label="Page Footer" htmlTag="div" htmlClass="footer content">
        <block class="Magento\Store\Block\Switcher" name="store_switcher" as="store_switcher" template="switch/stores.phtml"/>
        <block class="Magento\Framework\View\Element\Html\Links" name="footer_links">
            <arguments>
                <argument name="css_class" xsi:type="string">footer links</argument>
            </arguments>
        </block>
        <block class="Magento\Theme\Block\Html\Footer" name="copyright" template="html/copyright.phtml"/>
        <block class="Magento\Framework\View\Element\Template" name="report.bugs" template="Magento_Theme::html/bugreport.phtml" />
    </container>
</referenceContainer>

When I go to the home page I see the following links.

However, when I go into the admin backend at Content -> Elements -> Blocks, and edit the block with an id of footer_links_block, I get the following content in the editor.

About us

Customer Service

UPDATE

To add to my question, inside my file at app/design/frontend/vendor/default I have altered the layout with the following code.

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">

        <referenceBlock name="logo">
            <arguments>
                <argument name="logo_file" xsi:type="string">images/image.jpg</argument>
            </arguments>
        </referenceBlock>

        <referenceContainer name="footer">
            <referenceBlock name="store_switcher" remove="true"/>
            <referenceBlock name="copyright" remove="true"/>
            <referenceBlock name="report.bugs" remove="true"/>
        </referenceContainer>

</page>

So I have removed everything in the footer except for the subscribe and the links.

However, the links here are coming from the code. I want to make this editable from the admin side instead. Do I just need to scrap the whole footer and make a custom one? Or is there a way to go to the backend now and edit this?


texts:
Something I can't understand while seeing the verbose phtml templates:

Why the short tag and usual code tokens aren't used in Magento ?

<?= $content ?> instead of <?php echo $content ?>

or:

<? if ($condition) { ?>
<? } ?>

instead of

<?php if ($condition): ?>
<?php endif; ?>

that would clear a bit those template files IMHO.


texts: Good clean template based on HTML5 and ready for mobile/flexible/adaptive design

texts: Can you recommend a good clean template for Magento 1.7 that is based on HTML5, ready for mobile screens, using flexible/adaptive design, and which works on normal desktops as well? It doesn't have to be free (as in beer).


texts:
In order to override the Magento_Sales/web/order/create/scripts.js I created MyVendor/MyModule/view/adminhtml/requirejs-config.js. After removing _requirejs from pub/static and doing the deploying, I realized modification I made are not in new file created in _requirejs. What have I missed?

var config = {
    "map": {
        "*": {
            'Magento_Sales/web/order/create/scripts.js':
                'MyVendor_myModule/web/order/create/scripts.js'
        }
    }
};


texts: Magento 2 How to change media base url programatically

texts: Does anyone know how we can change magento 2 media base url programatically ?


texts:
everything good?
I am implementing a module, but the js file is not pulling the proper image
current js code
require(['jquery'], function($) {
    'use strict';

    const STORE_ID = 111233;
    const PRODUCT_ID = $('input[name="product"]').val();
    const PRODUCT_NAME = $('span[itemprop="name"]').text();

    var images = [];
    var imagesEl = document.querySelectorAll('img.product-image-photo');
    imagesEl.forEach(function(element, index) {
        images.push(element.src);
    });

    window._trustvox =  [];
    _trustvox.push(['_storeId', STORE_ID]);
    _trustvox.push(['_productId',  PRODUCT_ID]);
    _trustvox.push(['_productName', PRODUCT_NAME]);
    _trustvox.push(['_productPhotos', [images]]);
});

I have the impression that productPhoto is passing as a string, maybe that is the problem, as per manual, productPhoto is an array of images and needs to be passed like this:
[“www.example.com.br/imagem.jpg”] even if you upload only one image, that in itself can be the problem.
URL of the image being uploaded:

In this case, it needs to be inside a list (Array), according to this example:

Information:
Magento 2.3.6
PHP 7.3
AWS EC2 - Ubuntu
Extension Trustvox .


texts:
we recently installed an SSL certificate and configured Magento as recommended;

Set Web>Secure to https://
Set use secure in frontend and backend to yes

Now, every single page on our site is automatically HTTPS - I know this is not normal behaviour but I have confirmed there are not rewrites in the htaccess, the unsecure url is set to http:// and we only have basic extensions (with Extendware's Full Page Cache).

Any help would be greatly appreciated


texts: magento 1.9.0.1 after appling supee-6788 customer register not working

texts:
I just applied supee-6788 to my magento store running 1.9.0.1.

The customer registration not working, after submitting the information, page reloads with empty data. Customer login works fine.

I tried to put

<input type="hidden" name="form_key" value="<?php echo Mage::getSingleton('core/session')->getFormKey() ?>" />

in the

/app/design/frontend/YOURTHEME/default/template/customer/form/register.phtml

and

/app/design/frontend/YOURTHEME/default/template/persistent/customer/form/register.phtml

still not working, and error log show nothing.

Also, I reverted the patch, the problem gone. looks like the problem is from SUPEE-6788,

Does anyone know how to fix this? Any help will be appreciated