A message from our CEO about the future of Stack Overflow and Stack Exchange. Read now.
2

Try this way: $searchCriteriaBuilder->setFilterGroups([$filterGroup]); $searchCriteria = $searchCriteriaBuilder->create(); $searchCriteria->setPageSize(1) ->setCurrentPage(1); $productList = $this->productRepository->getList($searchCriteria); $item = current($productList->getItems());


2

You can use slightly modified plugin from this answer How to add shipping price for all individual product app/code/MageWorx/ShippingPricePerProduct/etc/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 ...


2

On the product page you can use a customer data in js: require('Magento_Customer/js/customer-data').get('cart')().items This is a preferred way because if you load that items on the backend (php) it will not work with a full page cache.


1

You need to debug this to get where the issue is . Open in your local envoirment vendor/magento/module-backend/App/Action/Plugin/Authentication.php vendor/magento/module-backend/App/AbstractAction.php and add this : $backtrace = []; $debugBackTrace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS); foreach ($debugBackTrace as $item) { $backtrace[] = @$...


1

This is added in Magento 2.3, the Quantity of a product does not decrease when an order is placed. Instead, the quantity remains the same but Salable Quantity gets reduced. The quantity of the product decrease only after shipping is completed. Hope that answers your question.


1

You can run setup:upgrade without updating static content using the --keep-generated flag. Here is full example (for the www-data user and running using default php interpreter on ubuntu): sudo -u www-data php bin/magento setup:upgrade --keep-generated


1

Try to use the ternary operator. $searchResults = $this->sales_rule->getList($searchCriteria); $item = $searchResults->getTotalCount() ? $searchResults->getItems()[0] : false; or you can go shorter way $searchResults = $this->sales_rule->getList($searchCriteria); $item = $searchResults->getItems()[0] ?? false;


1

Until Magento versions 2.2.9 and 2.3.3 Magento did always transliterate the url keys of products, whenever the event catalog_product_save_before was called. The responsible code can be found here (observer) and here (here the transliteration is called). In this commit it has been changed and it only transliterates the url key if it's not null. If you save a ...


1

Case 1: Always shows the address form In order to archive this, you will have to tell Magento to not load the address-list. To do this, you can create a fallback to the Magento_Customer/js/model/address-list.js in your theme and changes its content to: /** * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ /** * ...


1

I highly recommend reading the Magento's docs about the Ui Components here at the Magento Docs. You were trying to put the modal button tab inside Customizable Options section so please check the addCustomModalLink function to understand how to add a custom section. Also this works only with the Magento 2.2 as I know, when the modifiers support for the ...


Only top voted, non community-wiki answers of a minimum length are eligible