texts: Record count is showing wrong result in app\code\Magento\Sales\view\adminhtml\ui_component\sales_order_invoice_grid.xml

texts:
I customised sales_invoice_grid section by adding some more fields.Telephone,city,state,country and products.
app\code\Magento\Sales\Model\ResourceModel\Order\Invoice\Grid\Collection.php
<?php
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */

namespace Magento\Sales\Model\ResourceModel\Order\Invoice\Grid;

use Magento\Framework\Data\Collection\Db\FetchStrategyInterface as FetchStrategy;
use Magento\Framework\Data\Collection\EntityFactoryInterface as EntityFactory;
use Magento\Framework\Event\ManagerInterface as EventManager;
use Magento\Sales\Ui\Component\DataProvider\Document;
use Psr\Log\LoggerInterface as Logger;

class Collection extends \Magento\Framework\View\Element\UiComponent\DataProvider\SearchResult
{
    /**
     * @inheritdoc
     */
    protected $document = Document::class;

    /**
     * Initialize dependencies.
     *
     * @param EntityFactory $entityFactory
     * @param Logger $logger
     * @param FetchStrategy $fetchStrategy
     * @param EventManager $eventManager
     * @param string $mainTable
     * @param string $resourceModel
     */
    public function __construct(
        EntityFactory $entityFactory,
        Logger $logger,
        FetchStrategy $fetchStrategy,
        EventManager $eventManager,
        $mainTable = 'sales_invoice_grid',
        $resourceModel = \Magento\Sales\Model\ResourceModel\Order\Invoice::class
    ) {
        parent::__construct($entityFactory, $logger, $fetchStrategy, $eventManager, $mainTable, $resourceModel);
    }

     protected function _renderFiltersBefore()
    {
    $joinTable = $this->getTable('sales_order_address');

     $this->getSelect()->joinLeft($joinTable, "main_table.order_id =
    {$joinTable}.parent_id AND {$joinTable}.address_type = 'billing'",
      ['telephone','city','region','country_id'])->joinLeft(
            ['sii' => $this->getTable('sales_invoice_item')],
            'main_table.entity_id = sii.parent_id GROUP BY main_table.entity_id' ,
            ['name' => new \Zend_Db_Expr('GROUP_CONCAT(name SEPARATOR \',\')')]
        );

        //$query->getSelect()->__toString();
       parent::_renderFiltersBefore();
   }

}

This is the code.There are totals 22 records. but the count is showing as one records and pagination is also wrong. How to correct this.can anybody help?


texts: Magento Layered navigation filters for grouped products

texts:
In few words - problem is same as in this question https://stackoverflow.com/questions/16718129/magento-layered-navigation-configurable-products-multiple-filters-active-iss

We have products (configutable / grouped / bundle), that have there linked simple products.
That linked products have own attributes, and configurable have its own.

Layered Navigation gets all availiable options for linked products and add them into parent product, so when we getting different combinations of filters, we can set options for non existing simple products

Example:

SKU | Type    | Country | City           | Linked Skus
--------------------------------------------------------
SP1 | Simple  | USA     | NY             | -
SP2 | Simple  | USA     | LA             | -
SP3 | Simple  | Russia  | Moscow         | -
SP4 | Simple  | Russia  | St. Pitersburg | -
GP1 | Grouped | -       | -              | SP1, SP2
GP2 | Grouped | -       | -              | SP1, SP3, SP4

In that way we can check in filters Country = USA AND City = Moscow and magento will show us product GP2 as availiable for this combination of filters.

The reason of that is that in index table catalog_product_index_eav it would have something like:

SKU | Attribute | Value
--------------------------------
GP1 | Country   | USA
GP1 | City      | NY
GP1 | City      | LA
GP2 | Country   | USA
GP2 | Country   | Russia
GP2 | City      | NY
GP2 | City      | Moscow
GP2 | City      | St. Pitersburg

So for this selection USA + Moscow it would show result product GP2 because it have linked simples, that have values in attributes for USA and Moscow, but really not one simple have selected USA + Moscow at same time, so showing GP2 for such filters is mistake

Is there any extentions / ideas how to solve this?

Only one idea that comes to me is to add into catalog_product_index_eav additional column linked_id and for simples put into it zero value or simple entity_id value, but for grouped / configurable etc. generate index based for every linked simple + parent attribute values.

On this example it would look like:

SKU | Attribute | Linked Sku | Value
----------------------------------------
GP1 | Country   | SP1        | USA
GP1 | Country   | SP2        | USA
GP1 | City      | SP1        | NY
GP1 | City      | SP2        | LA
GP2 | Country   | SP1        | USA
GP2 | Country   | SP3        | Russia
GP2 | Country   | SP4        | Russia
GP2 | City      | SP1        | NY
GP2 | City      | SP3        | Moscow
GP2 | City      | SP4        | St. Pitersburg

So here we can add additional condition that all attributes in row must have same Linked Sku

May be someone knows ready solutions for this or have any additional ideas? Maybe wanna to discuss this?

Every ideas / solutions / opinions are welcome :)


texts: How to add a new check box in cart price rule form in magento 2.3 backend? and based on the value how to perform custom actions


texts: Magento 2: Create product list grid using ui component

texts:
I want to create product grid with some changes in columns in my custom module. For that I have created custom module.

In layout file I set

<referenceContainer name="content">
     <uiComponent name="product_listing"/>
     <block class="Magento\Catalog\Block\Adminhtml\Product" name="products_list"/>
</referenceContainer>

created product_listing.xml in ui_component

and added code of vendor\magento\module-catalog\view\adminhtml\ui_component\product_listing.xml

But when i visit my url only loading is showing. No error in log and console.

Can any one please tell me why its not working. Also tell me any other way to implement it if any.


texts:
On my site www.uitverkoop.tips you see a top navigation and side bar navigation. I want to have more categories, but then the top navigation uses to lines. So I want to reduce the size so that more categories can fit on the top navigation.
But how and where can i make this change? I checked default.xml but i cant change it there.

Can some one help me?


texts: Magento 2 - Custom additional checkout field validation not working when customer is logged in

texts:
I've added a custom checkout field with validation in additional shipping area using a layout processor plugin.

  Vendor\Module\Model\Checkout\LayoutProcessorPlugin.php

public function afterProcess (
    \Magento\Checkout\Block\Checkout\LayoutProcessor $subject,
    array  $jsLayout
) {
    $jsLayout['components']['checkout']['children']['steps']['children']['shipping-step']['children']
    ['shippingAddress']['children']['shippingAdditional'] = [
        'component' => 'uiComponent',
        'displayArea' => 'shippingAdditional',
        'children' => [
            'terminal' => [
                'component' => 'Vendor_Module/js/methods/method',
                'config' => [
                    'customScope' => 'shippingAddress',
                    'template' => 'ui/form/field',
                    'elementTmpl' => 'Vendor_Module/method',
                    'options' => [],
                ],
                'dataScope' => 'shippingAddress.method_terminal',
                'label' => '',
                'provider' => 'checkoutProvider',
                'visible' => true,
                'validation' => [ 'select-terminal-required' => true ],
                'sortOrder' => 200,
            ]
        ],
    ];
    return $jsLayout;
}

In my phtml template file i have custom select that i wan't to validate:

 <select name="vendor-terminal" class="select-terminal-required" id="terminal-list" data-bind="html: getTerminalList ()">
 </select>

And I added custom validation mixin for this field.

  require-config.js

