New answers tagged

0

I solve it with replacing the $_product = $block->getProduct(); with $_product = \Magento\Framework\App\ObjectManager::getInstance() ->get(\Magento\Framework\Registry::class)->registry('product');


1

Try to get product data from your block i.e. $block->getProduct


0

first added this code on your phtml and then use the product object : <?php $_helper = $this->helper(Magento\Catalog\Helper\Output::class); $_product = $block->getProduct(); if (!$_product instanceof \Magento\Catalog\Model\Product) { return; }


1

in catalog_product_view.xml <move element="page.main.title" destination="content" before="-"/> <referenceContainer name="content"> <block class="Magento\Catalog\Block\Product\View" name="product.before.title" template="Magento_Catalog::product/view/before_title.phtml" ...


0

I was able to do this by adding the attribute then importing via csv with text similar to the following '<a href='https://pirate.black/' target='_blank'>https://pirate.black//</a> It will also work if directly entered in the new product attribute.


0

Somehow (from my perspective) Product doesn't match the semantics of most other parts of Magento - maybe there is legacy support in there or something because for product both ResourceModel and Repository both have different saving logic than other models like Block in module-cms. Try the class Magento\Catalog\Model\ResourceModel\Product\Action->...


0

Custom Shipping Rates from ecombricks can handle this case as like as any other real world scenarios based on cart and product attributes. You can create rates via extremely flexible expressions.


Top 50 recent answers are included