jason14 Posted September 13, 2022 Share Posted September 13, 2022 I want to add a couple of lines of dynamic text to my product description. Like this text What is the price of "product name" in Singapore? The latest price of "product name" in Singapore is "product price" You can buy the "product name" at best price from our "store name" or visit "store address" I don't want to visit every product page to add this. And I want google to capture the question (attached picture) How can I do it? Link to comment Share on other sites More sharing options...
ps8modules Posted September 16, 2022 Share Posted September 16, 2022 (edited) How to add dynamic text? Create a module and a custom hook that will be inserted into the TPL of the product.tpl template. Or add text to ./themes/classic/templates/catalog/product.tpl. Find: {block name='product_description'} <div class="product-description">{$product.description nofilter}</div> {/block} change to: {block name='product_description'} <div class="product-description">{$product.description nofilter}</div> <div class="product-description"> <h3>{l s='What is the price of' d='Shop.Theme.Catalog'} {$product.name} {l s='in Singapore?' d='Shop.Theme.Catalog'}</h3> <p> {l s='The latest price of' d='Shop.Theme.Catalog'} {$product.price} {l s='You can buy the' d='Shop.Theme.Catalog'} {$product.name} {l s='at best price from our' d='Shop.Theme.Catalog'} {$shop.name} {l s='or visit' d='Shop.Theme.Catalog'} <a href="{$urls.base_url} ">{$shop.name}</a>. </p> </div> {/block} result: Edited September 16, 2022 by 4you.software (see edit history) 1 Link to comment Share on other sites More sharing options...
jason14 Posted September 18, 2022 Author Share Posted September 18, 2022 On 9/16/2022 at 3:29 PM, 4you.software said: How to add dynamic text? Create a module and a custom hook that will be inserted into the TPL of the product.tpl template. Or add text to ./themes/classic/templates/catalog/product.tpl. Find: {block name='product_description'} <div class="product-description">{$product.description nofilter}</div> {/block} change to: {block name='product_description'} <div class="product-description">{$product.description nofilter}</div> <div class="product-description"> <h3>{l s='What is the price of' d='Shop.Theme.Catalog'} {$product.name} {l s='in Singapore?' d='Shop.Theme.Catalog'}</h3> <p> {l s='The latest price of' d='Shop.Theme.Catalog'} {$product.price} {l s='You can buy the' d='Shop.Theme.Catalog'} {$product.name} {l s='at best price from our' d='Shop.Theme.Catalog'} {$shop.name} {l s='or visit' d='Shop.Theme.Catalog'} <a href="{$urls.base_url} ">{$shop.name}</a>. </p> </div> {/block} result: Thank You, I will try it and let you know. 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now