var config = {
    config: {
        mixins: {
            'Magento_Ui/js/lib/validation/validator': {
                'Vendor_Module/js/validation-mixin': true
            },
    }
}

  validation-mixin.js

define([
    'jquery',
    'Magento_Checkout/js/model/quote',
    'Magento_Ui/js/lib/validation/utils'
], function ($, quote, utils) {
    "use strict";
    return function ( validator ) {
        validator.addRule ( 'select-terminal-required', function () {
            var method = quote.shippingMethod();
            var validation = method.method_code === 'vendor_terminal' && utils.isEmpty($( '.select-terminal-required' ).val ());
            return !validation;
        }, $.mage.__( 'Please select terminal.' ) );

        return validator;
    }
});

My approach is that when a customer tries to go to the payment step without selecting any value it would fire a validation error. And it does until the customer is logged in and added his shipping address to he's address book. And it fires when a customer tries to change the address information inside checkout. I need validation that fires when a customer tries to go to the next step of checkout. Does anyone know any solution for this?


texts: how to cancel certain order item rather than cancel whole order?

texts:
I need a function which is order cancel based on the item. Current scenario is that Magento does cancel whole order.
What I want:

A customer placed 2 ordered items. And after placed order, customer wants to cancel 1 item,so in this situation which parameter I should consider and which approach I have to go ?

I found some below code in Magento core files,if someone check and give me some hint about cancel order item rather than whole order,it will be appreciated.

app\code\core\Mage\Sales\Model\Order.php

 public function registerCancellation($comment = '', $graceful = true)
    {
        if ($this->canCancel() || $this->isPaymentReview()) {
            $cancelState = self::STATE_CANCELED;
            foreach ($this->getAllItems() as $item) {
                if ($cancelState != self::STATE_PROCESSING && $item->getQtyToRefund()) {
                    if ($item->getQtyToShip() > $item->getQtyToCancel()) {
                        $cancelState = self::STATE_PROCESSING;
                    } else {
                        $cancelState = self::STATE_COMPLETE;
                    }
                }
                $item->cancel();
            }

            $this->setSubtotalCanceled($this->getSubtotal() - $this->getSubtotalInvoiced());
            $this->setBaseSubtotalCanceled($this->getBaseSubtotal() - $this->getBaseSubtotalInvoiced());

            $this->setTaxCanceled($this->getTaxAmount() - $this->getTaxInvoiced());
            $this->setBaseTaxCanceled($this->getBaseTaxAmount() - $this->getBaseTaxInvoiced());

            $this->setShippingCanceled($this->getShippingAmount() - $this->getShippingInvoiced());
            $this->setBaseShippingCanceled($this->getBaseShippingAmount() - $this->getBaseShippingInvoiced());

            $this->setDiscountCanceled(abs($this->getDiscountAmount()) - $this->getDiscountInvoiced());
            $this->setBaseDiscountCanceled(abs($this->getBaseDiscountAmount()) - $this->getBaseDiscountInvoiced());

            $this->setTotalCanceled($this->getGrandTotal() - $this->getTotalPaid());
            $this->setBaseTotalCanceled($this->getBaseGrandTotal() - $this->getBaseTotalPaid());

            $this->_setState($cancelState, true, $comment);
        } elseif (!$graceful) {
            Mage::throwException(Mage::helper('sales')->__('Order does not allow to be canceled.'));
        }
        return $this;
    }


texts: how to solve problem on checkout page after upgrading magento 1x to magento 2x

texts: Next Exception: Report ID: webapi-5942548a83c3a; Message: SQLSTATE[42000]: Syntax error or access violation: 1103 Incorrect table name '', query was: INSERT INTO `` () VALUES () in /opt/lampp/htdocs/texas/texas_newm2/vendor/magento/framework/Webapi/ErrorProcessor.php:195


texts: Magento 2 : JS issue at the time of enable bundle js

texts:
I am trying to enable bundle js feature but getting this issue on product view page

  SyntaxError: missing ; before statement
  </div>'}}(window,document,location,"undefined"!

Any one have idea about this issue of fotoram.min.js or fotoram.js


texts:
I have this code for a AJAX call:

  Controller/Data/Get.php

<?php
    namespace Vendor\Module\Controller\Data;

    class Get extends \Magento\Framework\App\Action\Action
    {
        protected $resultJsonFactory;
        protected $resultFactory;

        public function __construct(
            \Magento\Framework\App\Action\Context $context,
            \Magento\Framework\Controller\Result\JsonFactory $resultJsonFactory,
            \Magento\Framework\Controller\ResultFactory $resultFactory
        )
        {
            $this->resultJsonFactory = $resultJsonFactory;
            $this->resultFactory = $resultFactory;

            parent::__construct($context);
        }

        public function execute()
        {
            $result = $this->resultJsonFactory->create();
            $response = '200';

            $resultJson = $this->resultFactory->create(ResultFactory::TYPE_JSON);
            $resultJson->setData($response);

            return $resultJson;
        }
    }

With my js in my .phtml template file as:

<script type="text/javascript">
    require(['jquery', 'module'], function($, script)
    {
        //<![CDATA[
        jQuery(document).ready(function($)
        {
            $('select.filter-select').change(function()
            {
                let ajaxReq,
                    value = $(this).val();

                ajaxReq = $.ajax({
                    url: '<?php echo $block->getUrl("module/data/get"); ?>',
                    type: 'post',
                    showLoader: true,
                    data: {val: value}
                });

                ajaxReq.done(function(res, txtStatus, jqXHR)
                {
                    console.log(res);
                });

                ajaxReq.fail(function(XMLHttpRequest, txtStatus, err)
                {
                    console.log(XMLHttpRequest);
                    console.log(txtStatus);
                    console.log(err);
                });
            });
        });
        //]]>
    });
</script>

This returns:

  There has been an error processing your requestException printing is disabled by default for security reasons.Error log record number: 616547725800

Going to var/report/616547725800 shows:

  {"0":"Source class \"\Vendor\Module\Controller\Data\Result\" for \"Vendor\Module\Controller\Data\ResultFactory\" generation does not exist."

This happens both before and after the below commands:

$ php bin/magento setup:upgrade
$ php bin/magento setup:di:compile
$ php bin/magento setup:static-content:deploy -f
$ php bin/magento cache:flush

What's wrong with my code? :(


texts: Magento 2.0.2 : How to update the title of "Privacy and Cookie Policy" link displays on footer store?

texts:
I would like to update the title of "Privacy and Cookie Policy" link displays on footer store (for example to translate this title in French).

The articles that I consulted talk about older versions of Magento thus not applicable for my problem.

Any ideas ?

Thanks in advance.


texts: Best Magento change log & client information tool

texts:
When working on a Magento project there is obviously a lot going on. New client requests, the release of Magento patches or things you might want to improve on existing projects to keep shops up-to-date, safe or provide better useability.

My question is which project tool is best suitable to keep track of these changes and improvements and is also capable, when needed, to inform the client about the recent changes that have taken place. I'm sensing that clients are getting more informed about the status of their E-Commerce system and the release of new versions or patches of Magento. I've done some research but haven't found a tool that actually fits these needs. I understand there is a not a one-answer-fits-all solution but I'm interested in the tools others might be using and their reasoning behind it.


texts:
In my magento shop I don't want to display icons for subcategories in topmenu. But I wan't to leave them in top menu. If I don't select icon for subcategory I get missing img include. You can see screenshot below.

Code that generates output is:

$urls = Mage::getBaseUrl('media').'catalog/category/'.$child->getData('thumbnail');

        $html .= 'getUrl() . '" ' . $outermostClassCode . '>' . '  '
            . $this->escapeHtml($child->getName()) . '';

        if ($child->hasChildren()) {
            if (!empty($childrenWrapClass)) {
                $html .= '
';
            }
            $html .= '
';
            $html .= $this->_getHtml($child, $childrenWrapClass);
            $html .= '
';

            if (!empty($childrenWrapClass)) {
                $html .= '
';
            }
        }
        $html .= '
';

Thanks for all suggestions.


texts: CPU Usage shows 100% use and some time Lawer then 100 after live Magento 2 Site

texts:
i have live the magento 2 site,
but site was too slow and some times show 500 error also,
when i check in server it shows CPU Usage 100%,
i have talk with server, and their response is....
9833 fmsprod 20 0 345960 24372 4440 R 47.5 0.0 0:01.71 lsphp:/home/fmsprod/public_html/index.php,
29762 fmsprod 20 0 364500 45740 7188 R 46.7 0.1 0:03.74 lsphp:/home/fmsprod/public_html/index.php,
29865 fmsprod 20 0 339696 17908 4092 R 5.1 0.0 0:00.14 lsphp:/home/fmsprod/public_html/index.php
*It appears there are three processes from a single access to the site.
Then when having multiple concurrent access to the site, there with be many processes generated,
making it likely that CPU usage hits 100%.
I suggest asking the devs to investigate this and optimize the site so as to reduce the processes.
and im developer of this site,
Now What i have to do for Fix this Situation
please help me on this.
Thanks,


texts:
We recently started to address requests from customers to be alerted once product comes back in stock. Basically a lot of these requests were mistakenly deleted without being addressed. Is there any way to view historical product alerts, even once they've been deleted?

Any information would be greatly appreciated.

Thank you!


texts: How to create swatch as simple product, which is created through configuration in Magento 2.2.6?

texts:
I have created a product of type simple. After that, I have created a swatch for the same product through the "configuration" tab on the same edit page.

When we create a swatch through the "configuration" tab, it creates a new product with visibility type "Not Visible Individually" and product type
"virtual".

I want when products created through "configuration" tab on the same edit page it should be the type of "simple"

Please check screenshots:


texts: M1- How to Properly Enable Full Site HTTPS?

texts:
I need advice as I have found mixed suggestions on how to Properly change site to FULL-HTTPS (frontend and backend).

I have set "YES" for both "Use  Secured URL's in Frontend and Admin", but the site still loads as http:// with the exception of admin and checkout pages, they are https://.

Now I am thinking, in the Unsecured Section: Should I change base url from http:// to https:// ?

As well, should I also change the following unsecured values to Secured?

{{unsecure_base_url}}

{{unsecure_base_url}}skin/

{{unsecure_base_url}}media/

{{unsecure_base_url}}js/

Finally, how to properly redirect google traffic so that all http://example.com/baseballhat,
 links redirected to secured version
https://example.com/baseballhat,
rather than to the secured homepage https://example.com/


texts: Configurable Procucts appear as out of stock in frontend

texts:
I´m facing some problem in make my configurable products appear in frontend, no matter what i do (i´d read an tried other posts solutions) it appears as out of stock in my frontedn.

Follow configs so you can see if you can help me out:

At the main configurable product -> stock

Manage stock = yes
Allow product increment = yes
Availability = in stock

Product category -> egypt

Than i´d created a buch of simple products from my configurable one as quickly associated product:

status = enabled
visibility = not visible individualy
amount = 1000
availability = in stock

Problems:
1) when I save the associate product it does not save my product category (egypt) , it stays without any category.

2) Even if I manualy go in each product and set the category to Egypt (a looot of work) in my frontend it still appear as out of stock.

Just to let you know, if I go to my configurable product at backend -> associate products, it shows the simple products created as associated normaly.

Any ideas on how to fix it?


texts: Magento 2.1.10 - Front controller reached 100 router match iterations caused by IWD StoreLocator

texts:
I recently updated my Magento version from 2.1.1 to 2.1.10 and the module mentioned in the title is causing that exception.
module version is 2.0.6

I contacted their support, and was told it is a known issue, and they're planning to solve it in the next release. The problem is that no one knows when the next release is planned and I need to put the application live in some days, so I need to solve the issue.

Actually they sent me a sort of patch, in order to substitue the di.xml in app/code/IWD/StoreLocator/etc/frontend/di.xml, that is just a commented version of the original one, and changed the url to store locator page to 'storelocator'.

patched 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\Framework\App\RouterList">-->
        <!--<arguments>-->
            <!--<argument name="routerList" xsi:type="array">-->
                <!--<item name="storelocatorroute" xsi:type="array">-->
                    <!--<item name="class" xsi:type="string">IWD\StoreLocator\Controller\Router</item>-->
                    <!--<item name="disable" xsi:type="boolean">false</item>-->
                    <!--<item name="sortOrder" xsi:type="string">22</item>-->
                <!--</item>-->
            <!--</argument>-->
        <!--</arguments>-->
    <!--</type>-->
</config>

Exception is disappeared, but the map contains no markers at all, hence stores are not displayed.

Does anyone has a clue on the issue?

EDIT - The router causing the problem

public function match(\Magento\Framework\App\RequestInterface $request)
{
    $status = $this->_scopeConfig->getValue('iwd_storelocator/general/is_active', \Magento\Store\Model\ScopeInterface::SCOPE_STORE);
    if(!$status){
        return;
    }

    $locatorRoute = $this->_scopeConfig->getValue('iwd_storelocator/general/path', \Magento\Store\Model\ScopeInterface::SCOPE_STORE);

    $path = strtolower($locatorRoute);
    $path = trim($locatorRoute);

    $identifier = trim($request->getPathInfo(), '/');
    $action = $request->getActionName();

    if($identifier == $locatorRoute) {

        $request->setModuleName('storelocator')
                        ->setControllerName('index')
                        ->setActionName($action);
    } else {
        //There is no match
        return;
    }

    /*
     * We have match and now we will forward action
     */
    return $this->actionFactory->create(
        'Magento\Framework\App\Action\Forward',
        ['request' => $request]
    );
}

EDIT 2
To avoid redirection I've added a dummy counter to the controller, to avoid too many redirections, like this

if($identifier == $locatorRoute && $this->count < 2) {
   $request->setModuleName('storelocator')
       ->setControllerName('index')
       ->setActionName($action);
    } else {
        return;
    }

but I get the same result as commenting the di.xml, so no marker is shown on the map.


texts:
how to solve this problem

Fatal error: Call to a member function getId() on a non-object in F:\wamp\www\magento\app\code\local\company\module\Block\Customer\Sales\Order\View\block.php on line 18

