- Posts: 110
- Thank you received: 4
Idea / Feature Request: Template Text for products
12 years 10 months ago - 12 years 10 months ago #134730
by mike
Idea / Feature Request: Template Text for products was created by mike
-- url of the page with the problem -- :
www.waffenmarti.ch/shop
-- HikaShop version -- : HikaShop [1308241414] /
-- Joomla version -- : 2.5.14
-- PHP version -- : 5.3.27
-- Browser(s) name and version -- : 31.0.1650.57 (Official Build 235101)
-- Error-message(debug-mod must be tuned on) -- : None
I would like to place an idea / feature request, that would be nice for future versions of HIKA-Shop.
We have some different kinds of products in our Shop and for the most of them, we have to place a "Statement" like ("You need a permit to buy" or "This product is only sold when... x or y"), statements like that.
These are standard texts and always the same.
It would be nice, if these Texts could be stored as "Template-Texts". If I put a new product to the store, it would be nice to enter the product specific parts like product name, description, size, weight, price, ... etc. and then choose such a Template-Text to be displayed below the product as a standard text.
I know how to solve issue with the custom fields but I would like to do as less as possible custom-changes to the PHP-Scripts of the Shop.
And why a text-template? It's simple. I can put a text to every product by hand and this text ever changes, then I have a problem (since I have to change all products by hand with this text). Otherwise I can change the text-template and it's done for all products.
May I ask you to add such a possibility to one of the next versions of Hika-Shop maybe?
You can see a sample of what i mean here:
www.waffenmarti.ch/shop/pistolen/desert-...rtant_product_notice
This "Wichtige Produktehinweise" ("Important product notice") is coded by myself, but this means a change in the displaying scripts which I want to avoid to make updates easier. I know, that the updates do not overwrite my changes, but if I change a script, then I will not get the latest version of this script unless I'm porting my changes manually to the new version of the script.
Thank you and best regards
Mike
PS.: For further information please message me or post here a note. Thank you very much!
-- HikaShop version -- : HikaShop [1308241414] /
-- Joomla version -- : 2.5.14
-- PHP version -- : 5.3.27
-- Browser(s) name and version -- : 31.0.1650.57 (Official Build 235101)
-- Error-message(debug-mod must be tuned on) -- : None
I would like to place an idea / feature request, that would be nice for future versions of HIKA-Shop.
We have some different kinds of products in our Shop and for the most of them, we have to place a "Statement" like ("You need a permit to buy" or "This product is only sold when... x or y"), statements like that.
These are standard texts and always the same.
It would be nice, if these Texts could be stored as "Template-Texts". If I put a new product to the store, it would be nice to enter the product specific parts like product name, description, size, weight, price, ... etc. and then choose such a Template-Text to be displayed below the product as a standard text.
I know how to solve issue with the custom fields but I would like to do as less as possible custom-changes to the PHP-Scripts of the Shop.
And why a text-template? It's simple. I can put a text to every product by hand and this text ever changes, then I have a problem (since I have to change all products by hand with this text). Otherwise I can change the text-template and it's done for all products.
May I ask you to add such a possibility to one of the next versions of Hika-Shop maybe?
You can see a sample of what i mean here:
www.waffenmarti.ch/shop/pistolen/desert-...rtant_product_notice
This "Wichtige Produktehinweise" ("Important product notice") is coded by myself, but this means a change in the displaying scripts which I want to avoid to make updates easier. I know, that the updates do not overwrite my changes, but if I change a script, then I will not get the latest version of this script unless I'm porting my changes manually to the new version of the script.
Thank you and best regards
Mike
PS.: For further information please message me or post here a note. Thank you very much!
Last edit: 12 years 10 months ago by mike.
Please Log in or Create an account to join the conversation.
12 years 10 months ago #134807
by Xavier
Replied by Xavier on topic Idea / Feature Request: Template Text for products
Hi,
What can be done is write something like:
And edit the view "product / show_default" and add a replace like:
Before:
What can be done is write something like:
Code:
{SAMPLE_TEXT}
Code:
$this->element->product_description = str_replace('{SAMPLE_TEXT}','Your sample text here.',$this->element->product_description);
Code:
echo JHTML::_('content.prepare',preg_replace('#<hr *id="system-readmore" */>#i','',$this->element->product_description));
Please Log in or Create an account to join the conversation.
12 years 10 months ago #134809
by mike
Replied by mike on topic Idea / Feature Request: Template Text for products
Hello Xavier
I know, that this would be possible when changing the view product / show_default but I would like to avoid that because I started with HIKA-Shop V. 1.6
Some of my changed view scripts have still this version, because I'm not that good in programming PHP and it is extreemly time-consuming if i have to write my changes in every new Hika-Shop Version.
So I thought that it would be a nice feature for further versions of Hika-Shop to build that into the core files.
Best regards
Michael
I know, that this would be possible when changing the view product / show_default but I would like to avoid that because I started with HIKA-Shop V. 1.6
Some of my changed view scripts have still this version, because I'm not that good in programming PHP and it is extreemly time-consuming if i have to write my changes in every new Hika-Shop Version.
So I thought that it would be a nice feature for further versions of Hika-Shop to build that into the core files.
Best regards
Michael
Please Log in or Create an account to join the conversation.
Time to create page: 0.187 seconds