Magento2 : require(‘Magento_Customer/js/customer-data’) not loading always

I am trying to get the cart items in phtml file (product detail page) using jquery script. Here is the script: require([ ‘jquery’, ‘jquery/ui’], function($,item){ item = require(‘Magento_Customer/js/customer-data’).get(‘cart’)().items; console.log(item.length); }); It not load customer data all the time.I need this to get the item count when product added or deleted from the mini cart dynamically…

Magneto 1 Want to show some products same as Related products in catalog product edit

I have created custom tab with products in Catalog >> Product >> Edit But want to apply same grid functionality like related products including remove products. Tabs.php (Vendor/ModuleName/Block/Adminhtml/Catalog/Product/Tabs.php) <?php /** * Class N98_ARA_Block_Adminhtml_Catalog_Product_Tabs */ class N98_ARA_Block_Adminhtml_Catalog_Product_Tabs extends Mage_Adminhtml_Block_Widget_Grid implements Mage_Adminhtml_Block_Widget_Tab_Interface { /** * Set the template for the block * */ public function _construct() {…

Magneto 1 Want to show some products same as Related products in catalog product edit

I have created custom tab with products in Catalog >> Product >> Edit But want to apply same grid functionality like related products including remove products. Tabs.php (Vendor/ModuleName/Block/Adminhtml/Catalog/Product/Tabs.php) <?php /** * Class N98_ARA_Block_Adminhtml_Catalog_Product_Tabs */ class N98_ARA_Block_Adminhtml_Catalog_Product_Tabs extends Mage_Adminhtml_Block_Widget_Grid implements Mage_Adminhtml_Block_Widget_Tab_Interface { /** * Set the template for the block * */ public function _construct() {…

M2 – Create function in module

I have a piece of code that I need to use multiple times, but I don’t want to get a very long page with a lot of the same code. I have this piece of code: <div class=”av-product-specs-list-container”> <input type=”checkbox” id=”chck1″ checked> <label class=”av-product-specs-title” for=”chck1″>Algemene informatie</label> <div class=”av-product-specs-table-list first-spec-list”> <?php if( $av_merk != “” )…