So I have a cms page which I use as a lading page. The page is custom html coded with 3 of my products (basically showing the product and the price). When you click on an "Buy Now" button it takes you to the products product page where then you can add to cart. Since the prices on the landing page are hardcoded, when the products pricing is changed the landing pages price does not change. How can I make it Dynamic so that when the products price changes... the landing pages prices will change to?


You can use widgets instead of hardcoded html.

Also you can call phtml from cms page and add your own code or logic for product collection and there you can easily show the dynamic price, name, images etc.

You can phtml file from cms pages by using below code:

{{block class="Magento\Framework\View\Element\Template" template="[VendorName]_[ModuleName]::[YourTemplateFileLocation].phtml"}} 

Hope this helps!


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.