my php:

public function getOrder() {
    return Mage::registry('current_order');
}

public function getBackUrl() {
    return Mage::getUrl('sales/order/view',array('order_id' =>$this->getOrder()->getId()));
}


texts: FishPig Wp extension comment form not showing

texts:
I have installed a plugin and configured it properly. As I checked, I couldn't find comment form or wordpress recent comments.
I have used Magento 2.
Comment form is missing in single post page


texts: What information is required in the ID path of a Magento URL Rewrite

texts: Is it required to use the old URL in ID path? I thought that was just used for personal identification and you can fill in whatever you want?


texts: Magento 2: Custom Admin Controller / Action Returns 404

texts:
I don't really know where is the problem as it seems I have done as it is explained in the official documentation (except I did stripped it down a little);

  Company/Module/etc/admin/html/routes.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd">
    <router id="admin">
        <route id="custom" frontName="custom">
            <module name="Company_Module" />
        </route>
    </router>
</config>

  Company/Module/Controller/Adminhtml/Index/Index.php

<?php

namespace Company\Module\Controller\Adminhtml\Index\Index;

use Magento\Backend\App\Action;
use Magento\Framework\Controller\Result\Raw;
use Magento\Framework\Controller\ResultFactory;

class Index extends Action
{

    public function execute()
    {
        $result = $this->resultFactory->create(ResultFactory::TYPE_RAW);

        $result->setContents('Hello world');

        return $result;
    }
}

Unfortunately when I visit http://magento.local.com/admin/custom I get 404 page in admin panel (security keys in URLs are turned off)

Am I missing anything?


texts: Get shipping address in onepage checkout session

texts:
The goal is to get the shipping address (in fact only the country) currently selected by the customer in the onepage checkout process.

I'm aware that quote-related data can be accessed by using

Mage::getModel('checkout/session')->getQuote()

and in particular

Mage::getModel('checkout/session')->getQuote()->getShippingAddress()->getData().

This also works when already existing customer shipping data is selected from the address book, but not when

1) new customers try to order, i.e. not logged in
2) the "new address" option is selected (logged in or not logged in does not matter)

The question is: Why do we not get customer shipping data for logged out users and/or new addresses entered in the OPC process using Mage::getModel('checkout/session')->getQuote()->getShippingAddress()->getData()?

Here is the corresponding code for reference:

$quote = Mage::getModel('checkout/session')->getQuote();

if ($quote) {
  if ($quote->getShippingAddress()) {
    // check customer shipping address country
    $shippingData = $quote->getShippingAddress()->getData();
if ($shippingData['country_id'] === 'DE') {
  $inlandCost = floatval($inlandCost) - 8.0;
} else if ($shippingData['country_id'] === 'AT') {
  if (floatval($quote->getGrandTotal()) < 70) {
     $inlandCost = floatval($inlandCost) - 5.0;
  }
}

}
}

For reference: This is the code we ended up using (working):

    $quote = Mage::getModel('checkout/session')->getQuote();
  if ($quote) {
    if ($quote->getShippingAddress()) {
      // check customer shipping address country
      $shippingData = $quote->getShippingAddress()->getData();

      if (isset($shippingData['country_id'])) {
        if ($shippingData['country_id'] === 'DE') {
          $baseCost; // do some calculation here
        } else if ($shippingData['country_id'] === 'AT') {
          if (floatval($quote->getGrandTotal()) < 70) {
            $baseCost = // do some calculation here
          }
        }
      }
    }
  }


texts: Wishlist function does not work - Item (Magento\Wishlist\Model\Item) with the same ID "5192" already exists

texts:
We are having an issues with wishlist function. Products are not added to the wishlist.
In system.log and exception.log we get the following messages, when a customer click on "add to wishlist" in frontend:
system.log
[2020-01-26 17:32:00] main.CRITICAL: Item (Magento\Wishlist\Model\Item) with the same ID "5192" already exists. [] []

Exception.log
[2020-01-26 17:20:08] main.CRITICAL: The product that was requested doesn't exist. Verify the product and try again. {"exception":"[object] (Magento\\Framework\\Exception\\NoSuchEntityException(code: 0): The product that was requested doesn't exist. Verify the product and try again. at /home/xxxxx/www/vendor/magento/module-catalog/Model/ProductRepository.php:310)"} []

customer/section/load/
message: "Item (Magento\Wishlist\Model\Item\Interceptor) with the same ID "13620" already exists."
Does any one know how can we fix this issue?
Best regards,
Jesper


texts: How to configure an existing Magento 2.1.7 project in another PC and Database?

texts:
I am new to Magento.
I have a working Magento 2.1.7 project and want to put it in a git  repository.

If I put the working Magento directory into git and clone the repository to a local machine how do I install the existing project and do the database configuration?

I tried copy pasting the existing repository to another machine and tried to install it by following the normal procedure but it didn't work, instead I got this error:

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

I also tried to import the database as well but I got this error while importing:

Warning: Unknown: Input variables exceeded 1000. To increase the limit change max_input_vars in php.ini. in Unknown on line 0
 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"

I extended the max_input_vars to 10000 in the php.ini file but still, I get the same error.

Please suggest me about how can I configure and install an existing Magento 2.1.7 project ** because I want to put the working project to GIT for my team to work with !**.


texts: Sales Order Grid - Can't export custom columns

texts:
I've added the a few columns to the sales_flat_order_gridtable.
The values are obtained in these two events sales_order_resource_init_virtual_grid_columns (using addVirtualGridColumn() ) and sales_order_resource_update_grid_records (updating the table values for some more complex joins).

<add_order_grid_column_handle>
    <reference name="sales_order.grid">
        <action method="addColumnAfter">
            <columnId>product_names</columnId>
            <arguments>
                <header>Product(s) Name(s)</header>
                <index>product_names</index>
                <type>text</type>
            </arguments>
            <after>created_at</after>
        </action>
        [...]
    </reference>
</add_order_grid_column_handle>

<adminhtml_sales_order_grid>
    <update handle="add_order_grid_column_handle" />
</adminhtml_sales_order_grid>
<adminhtml_sales_order_index>
    <update handle="add_order_grid_column_handle" />
</adminhtml_sales_order_index>

However, when exporting a csv of the grid, it doesn't include the custom columns.

I found that the file is loaded using the grid block like this:

$this->getLayout()->createBlock('adminhtml/sales_order_grid');

But that, for some reason, is not loading the layout update I have written above, so the new columns are not used...

Is there any settings, or layout handle to add to this columns, so they are also used in the exported csv?


texts: Magento 2 - unable to retrieve deployment of static files from the file system storeview

texts:
When I'm in production mode, if i run the command

  php bin magento setup: upgrade

static files are generated only for the en_US language.
While for the other store views, it_IT and es_ES I get the error:
unable to retrieve deployment of static files from the file system storeview

I have to generate manually with the command:

  php bin / magento setup: static-content: deploy - f it_IT

.... It's normal?
Because when I'm in Developer mode and I run the command:

php bin magento setup: upgrade

They are automatically generated for all store view.


texts: Is there a method in Magento that allows to create MySQL triggers and stored procedures?

texts:
I am trying to find out if Magento has a method available that allows to create MySQL triggers and Stored Procedures.

Currently, i am using the core resource DB adapter to insert the raw SQL directly from my setup script, and was wondering if there was in fact a method available for this, similar to the way we add foreign keys, etc.

Does anyone know of anything like this either in EE or CE? A library or custom script perhaps?


texts: I do not know about crawler in magento.I search but do not know exactly what it do ? there are lots of crawler extension about cache crawler but I want to know about crawler.Anyone can understand about crawler in cache in magento ?


texts:
When I view an invoice I can see if a discount was applied to each line item.  However when I print the PDF for it I do not get the discount as a line item but just a total.  I see my table headers in:

/app/code/core/Mage/Sales/Order/Pdf/Invoice.php

May I ask what my "feed" number is for discounts? Also is this the only file that I need to copy over to local to edit?


texts:
I merged CSS and/or JavaScript and my website is all messed up.

How do I disable the CSS/JS merge functions?

It's so messed up I can't access the Admin panel, how do I do it in the database?


texts: How to add bing script code for adding bing search engine to my magento2 website then where to add that script code in Magento2?

texts: Do I want to add bing script code for adding bing search engine to my magento2 website then where to add that script code in Magento2?. I don't know how to implement this task. Can you please help me?


texts: Full page caching issue with product quantity feedback on enterprise

texts: I'm having a problem with full page caching whereby when a customer enters a product quantity which is more than the available stock, it sometimes alerts the user on the product page, but other times it doesn't alert the user until they check their basket.


texts:
I'm trying to write my own search engine on my project. I'm trying to get products by product tags. How can I do that?

Edit: Actually, is magento search working by product tags or just product name and description?


texts:
In my project, I have many layout handles which I am calling on different MVC actions (mostly on click). I just realized that the layout handles have a common code between them something like this:

<block name="reports.product.viewed" type="a/b_c" template="a/c.phtml"></block>
<block name="catalog.product.new" type="b/b_c" template="b/c.phtml"></block>
<block name="customer.allreviews" type="c/b_c" template="c/c.phtml"></block>
<block name="best.sellers" type="d/b_c" template="d/c.phtml"></block>

So, I planned to move the above code in a layout handle common_code_lines and call the layout handle instead of writing the above four lines. i.e

<reference name="content">
    <!-- other blocks -->
    <update handle="common_code_lines"/>
</reference>

This is just not working.. no errors.

What I am missing? please help.


texts: system.log errors - Warning: SimpleXMLElement::__construct()

texts:
My system.log file is filling up with the following error message:

2014-08-06T20:10:59+00:00 ERR (3): Warning: SimpleXMLElement::__construct() [simplexmlelement.--construct]: Entity: line 3: parser error : Start tag expected, '&lt;' not found  in /home/geoff/public_html/app/code/core/Mage/AdminNotification/Model/Feed.php on line 173
2014-08-06T20:10:59+00:00 ERR (3): Warning: SimpleXMLElement::__construct() [simplexmlelement.--construct]: &lt;!DOCTYPE html&gt;  in /home/geoff/public_html/app/code/core/Mage/AdminNotification/Model/Feed.php on line 173
2014-08-06T20:10:59+00:00 ERR (3): Warning: SimpleXMLElement::__construct() [simplexmlelement.--construct]: ^  in /home/geoff/public_html/app/code/core/Mage/AdminNotification/Model/Feed.php on line 173

I've been trawling through xml files trying to find anything that might be calling feed.php but have had no luck.  Can anyone offer any advice?  I'm running Magento 1.7.0.2.


texts: I need get the sku attribute in the product page description of my Magento site as the attribute does not show there by default, that's the first bit, the second bit is I need to know where to insert the code on the view.phtml


