Hot answers tagged

4

Magento uses the file called view.xml which is maintained at the theme level of the application. So for example, if you are using the default theme luma you should find the view.xml under vendor/magento/theme-frontend-luma/etc/view.xml In this file, you would see <images/> node inside the node. <view xmlns:xsi="http://www.w3.org/2001/XMLSchema-...


3

As Thorsten said You won't be able to achieve this with Magento's current default functionality. However, I have found the solution to this problem using a third-party extension. This extension allows you to link multiple products with one product and they have a shared inventory. for example:- you can create your configurable product with several child ...


3

By using below function you can delete the custom options values. Here I compared the value title as NULL and delete the custom options values $obj = \Magento\Framework\App\ObjectManager::getInstance(); $productId = 2057; $productRepository = $obj->get('Magento\Catalog\Api\ProductRepositoryInterface'); $this->prodOptionValue = $obj->get('Magento\...


3

I have also face this issue,your error is Duplicate entry 4458-142-1-1293-4458 in your case the attribute id is 142, go to eav_attribute table and check 142 attrbute backend_type and entity_type_id, for example if in 142 id your attribute backend_type is varchar and entity_type_id is catalog_product, then go to the catalog_product_entity_varchar and filter ...


3

Try this code protected $_orderCollectionFactory; protected $orderRepository; public function __construct( ...................................... \Magento\Sales\Model\ResourceModel\Order\CollectionFactory $orderCollectionFactory, \Magento\Sales\Api\OrderRepositoryInterface $orderRepository, ...................................... ) { .......


3

I have solve this issue below debugging steps with final solution :- First i have check what query are pass in collection EX:- <?php $_productCollection = $this->getLoadedProductCollection(); echo $_productCollection->getSelect(); exit ("Hello Mohit Patel"); ?> And in Collection search_tmp_ value and other search_result not found in ...


2

There are 2 possible causes of this error: PHP Max_input_vars value is not optimized for Magento 2 In most cases, we can solve the error by increase the value of PHP Max_input_vars to the value that Magento 2 requires. Open PHP.ini and change these values max_input_time : 3600 max_input_vars : 100000 memory_limit : 2G Base URL on Localhost not regconize by ...


2

I found an easier solution for this: In configurable.js in your element.options you already have the option label without price: As you can see, you just have to use the initialLabel instead of label. So create a mixin as said above: var config = { config: { mixins: { 'Magento_ConfigurableProduct/js/configurable': { '...


2

Since magento 2.2.0 you can use special method for it. For example, we have product with these params: SKU: 24-MB02 Price: 59$ Special price: 20$ One drop-down required option with two values (+5$ and +10$) API Link: http://m206.local:84/index.php/rest//V1/products-render-info?searchCriteria[filter_groups][0][filters][0][field]=sku&searchCriteria[...


2

Can you tell me more about your requirements? Does it really need to be hidden? I'm asking because there can be a better, more UX friendly solution for that. Now I can only say that you are right about FPC (Full Page Cache). You have to use javascript to get user private data. Please look into files from Magento_Catalog module: addtocart.phtml validate-...


2

Got it, please remove after attribute from referenceBlock. You can not use after and before attribute in referenceContainer tag. If you want to use after or before. you can use this on move tag like below. <move element="element name" destination="where you want to move" after="">


2

You can save scope of custom category attribute like this using upgrade schema: <?php namespace Vendor\Custom\Setup; use Magento\Catalog\Model\Category; use Magento\Eav\Model\Entity\Attribute\ScopedAttributeInterface; use Magento\Framework\DB\Adapter\AdapterInterface; use Magento\Framework\Setup\ModuleContextInterface; use Magento\Framework\Setup\...


2

Here's how I solved this problem: Create a new product attribute (e.g. 'catalog_rule_active' type Yes/No) and attach to your attribute set. Make sure you set "Use For Promo Rule Conditions" to Yes in storefront properties. Create a cron job that runs shortly after the default catalogrule_apply_all cronjob (default run time is 1am) or schedule to ...


2

The page title has been set in the controller file for the admin product edit page. You can update the product name using a plugin of the controller function. Create the following files in your module to update the product name. app/code/Vendor/Module/etc/di.xml <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/...


2

This not at all Magento 2 problem. you can use this css to your file and then run static-content:deploy .product.media{ display: block; } By default bootstrap media use display:flex; This is the main problem for not showing the image.


2

Add $this->quote->collectTotals(); before quote save. You need to recalculate totals (including subtotal) after adding product to quote. UPDATE: before collectTotals add $shippingAddress = $quote->getShippingAddress(); $shippingAddress->setCollectShippingRates(true) ->collectShippingRates(); Even if no shipping address is there, it ...


2

Set this below request in your GraphQL : Query Request : query { products(filter: { sku: { eq: "24-MB01" } }) { items { sku canonical_url url_path url_key url_rewrites { url parameters { name ...


2

define(['jquery'], function ($) { 'use strict'; return function (widget) { var updatePrice = $("#wallpaper_attribute").val(); var globalOptions = { productId: null, priceConfig: null, prices: {}, priceTemplate: '<span class="price"><%- data.formatted %>/m²</span>' }; $....


2

There is no native way to display products with visibility 'Not visible individually'. That's the whole point of that visibility option. But you might workaround it and here are some ways to do it: Method A. Create a pre-production/ staging environment and make all changes there and check them before replicating them on production environment. Method B. You ...


2

I think I know what's going on in there :) Your visibility attribute is set as global (in the default Magento installation, it has a store view level scope), so my assumption is that there was a change which said that your attribute has to be global from 'now on', but there are some old records in the database from the time when your attribute was 'store ...


2

The row_id only available in the enterprise edition(Adobe Commerce).There is no rule for row_id and entity_id should be the same or not the same. Most entries have the same row_id and entity_id and some have different enity_id and row_id. So it is not a problem. Magento 2: What is the difference between the row_id and entity_id in the %_entity tables? If you ...


2

Product data builder that sends to Elasticsearch is (vendor/magento/module-elasticsearch/Model/Adapter/BatchDataMapper/ProductDataMapper.php): Magento\Elasticsearch\Model\Adapter\BatchDataMapper\ProductDataMapper Open that class and check the map method. public function map(array $documentData, $storeId, array $context = []) { $documents = []; ...


2

Please add below code in your custom extension. Step 1: Please create file under path PackageName/Module/view/frontend/layout/catalog_product_view.xml <?xml version="1.0"?> <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd&...


2

This might help Create helper class use Magento\Sales\Api\OrderItemRepositoryInterface; class Data extends AbstractHelper { /** * Order Item Repository * * @var OrderItemRepositoryInterface */ private $orderItemRepository; public function __construct( OrderItemRepositoryInterface $orderItemRepository ) { ...


2

Reference link Using Object Manager <?php $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); $product = $objectManager->get('Magento\Framework\Registry')->registry('current_product'); echo $product->getId(); ?> Using Block <?php namespace Vendor\Module\Block; class BlockClass extends \Magento\Framework\View\Element\...


2

Please check whether the associated product linked have the configurable attributes first. If by any chance it is removed from the attribute set it might be the cause.


1

1.Log in to Admin Panel 2.Navigate to Stores > Attributes > Product 3.Find your brand attribute and go to the Attribute Properties of your brand attribute 4. Set the "NO" to "Values Required"


1

Try this hope it will help you. $_quickShopHelper = $this->helper('Emthemes\QuickShop\Helper\Data'); switch ($type = $block->getType()) { case 'related-rule': if ($exist = $block->hasItems()) { $type = 'related'; $class = $type; $image = 'related_products_list'; $title = __('Related ...


1

Run the following commands and check. php bin/magento setup:di:compile php bin/magento cache:clean php bin/magento cache:flush php bin/magento indexer:reindex php bin/magento setup:upgrade php bin/magento setup:static-content:deploy -f sudo chmod -R 777 var/ generated/ pub/


1

I had some issues during some migrations, I think these steps might help you. 1º Clean up The first step will be to clean up your Magento install, so run this command below to clean up your product attributes that have not used and check the database. wget https://files.magerun.net/n98-magerun2.phar && chmod +x ./n98-magerun2.phar && alias ...


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