I could successfully force showing old prices along with special prices inside a product page without the user first having to pick a variant (such as size) from the dropdown. However catalog pages proved to be tricky: some logic in Magento seems to iterate over the product object and basically […]
Magento
app/module/vendor/View/layout <?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"> <body> <referenceBlock name="product.info.main"> <block class="SegaProductHeightBlockProductHeight" template="Sega_ProductHeight::height.phtml" cacheable="false"/> </referenceBlock> </body> </page> app/module/vendor/View/template test module/vendor/Block <?php namespace SegaProductHeightBlock; use MagentoCatalogModelProduct; use MagentoFrameworkExceptionLocalizedException; use MagentoFrameworkRegistry; use MagentoFrameworkViewElementTemplate; class ProductHeight extends Template { protected $registry; protected $product; public function __construct( TemplateContext $context, Registry $registry, array $data) […]
Anyone knows what’s going on with Magento. There are a lot of websites getting compromised recently and it doesn’t matter which version you are. Which version is safe for now? and are there any patch versions coming for 2.3 and 2.4?
I have a phtml file. I want to get the product short description by SKU. I can use ObjectManager to do the work. But looks like this is not a proper way to do it. Anyone can help with recommendation to replace ObjectManager method? Thanks! <?= $block->getProductName($item->getProductId()) ?> <?= $item->getProductId() […]
I have this issue with my Magento 2.4.3 where it does not sort by position. I found this code where I need to override, but I am quite new with Magento, is there anyone that can show me or tell me how to override: MagentoCatalogSearchModelResourceModelFulltextCollection The code: protected function _renderFiltersBefore() […]
I want to override adminhtml layout and phtml file of vendor directory to my custom theme so how can I do that, if anyone have idea then please share. “Because sharing is caring” Thanks in Advance.
I am learning Magento and I Want to add a tax for specific country or state. I know that Magento already has a feature to add % rate tax by zone https://docs.magento.com/user-guide/v2.3/tax/tax-zones-rates.html#:~:text=On%20the%20Admin%20sidebar%2C%20go,code%20for%20Zip%2FPost%20Code. The module works by a percent but I wan a fixed price to add. Someone knows how can […]
I just configured owlCarousel by using a jquery widget and using it with data-mage-init on my template. The problem is that images are giant, no automaticPlay, no arrows nor dots, in despite that I’m adding them on the config object. Here is my code: template: magento/app/code/Vendor/HomePage/view/frontend/templates/carousel.phtml <div class="carousel-wrap"> <div class="owl-carousel" […]
I am trying to show all of the postal codes in my grid from the array in column but it showing only the last one. Array ( [0] => Array ( [from_postalcode] => 123 [to_postalcode] => 123 [record_id] => 0 [initialize] => true ) [1] => Array ( [record_id] => […]