4 votes

How to hide custom button in product details page by particular category in magento 2

==>You can get the current product category using the below code. NOTE: Please do not use the Object manager <?php $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); $product =...
Rasik Miyani's user avatar
4 votes

How to get the Unit of measure label of product attributes like weight,Length etc in product detail page?

This settings comes from system configuration. Weight: Stores -> Configurations -> Generale -> Locale Options -> Weight Unit use Magento\Framework\App\Config\ScopeConfigInterface; use Magento\Store\...
Sohel Rana's user avatar
  • 35.7k
3 votes

how to customize product price display in product page magento 2

For the first Goal: 1) I want to add a label near the First price . Follow this Link You need to override /vendor/magento/module-catalog/view/base/web/js/price-box.js And add your label : ...
Ylgen Guxholli's user avatar
3 votes
Accepted

How to show price in simple product on product view page?

Override the below file catalog_product_view_type_simple.xml <referenceBlock name="product.info.price" remove="false" /> Use the above code to show the price only in the simple product on ...
Haerriz's user avatar
  • 681
2 votes
Accepted

Magento2.1.9 : Out of stock product Backorder not working?

Problem in your __construct. Try the following way: public function __construct( \Magento\CatalogInventory\Model\Quote\Item\QuantityValidator\Initializer\Option $optionInitializer, \Magento\...
Sohel Rana's user avatar
  • 35.7k
2 votes

Magneto 2: Need to remove decimal from price on product detail page

Create file and use this code : => From : vendor/magento/module-catalog/view/base/templates/product/price/amount/default.phtml => To : app/design/frontend/VendorName/ModuleName/Magento_Catalog/...
Rohan Hapani's user avatar
  • 17.3k
2 votes

Magento2.3 : Pagination - jump to top of pagination at PLP page

Try this code:- <script type="text/javascript"> require(['jquery'], function (jQuery) { jQuery(document).ready(function ($) { $('#cpa-scroll-to-desc')....
Pramod's user avatar
  • 1,444
2 votes

Magento2.3 : Pagination - jump to top of pagination at PLP page

jQuery(document).ready(function() { jQuery(document).on("click", 'a.action.next,a.action.previous,li.item.current,li.item a.page', function(event) { setTimeout(function(){ ...
Chirag Rajput's user avatar
2 votes

Magento 2.3.1 product detail page is very slow

Varnish will help your site only if the backend is healthy: meaning your dev environment loads reasonably fast. Then, varnish will enable your production site to have recurrent visits for the same ...
Herve Tribouilloy's user avatar
1 vote

How to add the product info detail tab in the product page hyva theme

Check these examples here Extend Magento_Catalog::catalog_product_view.xml: <body> <referenceBlock name="product.info.details"> <container name="tabs.switcher&...
S.Murtadha's user avatar
1 vote
Accepted

Magento 2.3 - Set max compare products to 2

The answer in that topic makes you misunderstand. I've fixed that issue, please do the following steps to limit the number of products in compare products feature: Step 1: Create registration.php: ...
Tu Van's user avatar
  • 6,763
1 vote

Magento2: How to show multiselect product attribute lable on product detail page

You need to update code like below for multiselect attribute. For xml file please add like below. <block class="Magento\Catalog\Block\Product\View\Description" name="product.info....
ZealousWeb's user avatar
  • 2,186
1 vote
Accepted

How to redirect Product Detail page to Home Page or 404 in Magento 2?

You can use controller_action_predispatch_catalog_product_view event to redirect user to 404 or home page. In your custom module create Vendor/MyModule/etc/frontend/etc.xml <?xml version="1....
Rahul Barot's user avatar
  • 1,122
1 vote

How to add custom tab in product details page in magento 2.4.0

You might like this one below: this will work using one layout only catalog_product_view.xml, no need of template <?xml version="1.0"?> <page xmlns:xsi="http://www.w3.org/2001/...
Herve Tribouilloy's user avatar
1 vote
Accepted

Using a new attribute as product description

Add a new web_description attribute using admin. Then in your custom theme, in Magento_Catalog/layout/catalog_product_view.xml, add the code below. <referenceBlock name="product.info....
Ricky Aldea's user avatar
1 vote

Magento2.3 : Pagination - jump to top of pagination at PLP page

I have tried this code in list.phtml and it works perfectly <script type="text/javascript"> require([ 'jquery' ], function ($) { jQuery("ul.pages-items a&...
Raxa's user avatar
  • 11
1 vote

magento 2.3 now showing category and subcategory in breadcrum on prodcut detail page

You can use this module for display category and subcategory in breadcrum on prodcut detail page https://github.com/EaDesgin/magento2-full-path-category-product-breadcrumb
Sanket Makavana's user avatar
1 vote

Magento\Framework\Config\Dom\ValidationException: Element 'argument': Duplicate key-sequence

It is all already written. Somewhere in your layout configuration there are 2 *.xml file in the same scope name Name that can be used to address the block to which this attribute is assigned. The ...
Bartosz Herba's user avatar
1 vote
Accepted

How to get product category Id on product detail page Magento 2?

You have to have created a module to show a current category on the product page. Check below files app/code/Vendor/Module/registration.php <?php \Magento\Framework\Component\ComponentRegistrar:...
Kishor Thummar's user avatar
1 vote

How to get product category Id on product detail page Magento 2?

If you want to get the current product category id then use below code NOTE: Please do not use the Object manager <?php $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); $...
Rasik Miyani's user avatar
1 vote
Accepted

Magento 2 Product detail page tab not working

Override tabs.js in your theme or module using requirejs and use $.each(this.collapsibles, function () { $(this).on('beforeOpen', function () { self.collapsibles.not(this)....
Manish Chaubey's user avatar
1 vote

Magento 2 Product Images Not Showing in detail page

Could you please confirm if your magento version is 2.2.4? You have error occured due to showCaption is empty. showCaption require true|false value. In your code showCaption:, look like this that ...
Sagar Gaikwad's user avatar
1 vote

Magento 2 how to restrict previous date in datepicker , for frontend detail page custom options

In your script add the following $customId = <?php echo $product->getCustomId();?> <script> require([ 'jquery', 'mage/calendar' ], function($, calendar) { ...
aravind's user avatar
  • 1,834

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