Now run the below command and check on any product view page. initially, my Cache-Control was public, after my changes, I can see that it is one year for my images & also public. This.customsection = customerData.get('custom_section') Next, We will create section.js in app/code/Vendor/Module/view/frontend/web/js directory. "component": " Vendor_ Module/js/section" Closed amitvkhajanchi opened this issue on 69 comments amitvkhajanchi commented on edited Summary of the issue Information on your environment Steps to reproduce Expected and actual results Join channel. Next, we will create a custom_section.phtml in app/code/ Vendor/ Module/view/frontend/templates directory. Next, we will create catalog_product_view.xml in app/code/Vendor/Module/view/frontend/layout directory. You can get section data in any Magento pages. We will display our custom section data in the product view page. Step 2: Display custom section data in frontend In getSectionData() method we will define our data that we want to store in section. Next, create CustomSection.php file in app/code/Vendor/Module/CustomerData directory. Vendor\ Module\CustomerData\CustomSection We will define a custom section in the di.xml file by adding a new section into sections pool.Ĭreate di.xml file in app/code/Vendor/Module/etc/frontend directory. Magento tracks when some section is changed and load updated section automatically. Magento loads sections by AJAX request to /customer/section/load/ and caches loaded data in the browser local storage under the key mage-cache-storage. We will show here how we can display a private content in a full cached page, it is very useful if you want to display information per customer
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |