2 votes
Accepted

Using if statement in phtml

You can use the following code conditionally to display different CSS based on your condition: <?= $block->salebleqty() <= 0 ? 'red' : 'green' ?> For example: <div class="left-...
Tu Van's user avatar
  • 6,888
1 vote
Accepted

how to remove out of stock product price (final_price.phtml - magento 2.4.3p1)

Try this in final_price.phtml file $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); $productStockObj = $objectManager->get('Magento\CatalogInventory\Api\StockRegistryInterface'...
Ronak Rathod's user avatar
  • 6,322
1 vote

How to get current category name when having only the product ID

Get category name from product anywhere. <?php $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); $categoryAllIds = $product->getCategoryIds(); $names = []; ...
MP Raj's user avatar
  • 522
1 vote
Accepted

How to get current category name when having only the product ID

Try the below code. I update the code as per your requirement <?php $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); $reviewData = $block->getAllRatingData(); foreach ($...
Charmi Patel's user avatar
  • 1,141
1 vote

Form submit is not working post mode in the magento 2.4.5

Make sure that the form key is being properly validated on the server side. The line getBlockHtml('formkey') ?> is responsible for generating the form key input field. Verify that the form key value ...
Hikmadh Commerce's user avatar

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