![]() |
Labels in Product description?
I have 100 products and in their product description I would like to define a text label. I am pretty sure I will modify the value of this text label in the future. Going and changing a word in 100 products is not the best option.
How can I inserted a variable in product description (html)? Just $lbl_ is enough or including it in <?php ... > |
Re: Labels in Product description?
|
Re: Labels in Product description?
Balinor: I know that link, but it is not what I need.
Let be more specific. I will define in language file a new text label for example "Not applicable". This label I want to insert it in Product long description. If I want to change "Not applicable" to "N/A" I should not go to edit every product which has "Not applicable" word in its description. Maybe I don't know which product has that word. So, any idea? |
Re: Labels in Product description?
It is what you need. Create a new language variable and insert it in your product description. Alter the description code as mentioned in that thread so that the language variable works in the product description.
|
Re: Labels in Product description?
Ok. I will make a try. Thanks.
|
Re: Labels in Product description?
Balinor: I made a tried as you suggested. It is not what I needed.
Let me explain you again. Every product has its own description. It is an html text inserted in a form. In this description (html text) I would like to insert a text label that will be easy to change after. For example: Product long description "This product has 12 [text_label] ... " I will use this text_label in more then 60 product descriptions. If I would like to change the value of text_label I should go to Admin -> Language and change the set up value of the label. I don't understand what you mean to go and change the template. As you may see there is no need to change the template. Only a set up value for a language label. So, I would like to define a text label in Language and add it in product description. How can I do that? |
Re: Labels in Product description?
You aren't understanding. That thread I linked is exactly what you need to do. There IS a need to change the product description code in product.tpl so that you can call the newly created smarty language variable, otherwise it will not show the language variable.
|
Re: Labels in Product description?
Balinor: Sorry for the misunderstanding. Using the "eval var" in tpl product full description worked great. This is a very good tip. Cheers!
|
Re: Labels in Product description?
Maybe I missed something, or maybe it's that I'm on an old version. But in 4.0.17, to get access to $lng variables from product descriptions, I needed to insert the following in include/func.php:
after this code Code:
$page_content = $templater->get_template_vars("page_content"); added the following: Code:
$product = $templater->get_template_vars("product"); Then I'm able to use any {$lng.xxxxx} in a product full description. |
All times are GMT -8. The time now is 12:34 PM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.