Hot answers tagged

1

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\...


1

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&...


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