texts: display currency picker in without using xml file in magento

texts:
Basically this code :

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

        <?php echo $this->__('Select Your Currency') ?>

        <select name="currency" title="<?php echo $this->__('Select Your Currency') ?>" onchange="setLocation(this.value)">
        <?php foreach ($this->getCurrencies() as $_code => $_name): ?>
            <option value="<?php echo $this->getSwitchCurrencyUrl($_code) ?>"<?php if($_code==$this->getCurrentCurrencyCode()): ?> selected="selected"<?php endif; ?>>
                <?php echo $_name ?> - <?php echo $_code ?>
            </option>
        <?php endforeach; ?>
        </select>

<?php endif; ?>

AND

<?xml version="1.0"?>
<layout version="0.1.0">
    <default>
        <reference name="header">
            <block type="directory/currency" name="custom_currency_selector" template="currency/currency.phtml"/>
        </reference>
    </default>
</layout>

code help to display the currecny switcher in the header of magento page. But I want to use only currecny.phtml code directly into header without using any xml file so what should I have to write in place of : $this->?


texts: Can't find theme for configuration Magento 2.2.0

texts:
I'm trying the edit a theme i've uploaded via FTP to the APP & PUB folders.

However, I've checked under Content and Configuration and nothing is displayed. Not even the default theme. See attached.

I've tried to filter the option to only show my Store but still nothing shows to select any theme.

The themes are installed properly because I can see them under Content, Themes. I can see the default themes and the custom theme.

Any help will be great


texts:
I am using magento 1.9 version.
I need to display customer groups in dropdown option.

I used this code.

It brings the data as dropdown.

My issue is When i use this code some css issues occurs.

By commenting the collection data (ie., line# 4 to line #6) it's working fine.

what is the issue here.


texts: Unable to resolve the source file for error in custom theme?

texts:
I am working on magento version 2.1.3 and have a custom theme shoppersbay. For some js files it gives error like

  Unable to resolve the source file for
  'frontend/Smartwave/shoppersbay/en_US/Magento_ConfigurableProduct/js/variations/paging/sizes.js'
  0 /home4/shoppoz8/public_html/shoppersbay/vendor/magento/framework/App/StaticResource.php(97): Magento\Framework\View\Asset\File->getSourceFile()
  1 /home4/shoppoz8/public_html/shoppersbay/vendor/magento/framework/App/Bootstrap.php(258):
  Magento\Framework\App\StaticResource->launch()
  2 /home4/shoppoz8/public_html/shoppersbay/pub/static.php(13): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\StaticResource))
  3 {main}

I searched for the file sizes.js but i didn't find any in theme and in vendor directory. How can i resolve it?


texts: New filter condition: Add cart id as attribute to shopping cart rule => Solving discount on first item only

texts:
we have been trying to solve this for ages. Apply 50% on first product in cart only. As I understand this cannot be done as is. Magento 1.9.0.1

So I was thinking. Can I add a new filter condition? that being the position/id in the cart object. Then we set IF CART ID = 1

Question: Would this be very hard to accomplish? Or is there a smart way to create an ingenious extension to do this?

Any help appreciated - and if I find the solution I will share it here. I see this questiion been asked many times.


