Skip to content

magento man

Render link attribute in custom page builder content type

Lets assume a custom page builder content type with a text attribute representing a link In master.html I’m already retrieving the following attributes <!–master.html–> <<div attr=”data.main.attributes” ko-style=”data.main.style” css=”data.main.css” > <div class=”homebanner-content”> <h3 attr=”data.title.attributes” html=”data.title.html”></h3> <p attr=”data.description.attributes” html=”data.description.html”></p> <a href=” <div… Read More »Render link attribute in custom page builder content type

Magento 2 show current stock for salable quantity on productpage

I have this code for showing if my product is in stock or not. <?php /* @var $block MagentoCatalogBlockProductViewAbstractView */?> <?php $_product = $block->getProduct() ?> <?php $stockstate = MagentoFrameworkAppObjectManager::getInstance()- >get(‘MagentoInventorySalesApiApiGetProductSalableQtyInterface’); $sale_qty = $stockstate->execute($_product->getSku(), 1); ?> <?php if ($block->displayProductStockStatus()): ?> <?php… Read More »Magento 2 show current stock for salable quantity on productpage