texts:
For what is "downloadable_domains" in env.php file? I have read on Magento dev docs, but I can`t understand where it is used? Please do not add links to dev docs. Describe please your point of view.
Thanks in advance!


texts: Getting error Call to a member function dispatch() on null in Block

texts:
This is the proper way of outputting something

Fatal error: Uncaught Error: Call to a member function dispatch() on null in
/opt/lampp/htdocs/learnm3/vendor/magento/framework/Model/ResourceModel/Db/Collection/AbstractCollection.php:531 Stack trace: #0 /opt/lampp/htdocs/learnm3/vendor/magento/framework/Data/Collection/AbstractDb.php(571):
Magento\Framework\Model\ResourceModel\Db\Collection\AbstractCollection->_beforeLoad() #1 /opt/lampp/htdocs/learnm3/vendor/magento/framework/Data/Collection/AbstractDb.php(559): Magento\Framework\Data\Collection\AbstractDb->loadWithFilter(false, false) #2
/opt/lampp/htdocs/learnm3/vendor/magento/framework/Data/Collection.php(331): Magento\Framework\Data\Collection\AbstractDb->load() #3
/opt/lampp/htdocs/learnm3/app/code/First/Module/Block/Index.php(22): Magento\Framework\Data\Collection->getItems() #4
/opt/lampp/htdocs/learnm3/app/code/First/Module/view/frontend/templates/index.phtml(4): First\Module\Block\Index->gettingitem() #5
/opt/lampp/htdocs/learnm3/vendor/magento/framework/View/TemplateEngine/Php.php(59): include('/opt/lampp/htd in
/opt/lampp/htdocs/learnm3/vendor/magento/framework/Model/ResourceModel/Db/Collection/AbstractCollection.php on line 531

My block code is this

    <?php
namespace First\Module\Block;
use Magento\Framework\View\Element\Template;
use First\Module\Model\ResourceModel\Item\Collection ;
use First\Module\Model\ResourceModel\Item\CollectionFactory ;

class Index extends Template
{
    protected $cf ;
    public function __construct(
        Template\Context $context ,
        CollectionFactory $collectionfactory,
        array $data = []
    )
    {

        parent::__construct($context, $data);
        $this->cf = $collectionfactory;

    }
    public function gettingitem(){
        return $this->cf->create()->getItems();
    }

}

I am creating an extension (learning) I am stuck at that point.

I am asking first time for help on this platform so if I didn't follow the rules for asking a good quality question then ignore please thanks.


texts: Programmatically adding configurable products to the cart with SCP

texts:
I am using the SCP extension so that prices are taken from the simple product and not the configurable.
I am using url approach to add product in the cart

checkout/cart/add?product=10940&qty=1&super_attribute[134]=22

This url adds product into cart but price is taken from first associated product only. same price is rendered in all associated products.


texts: Trying to add product with description via REST

texts:
Apologies if this is a silly question, I'm sure it must be but I just can't seem to figure out how you are supposed to add a product's description via REST.

The REST API docs at http://devdocs.magento.com/swagger/index_20.html under the catalogProductRepositoryV1 list all the the available fields but description is not there.

Can someone advise which resource the product's description is managed through?


texts: How to solve Security patch 10415 Error?

texts:
After installing Security patch 10415, both frontend and backend return 404 error. How can I solve this error?

Note: No log error found.


texts: Magento 1 add a color swatch link on one step checkout page

texts:
I want to add a color swatch option for config product on one step checkout page, can someone guide me on how can I do this?

Is short, I want to give user option to change color on one step checkout page.

The color swatcher option are already available on product details page, I need it on one step checkout page.


texts:
I would like to duplicate the products via Magento admin panel. When I tried to duplicate the product, I'm getting the following error:

"The value specified in the URL Key field would generate a URL that already exists.
To resolve this conflict, you can either change the value of the URL Key field (located in the Search Engine Optimization section) to a unique value or change the Request Path fields"

I'm trying to getting the solution to make this work. Please reply with your suggestion. Your help will be greatly appreciated.

Note: When I create a new product, the "Save and Duplicate" works fine.

Thanks,


texts: How to show Categories in System.xml in magento 2

texts:
I'm getting all the categories in System.xml using the class

Vender\Module\Model\Config\Source\Category

<?php
namespace Vender\Module\Model\Config\Source;

use Magento\Framework\Data\OptionSourceInterface;

class Category implements OptionSourceInterface{

    protected $_categoryFactory;
    protected $_categoryCollectionFactory;

    public function __construct(
        \Magento\Catalog\Model\ResourceModel\Category\CollectionFactory $categoryCollectionFactory,
        \Magento\Catalog\Model\CategoryFactory $categoryFactory
    ) {
        $this->_categoryCollectionFactory = $categoryCollectionFactory;
        $this->_categoryFactory = $categoryFactory;
    }

    /**
    * Get category collection
    *
    * @param bool $isActive
    * @param bool|int $level
    * @param bool|string $sortBy
    * @param bool|int $pageSize
    * @return \Magento\Catalog\Model\ResourceModel\Category\Collection or array
    */

    public function getAllCategoryCollection($isActive = true, $level = false, $sortBy = false, $pageSize = false)
    {
        $collection = $this->_categoryCollectionFactory->create();
        $collection->addAttributeToSelect('*');

        // select only active categories
        if ($isActive) {
            $collection->addIsActiveFilter();
        }

        // select categories of certain level
        if ($level) {
            $collection->addLevelFilter($level);
        }

        // sort categories by some value
        if ($sortBy) {
            $collection->addOrderField($sortBy);
        }

        // select certain number of categories
        if ($pageSize) {
            $collection->setPageSize($pageSize);
        }

        return $collection;
    }

    public function toOptionArray(){

        $arr = $this->_toCheckArray();
        $ret = [];
        foreach ($arr as $key => $value){
            $ret[] = [
                'value' => $key,
                'label' => $value
            ];
        }
        return $ret;
    }

    private function _toCheckArray(){

        $categories = $this->getAllCategoryCollection(true, false, false, false);
        $catagoryList = array();
        foreach ($categories as $category){
           $catagoryList[$category->getEntityId()] = __($this->_getCategoryParentName($category->getPath()) . $category->getName());
        }
        return $catagoryList;
    }

    private function _getCategoryParentName($path = ''){
        $parentName = '';
        $rootCats = array(1,2);
        $catTree = explode("/", $path);
        array_pop($catTree);
        if($catTree && (count($catTree) > count($rootCats))){
            foreach ($catTree as $catId){
                if(!in_array($catId, $rootCats)){
                    $category = $this->_categoryFactory->create()->load($catId);
                    $categoryName = $category->getName();
                    $parentName .= $categoryName . ' -> ';
                }
            }
        }
        return $parentName;
    }
}

I get this class form Magento 2 - Category list for custom magento system configuration section
Now its works perfectly for me and its output is like

But when I submit my module to Magento QA they send me the Error

Now how can I solve this problem?unable to identify the problem

Note: I have submitted this Extension before by changing the Name of Class I thought that it will be the problem because of the Class name or Methods name I changed all the methods name and class name but again they send me the same problem.


texts: Using {{store}} directive to get url for different store view

texts:
Scenario:
In a static block, I need to generate the url for a specific page but not in the current store view, but to a specific store view / website.

Question:
Is there a combination of parameters that can be passed to the {{store}} directive to make this happen?
Something like {{store _direct="page-here" store_code=some-code}}  or instead of store code, store_id or anything else.


texts: Magento 2 product_form.xml ovevride existing field

texts:
<fieldset name="product-details">
    <field name="sku">
        <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
                <item name="notice" xsi:type="string" translate="true" after="product-details.sku">Some note here</item>
            </item>
        </argument>
    </field>
</fieldset>

I have tried this, which should just add notice below existing input, but it is adding new (duplicated) SKU field and displaying notice with that. So how can I override existing field/attribute?


texts: Same sku in items of configurable product in order?

texts:
An order with a configurable product.

foreach  ($order->getAllItems() as $item) {
   echo $item->getSku();
}

There're two items. But they have same sku! How did happen? And anyway for each item get it own sku (from configurable and its child product)?


texts: How to remove validation from the "City" and "Street Address" Field on Customer Registration Page?

texts:
I've added "Address Information"  on customer registration page & want to remove the mandatory field from the "City" and "Street Address" Field  for that I've  overrided register.phtml file on my custom theme.

& When I clicked on "Create An Account" button then getting below issue:-

"Delete operation is forbidden for current area"

While in the backend created account is showing but "Telephone" field(this is mandatory) value is missing.

When I log in using created account uname & pswd it's working.

So why this issue is coming?how can i resolve it?if you've any alternate solution you can share.

Please find the screenshots for the same:-

After debugging contrller **"Magento\Customer\Controller\Account\CreatePost" the problem is in below section:-**

Any update please?it's urgent so please help me to resolve this issue.


texts: Magento 2: Is there a way to add a child block when the parent isn't defined in a layout?

texts:
Using 2.1.3, I am loading admin tab content by calling a block directly in the Tabs.php file:

protected function _beforeToHtml()
{
    $blockClass = "MyNamespace\MyModule\Block\Adminhtml\Section\Edit\Tabs\BlockClassName";
    $this->addTab(
       'tab_title',
        [
            'label' => __('Tab Label'),
            'title' => __('Tab Title'),
            'content' => $this->getLayout()->createBlock($blockClass)->toHtml(),
            'active' => true
        ]
    );
}

Within the template phtml file I've set in the BlockClassName.php file, I'd like to use $block->getChildHtml('child_block_name').

I've tried using the addChild (per Adding a Child Block Programmatically) to the BlockClassName::_construct(), but am getting an error:

vendor/magento/framework/Data/Structure.php(603): Magento\Framework\Data\Structure->_assertElementExists(NULL);

Where it looks like the vendor/magento/framework/View/Element/AbstractBlock::setChild() is trying to pass in the block's layout name (line 380) - do I need to define the block in a layout in order to add a child block?


texts: Moving two-store Magento to another server causes secondary site to show

texts:
Our company is moving it's in-development websites over to a new server on Rackspace using Ubuntu 12.04 LTS and NGINX. The transitions went smooth except for one particular Magento site.

This Magento client's site was previously developed (not by us) with a two store front (same Magento install): first store with a Wordpress integration and the other secondary Magento store alone. The client came to us to separate and take down the first store leaving the Worpress as one website and the other as the the main Magento store (from the secondary store).

In the original development server before we migrated, I was able to successfully accomplish this and both websites functioned on their own as expected. However, after the migration of this Magento site (both database and files), the Magento site loads with the 1st original store (store 1) and not with store 2 as the main store, even though store 2 was set was default in the Manage Stores configuration settings.

The store two was set a 'default' in the configuration.
Files, folders, and databases are exactly the same
Subdomains and domain names are exactly the same
Cache was cleared

Key Differences on the servers

Original Test Server

OS:     CentOS release 5.10 (Final) 64 bit
Apache: Apache/2.2.22 (Unix)

New Test Server

OS:     Ubuntu 12.04.4 LTS 64 bit
NGINX:  nginx/1.1.19

Why would the exact same Magento website load the correct store (store 2) but load the incorrect store (store 1) on a different server?


texts:
I was trying to take media backup of my magento website from the server and deploying on my localhost machine but in the catalog page product image is not showing the path for media is taking from the below url

http://127.0.0.1/Storemediaall/media/C:/wamp64/www/Storemediaall/media/product/aab/advantagec05.jpg

i have done with the web cofig /media path but still it is not showing, can any one please help in this


texts: Storeview not showing in 'Design->Configuration'

texts:
I have created another store view for French and change the default one to English. Now when I see it works on frontend, but French store view takes a lot of time to load and also theme is changed to default Luma theme. While for English store view its fine.

When I checked 'Design->Configuration', I didn't find 'French' store view in the list, while English is there.

Any suggestion why it is not listed?


texts: In Magento2.3.2 :Mail send settings :- Is it work through localhost or Not?

texts:
In Magento2.3.2 :Mail send settings :-what are the possible ways for mail-send(like need for order,shipping,delivery).

I check store->configuration->Advance->system->mail sending settings...

I need to know about That configuration like Host :'localhost' Port:'25'

Is it work through localhost or Not?

Any other solution for mail sending In magento2.3.2


texts: Updating customer group from observer on customer_register_success event?

texts: I want to set a customer group as first time user for that I am using an observer so that I can update the customer group just after or on the same time of registration.


texts: Download Magento 2.0.2 with direct download link

texts:
I need to download  Magento 2.0.2  with a direct  download link, in the website you can download in this page but the link genereted is dynamic. So for example I like DownThemAll tool to download  but it doesn't work. I  see this question How to download magento but this solution is for version 1.9.0.1 , in fact for me this  solution don't work.

Context: My connection is very slow and it usually crashes and I cannot resume the download

Any idea or advice?


texts: How add Contact Form in Magento CMS Page/Block

texts:
I use fishpig wordpress integration with addons contact form 7

documentation say this

To do this, you can make use of the Widget block (code below).

<reference name="content">
    <block type="wp_addon_cf7/widget" name="cf7.test.form">
        <action method="setFormId"><form_id>4</form_id></action>
    </block>
</reference>

To use the above code, simply change the number 4 for the ID of your form.

To display a form using PHP instead of XML, see the code below.

<?php $layout = Mage::getSingleton('core/layout') ?>
<?php $formBlock = $layout->createBlock('wp_addon_cf7/widget') ?>
<?php $formBlock->setFormId(4) ?>
<?php echo $formBlock->toHtml() ?>

did anyone succeed us?


texts: Magento 2.1 - Creating a download link to files of a downloadable product

texts:
as the title suggests. I would like to create a download link to the uploaded file on a downloadable product.

I already have access to the downloadable product and call call the getLinkFile() that returns something like "a/b/file_name.pdf". However I am stuck on creating a link that will allow the customer to download the file.

All downloadables do not have price and customers do not need to purchase them. I am just looking at a way to provide these files (we are using downloadables due to another reason and require these links as a work around).

If you need anymore info I am happy to provide. Thank you for any help.


texts: setup:di:compile VS rm -f var/generation

texts:
When we work in di.xml file for extend the functionality then we need to
php bin/magento setup:di:compile
setup:di:compile take 30 to 40 second or long in window.
if we remove the generation folder/files then it equal to run setup:di:compile or not ? kindly clear it because i read this in Magento 2 Book.
if rm -f var/generation then it save time.
I think it necessary to know for all beginner like me


texts: deny direct access to magento image folders

texts:
I know that this could lead to some issues with google and other search engine, anyway is it possible in your knowledge to deny direct access for image folders to browsers?
Currently I'm rebuilding my website using magento 1.9.0.1 using a custom template and I was thinking about adding some more security to avoid an easy stealing of contents and images.
I've read that using the .htaccess and the URL Rewrite engine is of no use :

  http://www.solvingmagento.com/magento-url-rewrites/

Limitations of URL rewrites

The most commom oversight with URL rewrites is an attempt to use them for static files. This simply will not work. When a request for a static file is processed, the Magento rewrite engine is not even engaged. So it is defined by the rules in the .htaccess file: if a requested file or directory exists on the server – return it directly. Magento URL rewriting requires that the request is first routed to the index.php file, which starts Magento and prodives access to its functionality including URL rewrites. Therefore, creating URL rewrites for static files, i.e. catalog images and other content of the media folder, CSS and JS files, would have no effect.

My goal would be to let browser show product image only if the images are requested whithin the product page, so if someone tries to "right-click"+"open image in new tab" should be redirected to a 403 custom page.
I know that it will not solve the problem (a print-screen and a good image software will do the trick) but I will make life harder to those who tries.
what do you think about it? is it possible or it doesn't worth the pain?


texts: Use of Imagesloaded plugin in the RWD theme

texts:
If you look at the layout file page.xml of the RWD theme you will find a declaration like:

<action method="addItem"><type>skin_js</type><name>js/lib/imagesloaded.js</name></action>

Now, I am fully aware of what this plugin does but I am unable to see where magento makes use of this plugin specifically.

Bizarrely, removing the plugin causes no errors or breakages. So, I was wondering if someone could kindly explain where magento makes use of this plugin?


texts:
I need to import customers from the other shop system (oxid e CE) to Magento 1.9.
The best result would be reusing their password, so the customers can log in with their existing data into the new shop.

As far as I know, oxid uses md5 hash plus salt for encryption.
Is it possible to use these both fields to generate a md5 hash that Magento can use?

If not possible, I would try to display a message on login attempt for the imported customers that they will receive a mail with a link to reset their password. What would be the best approach for this method?

I think something like to pre-dispatch the login event and to check if this customer is one of the imported and has not reset his password.


texts: Visibility altering functionality of wishlist

texts:
When a product, such as those that are children of configurable products, have their visibility attribute set to 'Not Visible Individually' they can be added to the wishlist, however, when another product is added (or the same product is added again) this item is automatically removed from the wishlist.

Anyone with more experience care to ellucidate my understanding as to why this is happening or recommend a workaround?  When the product's visibility is changed this functionality goes away and this item can be added to the wishlist without a problem.


texts:
I have a third-party module with a file I want to override so I don't loss my changes when upgrading the third-party extension.

  Vendor\Module\Plugin\Quote\UpdateItem.php

namespace Vendor\Module\Plugin\Quote;

use Vendor\Module\Model\Product\Type\GiftCard;

class UpdateItem {

    /**
     * @var \Magento\Catalog\Model\ProductRepository
     */
    private $productRepository;

    public function __construct(\Magento\Catalog\Model\ProductRepository $productRepository)
    {
        $this->productRepository = $productRepository;
    }

    /**
     * save
     *
     * @param \Magento\Quote\Model\Quote $subject
     * @param callable $proceed
     * @param int $itemId
     * @param \Magento\Framework\DataObject $buyRequest
     * @param null|array|\Magento\Framework\DataObject $params
     * @return \Magento\Quote\Model\Quote\Item
     */
    public function aroundUpdateItem($subject, callable $proceed, $item, $buyRequest, $params = null)
    {
        // some code

        return $proceed($itemId, $buyRequest, $params = null);
    }
}

  Vendor\Module\etc\di.xml

<type name="Magento\Quote\Model\Quote">
    <plugin name="Vendor_Module::UpdateItem" type="Vendor\Module\Plugin\Quote\UpdateItem"/>
</type>

I tried to add this file to my theme but it doesn't override the third-party file:

  \app\design\frontend\Mytheme\custom\Vendor_Module\Plugin\Quote\UpdateItem.php

UPDATE

Vendor\Module and Vendor_Module is the third-party module name. So above code is the code I want to override.

UPDATE 2

The accepted answer got me on the right track. I did the following:

Myvendor\Mymodule and Myvendor_Mymodule is a custom module I created.

Myvendor\Mymodule\etc\di.xml

<type name="Magento\Quote\Model\Quote">
    <plugin name="Vendor_Module::UpdateItem" type="Vendor\Module\Plugin\Quote\UpdateItem" disabled="true" />
</type>
<type name="Magento\Quote\Model\Quote">
    <plugin name="Myvendor_Mymodule::UpdateItem" type="Myvendor\Mymodule\Plugin\Quote\UpdateItem"/>
</type>

  Myvendor\Mymodule\Plugin\Quote\UpdateItem.php

namespace Myvendor\Mymodule\Plugin\Quote;

use Vendor\Module\Model\Product\Type\GiftCard;

class UpdateItem {

    /**
     * @var \Magento\Catalog\Model\ProductRepository
     */
    private $productRepository;

    public function __construct(\Magento\Catalog\Model\ProductRepository $productRepository)
    {
        $this->productRepository = $productRepository;
    }

    /**
     * save
     *
     * @param \Magento\Quote\Model\Quote $subject
     * @param callable $proceed
     * @param int $itemId
     * @param \Magento\Framework\DataObject $buyRequest
     * @param null|array|\Magento\Framework\DataObject $params
     * @return \Magento\Quote\Model\Quote\Item
     */
    public function aroundUpdateItem($subject, callable $proceed, $item, $buyRequest, $params = null)
    {
        // some code

        return $proceed($itemId, $buyRequest, $params = null);
    }
}


texts:
I've upgraded my Magento installation from ~1.4 to 1.8 and am having trouble with a package that I am using called Mage Quotes. I had to manually install the files and am getting the following error afterwards:

  Fatal error: Class 'Mage_Quotes_Helper_Data' not found in app/Mage.php on line 547

I've found the code referencing the helper like this:

Mage::helper('quotes')->

I have a \app\code\local\Mage\Quotes\Helper\Data.php file:

class Mage_Quotes_Helper_Data extends Mage_Core_Helper_Abstract
{
   ...
}

Here is my config.xml file:

<config>
<modules>
    <Mage_Quotes>
        <version>0.8.0</version>
    </Mage_Quotes>
</modules>
<frontend>
    <routers>
        <quotes>
            <use>standard</use>
            <args>
                <module>Mage_Quotes</module>
                <frontName>inquire.html</frontName>
            </args>
        </quotes>
    </routers>
    <translate>
        <modules>
            <Mage_Quotes>
                <files>
                    <default>Mage_Quotes.csv</default>
                </files>
            </Mage_Quotes>
        </modules>
    </translate>
    <layout>
        <updates>
            <quote>
                <file>quotes.xml</file>
            </quote>
        </updates>
    </layout>
</frontend>
<global>
    <resources>
        <quotes_setup>
            <setup>
                <module>Mage_Quotes</module>
            </setup>
            <connection>
                <use>core_setup</use>
            </connection>
        </quotes_setup>
    </resources>
    <template>
        <email>
            <quotes_email_email_template translate="label" module="quotes">
                <label>Inquire Form</label>
                <file>quote_form.html</file>
                <type>text</type>
            </quotes_email_email_template>
        </email>
    </template>
</global>

<adminhtml>
    <translate>
        <modules>
            <Mage_Quotes>
                <files>
                    <default>Mage_Quotes.csv</default>
                </files>
            </Mage_Quotes>
        </modules>
    </translate>
    <acl>
        <resources>
            <admin>
                <children>
                    <system>
                        <children>
                            <config>
                                <children>
                                    <quotes>
                                        <title>Quotes Section</title>
                                    </quotes>
                                </children>
                            </config>
                        </children>
                    </system>
                </children>
            </admin>
        </resources>
    </acl>
</adminhtml>

<default>
    <quotes>
        <quotes>
            <enabled>1</enabled>
        </quotes>
        <email>
            <recipient_email><![CDATA[hello@example.com]]></recipient_email>
            <sender_email_identity>custom2</sender_email_identity>
            <email_template>quotes_email_email_template</email_template>
        </email>
    </quotes>
</default>

I've looked at solutions for similar questions and tried them, but haven't been able to resolve the issue.

All caching is disabled and after I make any change to a file I am manually deleting the /var/cache folder before refreshing the page.

Any help is appreciated.


texts: Nice way to inject the main block to a viewmodel

texts:
We want to follow the best practice to add additional functionality to a block template without "rewriting" (i.e. a DI preference) the block.

Is there a nice way to inject the main block (which methods we need to access) to a view model ?

We were thinking about the following code inside of the template:

<?php
    $block->getViewModel()->setBlock($block);
?>

But is that the right way to do it?


texts: Magento : Show Categories on Left When I am on Sub-Category

texts:
I'm new in magento 1.9

I need to showing categories in sub category page under layered navigation. I searched in internet but I can't find exact solution.  Can anyone pls help me.


texts: Magento 2 high CPU usage after entering production mode

texts:
We've been running a Magento 1 site for over 7 years and although cpu usage has been quite high, it's not been a concern as performance seemed fine even, it is a high traffic site after all.
Preparing to move over to Magento 2 we installed the latest version (2.3 at the time) and ran it in developer mode along with the M1 site with no hit on server performance.
Now we've finally switched fully to M2 and enabled production mode, wow, cpu usage has gone off the chart
https://imgur.com/a/F5w5P7a
I've followed a few suggestions on here regarding enabling caches etc and nothing improves. Thinking M2 would be a much more stable and 'optimised' system, we're not impressed at the moment!
Any suggestions would be very welcome. It's a single server, 16GB ram, 6 Core, Apache/PHP 7.2/MYSQL.


texts: Sales promotion not removed when required items removed

texts: We have an issue with our site where if you add items in a promotion (eg. buy x and y and get z% off y), then remove one of the items (x) you still get the discount (on y). I'm a bit of a self taught noob when it comes to magento and PHP so I don't even know where I would look, does anyone have any ideas?


texts: How to know if my Magento 2 is in developer mode via PHP?

texts:
I'm using Magento 2.4 to develop a new module and I need to check if the store is running in developer mode or production mode.
How could I get the Magento Mode via PHP?


texts: Efficient way to get product URL and image

texts:
While building an addition to a Magento webshop, I stumbled upon a couple of problems. In my pursuit to create code which is as fast as possible, I found myself unable to figure out two things.

My (relevant) code is the following:

$rc = Mage::getResourceSingleton('catalog/product');
$productName = $rc->getAttributeRawValue($productId, 'name', Mage::app()->getStore());
$productPrice = $rc->getAttributeRawValue($productId, 'price', Mage::app()->getStore());
$productImage = $rc->getAttributeRawValue($productId, 'image', Mage::app()->getStore());
$productUrl = $rc->getAttributeRawValue($productId, 'url_key', Mage::app()->getStore());

The two things I can't figure out are:

1) How do I retrieve the product URL? url_key doesn't always give the right URL, since not all webshops use canonical URL's, or have the category in the URL.

2) How can I get the product image with a set width/height, instead of the full image? The ->resize() function does not function in this case I recon (since it returns an URL). Added to that, is it possible to get the Base Image, Small Image and Thumbnail separately?

My main goal is to keep the code as fast as possible.
I only have a product id, since I loop through the children of a product. I do not wish to use ->load() since that takes way more loading time.


texts: Magento 2 : get product custom option base on sku

texts:
I am working on magento2 and i am try to access product all custom option. For now i have added to text box and for access custom option bellow code i have use.

        $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
        $product = $objectManager->get('Magento\Catalog\Model\Product')->load(1001);
        $productOption = $product->getOptions();
        foreach($productOption as $op)
        {
            echo "<pre>";
            print_r($op);
            die;
        }


texts: Error filtering template: The entity that was requested doesn't exist. Verify the entity and try again

texts:
I am trying to fetch the order details
$order = $objectManager->create('\Magento\Sales\Model\OrderRepository')->get($orderId);
Order id is correct 000000020. In var log main.CRITICAL: The entity that was requested doesn't exist. Verify the entity and try again at vendor/magento/module-sales/Model/OrderRepository.php:139
This is working fine for some order but for some, the above errors show. I am unable to locate what is the problem in actual. I did deploy indexing everything. Magento version is 2.3.4


texts: How to display review image on review gird in adminhtml?

texts:
I add a review_images in review_detail,and I can add images form product page.
And now I want to display review images in All Reviews list in admin.

        public function getReviewImages($reviewId){
        $collection = Mage::getModel('review/review')
                        ->getCollection()
                        ->addFieldToFilter('main_table.review_id',$reviewId);
        $collection->getSelect()->columns('review_images','detail');

        if($collection->getSize()>0){
            $review =  $collection->getFirstItem();
            if($review->getReviewImages()!=''){
                return $review->getReviewImages();
            }
        }

        return false;

    }

But how can I display review images on review list?


texts:
I have magento on server , I'm trying to access its of REST api in my local. But I find an error "Failed to connect  port 443: Timed out".
here is my code

        $userData = array("username" => "admin", "password" => "admin123");

        $ch = curl_init();
        curl_setopt($ch, CURLOPT_URL, "https://mymagentocom/rest/V1/integration/admin/token");
        curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
        curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($userData));
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
        curl_setopt($ch, CURLOPT_HTTPHEADER, array("Content-Type: application/json", "Content-Lenght: " . strlen(json_encode($userData))));
        curl_exec($ch);


texts: Magento 2: import special price for configurable products from M1

texts:
In Magento 1 the special prices were added to configurable products. In Magento 2 the special prices are set for simple products associated with the main configurable product.

Is there an easy way to export special prices from M1 shop's configurable products and then import the special prices for the correct simple products?


texts: Error HTTP500 when trying to show all product on product list

texts:
I have a problem with magento 2.4.0.
When i'm trying to display all products in products grid, system shows me HTTP 500 ERROR

Error shows when I select All
UPDATE
The same error is When I try trying search only selected products.
In var/log/nginx
 2894781#2894781: *824530 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Allowed memory size of 2147483648 bytes exhausted (tried to allocate 48238592 bytes) in /var/www/html/mystore/vendor/magento/framework/Serialize/Serializer/Json.php on line 24" while reading response header from upstream, client: 185.28.212.123, server: mystore.com, request: "GET /catalogsearch/result/?q=Ramiz+edukacyjna+skarbonka+-+bankomat+na+polskie+nomina%C5%82y+dla+dzieci HTTP/1.1", upstream: "fastcgi://unix:/run/php/php7.4-fpm.sock:", host: "mystore.com", referrer: "https://mystore.com/catalogsearch/result/?q=ramiz"
In php.ini i set up memory_limit on 4G
Something usage a lot of memory but i don't know what?
We added about 40 new products with a lot of configurations (variants) and name is "Raimz ..." . Do you think this caused this problem?
Before change index in ElasticSearch, after type keyword "Ramiz" website return error 500, when i execute command bin/magento indexer:reindex website is temporary working, but error coming back after a few querries in search .
When I change Index in ElasticSearch, after type keyword "Ramiz" is displayed notice "Not found items"
After changing index in elasticsearch I executed command bin/magento indexer:reindex
Do you have any ideas?


texts: How do I create a different customer account for each page?

texts: I am very new to magento and I am creating a new site, but I want the login design to be different for each site on my website


texts:
I have created a user . I give a user role and give resources to add recipies . it is working for admin user . but it is not working for non admins . screenshots will help you understand my question.

and for non admin users .

<?xml version="1.0"?>
<!--
/**
 * Copyright © 2018 Mageside. All rights reserved.
 * See MS-LICENSE.txt for license details.
 */
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Acl/etc/acl.xsd">
    <acl>
        <resources>
            <resource id="Magento_Backend::admin">
                <resource id="Magento_Backend::content">
                    <resource id="Mageside_Recipe::mageside_recipe_manage" title="Mageside Recipes Manage"/>
                </resource>
                <resource id="Magento_Backend::stores">
                    <resource id="Magento_Backend::stores_settings">
                        <resource id="Magento_Config::config">
                            <resource id="Mageside_Recipe::config_mageside_recipe" title="Mageside Recipes Config" />
                        </resource>
                    </resource>
                </resource>
            </resource>
        </resources>
    </acl>
</config>

menu.xml is

    <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Backend:etc/menu.xsd">
<!--
/**
 * Copyright © 2018 Mageside. All rights reserved.
 * See MS-LICENSE.txt for license details.
 */
-->
    <menu>
        <add id="Mageside_Recipe::recipe"
             title="Recipes"
             translate="title"
             module="Mageside_Recipe"
             sortOrder="50"
             parent="Magento_Backend::content"
             dependsOnModule="Mageside_Recipe"
             resource="Mageside_Recipe::mageside_recipe_manage"/>
        <add id="Mageside_Recipe::recipe_menu"
             title="Manage Recipes"
             translate="title"
             module="Mageside_Recipe"
             sortOrder="55"
             resource="Mageside_Recipe::mageside_recipe_manage"
             parent="Mageside_Recipe::recipe"
             action="recipe/recipe/manage"/>
        <add id="Mageside_Recipe::recipe_menu_filter"
             title="Recipe Filters"
             translate="title"
             module="Mageside_Recipe"
             sortOrder="60"
             resource="Mageside_Recipe::mageside_recipe_manage"
             parent="Mageside_Recipe::recipe"
             action="recipe/recipe/filter"/>
        <add id="Mageside_Recipe::recipe_menu_reviews"
             title="Recipe Reviews"
             translate="title"
             module="Mageside_Recipe"
             sortOrder="70"
             resource="Mageside_Recipe::mageside_recipe_manage"
             parent="Mageside_Recipe::recipe"
             action="recipe/reviews/manage"/>
    </menu>
</config>


texts:
How much is the feasibility for building/developing eLearning Store on Magento CE(1.8+)?

The store would contains products(online test for BANK, Engineering and other competative examination), on purchasing the user will be sent a link to there registered mail regarding the platform on which the online test would be conducted.

What is the best practice for defining the eLearning products w.r.t Magento??


texts:
I can execute a shell script from a custom php script. I have no trouble including the abstract.php, log a string or calling let's say the product model. Playing around with including parameters from the php script to the shell script is no problem either.

But when it comes to calling a custom helper-function like this:

Mage::helper('customModuleName/helperName')->methodName()

and var_dump() the result (or whatever function you like) I get nothing. I've called the helper function a dozen times in other scripts. It seems that the helper function cannot be executed in a shell script. Whatever helper method for that matter. I tried to call other helpers too.

Is my deduction a valid one or do I miss the knowledge of execution a shell script? In other words: is it possible to execute a custom helper function in a shell script?

EDIT :

thanks in advance for all your replies!

here's my code

<?php

require_once 'abstract.php';

class Santee_Shell_Upload extends Mage_Shell_Abstract {

    public function run() {
        global $argv;
        Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);
        $path = $argv[1];

        $dir = Mage::getBaseDir() . "/shell/";
        MAGE::helper('updateproducts/runupdate')->unSetIndex();
        $objects = MAGE::helper('updateproducts/runupdate')->getAllObjects($path);

        MAGE::helper('updateproducts/runupdate')->startUpdate($objects);
        MAGE::helper('updateproducts/runupdate')->setIndex();
        $command = 'php -f ' . $dir . 'indexer.php reindexall';
        $result = shell_exec($command);
    }

    public function usageHelp() {
        return <<<USAGE
Usage:  php -f upload.php -- [options]
        php -f upload.php

USAGE;
    }

}

$shell = new Santee_Shell_Upload();
$shell->run();


texts:
I have a function that retrieves a visiting user's country name by doing an ip lookup.  I currently have this function running through the execute method in my module's controller.  The problem is that I need this to run on every page and not just the single controller page.

Since every controller is tied to a particular action I am not sure if keeping it in a controller is the correct solution, nor do I know how to run my controller on every page request.

Does anybody know how to do this?


texts: Magento 2 : How to show add to cart button in out of stock?

texts:
I want to show add to cart button block in my list.phtml even a product is out of stock.
I do not want to enable back orders too.

How can i do this?

OR

May i know from which file checking the stock status and hide the add cart block?

Posting what i tried is no point here to drag the question.So i did not post it.I just want to get an idea to implement this.

Thanks


texts: Changes to theme not being represented in browser

texts:
I am currently working on a Magento store.
There is a 3rd party price tag that shows when viewing a product.
The original price is sometimes displayed as plain text next to the image of the product.  When this is the case the 3rd party price tag works fine.  However, sometimes the plain text original price isn't there, instead the price is in a different element, overlapping the "add to cart" button.
When the latter is the case, the 3rd party price tag wont appear (presumably because it can't find a price to display).
I am currently trying to modify the stores theme so that it will check for the presence of the text price tag and if it is not there then instead use the price from the button.
In doing this I'm stuck, it seems non of the changes I make to the theme are showing up when I reload the page.  I've checked to make sure I'm modifying the right theme.
Even just adding a simple div or text block, I'm looking seeing anything come through on the live site.
The data I'm editing is in: app/design/frontend/efv1/default/template
Efv1 is confirmed as the currently active theme.
With normal price tag -
[1]: https://i.stack.imgur.com/VDdXR.png
With normal price tag missing -
[2]: https://i.stack.imgur.com/TgFZx.png


texts: recently viewed products not showing for guest users

texts:
Recently viewed products not showing for guest users. but its working fine for loggedin users. How to show Recently viewed products for guest users? Where to customize the code?

I am displaying recently viewed product in home page and product details page.

(edit from OP):

phtml code :

if (($_products = $this->getRecentlyViewedProducts()) && $_products->getSize()):
    $i=0;
    foreach ($_products->getItems() as $_product):
        echo 'getProductUrl().'" title="'. $this->htmlEscape($_product->getName()).'">';
        echo ''.$_product->getName().'';
        echo ''. Mage::helper('core')->currency($_product->getFinalPrice(),true,false).'';
        echo '';
    endforeach;
endif;


texts: Magento 2 miss label Street address in company form

texts:
Please help me fix the issue label Street address miss in the backend. I see that have the div class "admin__field-label" duplicate above

This is the class delicate


texts:
How to join the three tables eav_attribute, catalog_eav_attribute, eav_attribute_label using attribute_id in magento 2.

I am using the below query, But no get proper answer.
I have created the export script to export attribute and its options using below code.

 $resource = $objectManager->get('Magento\Framework\App\ResourceConnection');

    $connection = $resource->getConnection('core_read');
    $select_attribs = $connection->select()
            ->from(array('ea' => $resource->getTableName('eav_attribute')))
            ->join(array('c_ea' => $resource->getTableName('catalog_eav_attribute')), 'ea.attribute_id = c_ea.attribute_id');
    $select_prod_attribs = $select_attribs->where('(ea.entity_type_id = ' . $ent_type_id . ')AND (ea.is_user_defined = 1)')
            ->order('ea.attribute_id ASC');
    $product_attributes = $connection->fetchAll($select_prod_attribs);
    $select_attrib_option = $select_attribs
            ->join(array('e_ao' => $resource->getTableName('eav_attribute_option'), array('option_id')), 'c_ea.attribute_id = e_ao.attribute_id')
            ->join(array('e_aov' => $resource->getTableName('eav_attribute_option_value'), array('value')), 'e_ao.option_id = e_aov.option_id and store_id = 0')
            ->order('e_ao.attribute_id ASC');
    echo $select_attrib_option;
    exit;
    $product_attribute_options = $connection->fetchAll($select_attrib_option);

It gives final query like this and works great

SELECT ea., c_ea., e_ao., e_aov. FROM eav_attribute AS ea
 INNER JOIN catalog_eav_attribute AS c_ea ON ea.attribute_id = c_ea.attribute_id
 INNER JOIN eav_attribute_option AS e_ao ON c_ea.attribute_id = e_ao.attribute_id
 INNER JOIN eav_attribute_option_value AS e_aov ON e_ao.option_id = e_aov.option_id and store_id = 0 WHERE ((ea.entity_type_id = 4)AND (ea.is_user_defined = 1)) ORDER BY ea.attribute_id ASC, e_ao.attribute_id ASC;

But After that, I also need Main Attribute Description, So I wish to join another table eav_attribute_label using attribute id So I have changed my code like below

$resource = $objectManager->get('Magento\Framework\App\ResourceConnection');

    $connection = $resource->getConnection('core_read');
    $select_attribs = $connection->select()
    ->from(array('ea' => $resource->getTableName('eav_attribute')))
    ->join(array('ea_l' => $resource->getTableName('eav_attribute_label')), 'ea.attribute_id = ea_l.attribute_id')
             //Added another table
    ->join(array('c_ea' => $resource->getTableName('catalog_eav_attribute')), 'ea.attribute_id = c_ea.attribute_id');

    $select_prod_attribs = $select_attribs->where('(ea.entity_type_id = ' . $ent_type_id . ')AND (ea.is_user_defined = 1)')
            ->order('ea.attribute_id ASC');
    $product_attributes = $connection->fetchAll($select_prod_attribs);
    $select_attrib_option = $select_attribs
            ->join(array('e_ao' => $resource->getTableName('eav_attribute_option'), array('option_id')), 'c_ea.attribute_id = e_ao.attribute_id')
            ->join(array('e_aov' => $resource->getTableName('eav_attribute_option_value'), array('value')), 'e_ao.option_id = e_aov.option_id and store_id = 0')
            ->order('e_ao.attribute_id ASC');
    echo $select_attrib_option;
    exit;
    $product_attribute_options = $connection->fetchAll($select_attrib_option);

But it throws error like below

Uncaught PDOException: SQLSTATE[23000]: Integrity constraint violation: 1052 Column 'store_id' in on clause is ambiguous


texts: Products and their prices should be shown area wise

texts:
I want to add product price depending on the customers pin code in magento 2.1.x. Kindly help.

Products (simple/configurable) and their prices should be shown area wise (pin code)


texts: how to disable the innodb_force_recovery option in magento

texts:
i am gettting the error as in this link :

https://magento.stackexchange.com/questions/72116/magento-site-sqlstatehy000-general-error-1030-got-error-28-from-storage-engi#72116

so i got some solution here :

https://stackoverflow.com/questions/16002461/magento-site-down-due-to-mysql-error-general-error-1030-got-error-1-from-stora

i want to know how to disable the innodb_force_recovery option as mentioned in the link

please help me to find solution

thanks in advance.


texts: ElasticSearch 6 on 2.2.8 - Notice: Undefined index: magento2_product_1_v1

texts:
When attepting to index Catalog Search Fulltext I get the following error:

Notice: Undefined index: magento2_product_1_v1 in /app/vendor/magento/module-elasticsearch-6/Model/Client/Elasticsearch.php on line 168

If I drop the ElasticSearch "magento2" prefix in the Magento admin config, I gut an "Unkown Error: null" exception from ElasticSearch.

On the frontend I am seeing:

{"error":{"root_cause":[],"type":"search_phase_execution_exception","reason":"all shards failed","phase":"query","grouped":true,"failed_shards":[]},"status":503}

I'm not sure where to begin troubleshooting this. I'm happy to provide more info to anyone willing to guide me here.


texts: Changing/adding class to registration form layout

texts:
I have been asked by a marketing rep to try to reduce the size of the title area on the registration form due to a detected problem on some browsers where the theme's modal version won't properly scroll. Basically, we want to shrink down the content or move up the form fields somewhat so it will fit on most standard browsers.

The problem is that the items at the top of the registration form don't lay in a single template but are built in a number of places in the code. (including a social-login plugin). One of the items is using a global 'page-title' and 'page-title-wrapper' class that is shared on multiple content pages throughout the site. (so any changes I make to that class effect more than just the registration form - I don't seem to see anything unique enough on the whole page to confine a contextual-css modification)

The layout file for customer_account_create.xml appears to already be over-ridden in our theme for the social login to work (but doesn't include anything overriding the title details).

What I want to know is if there is any way I can use the layout file for customer_account_create.xml to create something I can contextually reference in the CSS so I can change some of the top/bottom margins and borders as well as some of the font sizes in that title area for just this page.

e.g. the HTML in the area I want to modify on just this page looks like:

            Sign Up for a New Customer Account

the styles in the theme include some vertical white space (site-wide) in things like the page-title-wrapper and page-title class, but there don't appear to be any 'registration' specific tags/styles/titles surrounding this envelope.

(elements browser in chrome shows "html body div #zoo-main-content div div.page-title-wrapper h1.page-title" for example)

SW


texts: How to set condtion in shopping cart to apply discount only for product between two price ranges

texts: I need a condition in magento shopping cart price rules where we can set discount for products  between two price ranges . For example: I need to apply discount for product that are in between $100 and $200


texts: Set the default image zoom for full screen in magento 2.x

texts:
I have found the magnify settings in view.xml which allow me to turn off and on the full screen mode. I have also used the fullscreenzoom integer to reduce the steps to zooming in fully, however....

Our product images when zoomed in are 2000px tall. When somebody clicks the full screen button we want it to load up with the full size of the image zoomed in 100% with no option to zoom in and out, just the option to move around the image. I cannot seem to find a setting for selecting the default level of zoom.

It is annoying for the image to come up small then have to click the + symbol a few times, then when swiping to the next image having to zoom again.

Does anyone know a way for the full screen zoom to just be 100% with no + / - symbols.

Thanks,
Glynn


texts: How to add customer custom attribute data after customer creation in observer

texts:
I am doing something like this, but its saving custom attributes for the customer.

$customerInfo = $this->customerRepository->getById($customer->getId());
$customerInfo->setCustomAttribute('username1',$parameters['lsr_username']);
$customerInfo->setCustomAttribute('password',$parameters['password']);
$this->customerRepository->save($customerInfo));


texts: Magento2.3 files permissions inside docker container (ubuntu)

texts:
i am beginner in Magento 2.3, and i encountred an issue when i tried to enable my first custom module:
     bin/magento module:enable Mageplaza_HelloWorld

I'm using docker apache container to run my Magento 2 and ubuto for OS, Can you please let me know how to change permissions inside docker apache containerThis is my issue in the image below:


texts:
In admin page, I turned on the mode Manage Stock to Yes. After reindex, when I go to product list page, it got an error like this:

I go to var/log to check what happened, and saw this line:

Can't check requested quantity for products without Source Items
support

After search many post in here, I have to temporary fix by delete record in table ui_bookmarks. But it just for a moment, it will be error again later.
How I can fix this?
Thank you!


texts: Magento2: stuck install on 694/1390 Installing user configuration

texts:
stuck install on 694/1390 Installing user configuration

I checked log:
2021-03-14 11:38:53] main.ERROR: Unable to proceed: the maintenance mode is enabled.  [] []
[2021-03-14 11:50:24] main.ERROR: This is not implemented, as it is not possible to implement Argon2i with acceptable performance in pure-PHP
#0 /home/fsgroup/domains/domain.pl/public_html/vendor/paragonie/sodium_compat/lib/php72compat.php(752): ParagonIE_Sodium_Compat::crypto_pwhash(32, 'password', '8Xp3Q1vUOrJrPoV...', 4, 33554432, 2)
#1 /home/fsgroup/domains/domain.pl/public_html/vendor/magento/framework/Encryption/Encryptor.php(594): sodium_crypto_pwhash(32, 'password', '8Xp3Q1vUOrJrPoV...', 4, 33554432, 2)
#2 /home/fsgroup/domains/domain/public_html/vendor/magento/framework/Encryption/Encryptor.php(225): Magento\Framework\Encryption\Encryptor->getArgonHash('password', 32, 4, 33554432, '8Xp3Q1vUOrJrPoV...')
#3 /home/fsgroup/domains/domain.pl/public_html/setup/src/Magento/Setup/Model/AdminAccount.php(71): Magento\Framework\Encryption\Encryptor->getHash('password', '8Xp3Q1vUOrJrPoV...')
#4 /home/fsgroup/domains/domain.pl/public_html/setup/src/Magento/Setup/Model/AdminAccount.php(97): Magento\Setup\Model\AdminAccount->generatePassword()
#5 /home/fsgroup/domains/domain.pl/public_html/setup/src/Magento/Setup/Model/AdminAccount.php(83): Magento\Setup\Model\AdminAccount->saveAdminUser()
#6 /home/fsgroup/domains/domain.pl/public_html/setup/src/Magento/Setup/Model/Installer.php(1287): Magento\Setup\Model\AdminAccount->save()
#7 [internal function]: Magento\Setup\Model\Installer->installAdminUser(Array)


texts: Magento category page white screen- php memory limit

texts:
We have two websites sharing same catalog but different prices. Total catalog size is 10K. Site1 displays products/categories fine. However same category on site2 shows "white Screen of Death". After inspecting server log we get following error

PHP Fatal error:  Allowed memory size of 268435456 bytes exhausted (tried to allocate 130968 bytes)

Php memory limit is set to 512. We also changed to 1024MB but no joy

Surprisingly, when we move catalog folder out of Media, category loads fine with place holder image

If image size is the issue, then I am struggling to understand Why same products/images work fine on site1.
Magento re-size and cache images so using one large size image should not effect.
Both Sites use same template/catalog/product/list.phtml

Please share your experience or dont shy to give advice.

Thanks


texts: XML site map is not generating for Magento 2.2.6

texts:
I have upgrade the Magento version to 2.2.6. Now i want to configure the sitemap for my site.

I have followed the document

but still it showing 404 page not found error..

is it magento 2.2.6 known issue ?


texts: Create a section in the admin panel to upload pictures and get a picture in the template

texts:
I have a place on each side where I need to get the loaded picture by the user from the admin panel.

The admin panel has similar functionality and I want to copy it and display this image in the template that is in the subject.

The finished section is responsible for the logo, Admin-> Design-> Configuration-> Select store end click Edit-> Header-> Add Image

How to implement this, provide an example code or article


texts: Is there a list of most popular CLI commands for Magento 2?

texts: I am looking for a quick, easy reference for the most popular CLI commands and how they are used in Magento 2.


texts: Magento 2 Checkout Page after place order take more time

texts:
Frontend place order first order show in backend and after 4 to 5 min frontend redirect success page.I have remove/disable all third party module and set default theme but not success.And i have use magento 2 default checkout.
Please help what issue is cause.
THANKS.


texts:
I have used below code to get tax class name from id.

$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$taxClassObj = $objectManager->create('Magento\Tax\Model\TaxClass\Source \Product');

$taxid = 2;
echo $taxName =  $taxClassObj->getOptionText($taxid);

This returns the Options text from id that is "Taxable Goods"

How to get the Id from Text?

Can we get Tax class id(value) from the tax class name?

Can anyone look into this and update your thoughts. thanks


texts: How to load a custom .phtml file in left sidebar in page/2columns-left.phtml?

texts:
I'm fairly new to Magento (1) and was wondering how I can add a small template file (containing Clerk search filters) to the top of the left sidebar within the 2columns-left template for a specific page.
I've got it to show up on the correct page, but it just overlaps with everything.

This is the code:

<?xml version="1.0"?>
<layout version="0.1.0">
    <catalogsearch_result_index>
        <reference name="left">
            <block type="core/template" name="filters" output="toHtml" template="clerk/filters.phtml"/>
        </reference>
    </catalogsearch_result_index>
</layout>

This is not a custom block, nor do I think it is necessary to create one (or is it best I do?), just to show the filters. But how can I render this at the top of the left bar, before any other content and make it not overlap with the rest of the content within the left sidebar?

Many thanks