![]() |
How can I insert a new option in Store Settings?
Hello Guys,
I would like to insert a new option in Store Settings. A check box for placing the currency in front or behind the price. By default to be in front of the price. I know I should insert inside the database a new paramenter and use it with currency template. But how can I do that? Thanks |
Re: How can I insert a new option in Store Settings?
You just need to run this SQL query
Code:
INSERT INTO `xcart_config` (`name`, `comment`, `value`, `category`, `orderby`, `type`, `defvalue`, `variants`, `validation`) VALUES ('currency_sign', 'When checked, shows currency sign before price', 'N', 'Appearance', '450', 'checkbox', 'N', '', ''); Now you have this option in appearance section at the very bottom of page. And here is currency.tpl Code:
{* $Id: currency.tpl,v 1.13.2.1 2006/04/29 06:36:56 max Exp $ *} |
Re: How can I insert a new option in Store Settings?
Great job. :D/
1. Now, how can I do this for Admin section? Inserting the check box and process the form? 2. How can I make a patch for adding easy this option to my shop? Thanks. |
Re: How can I insert a new option in Store Settings?
You should just go to Admin backoffice, Path/Upgrade section.
At the section Apply SQL patch insert the code I've posted and press apply button. That's all. |
Re: How can I insert a new option in Store Settings?
I would like to have in Admin -> Store configuration this check box, placing currency in front or behind the price. You gave me the solution only for the Front-End.
Thanks. |
Re: How can I insert a new option in Store Settings?
Quote:
Go to http://www.yoursite.com/xcart/admin/configuration.php?option=Appearance At the very bottom, inside Miscellaneous section there is this checkbox. if you want it to be placed directly at http://www.yoursite.com/xcart/admin/configuration.php then use this code Code:
INSERT INTO `xcart_config` (`name`, `comment`, `value`, `category`, `orderby`, `type`, `defvalue`, `variants`, `validation`) VALUES ('currency_sign', 'When checked, shows currency sign before price', 'N', 'General', '4', 'checkbox', 'N', '', ''); And currency.tpl Code:
{if $plain_text_message eq ""}<span style="WHITE-SPACE: nowrap">{/if}{if $display_sign}{if $value gte 0}+{else}-{/if}{/if}{if $config.General.currency_sign eq "Y"}{$config.General.currency_symbol}{/if}{$value|abs_value|formatprice}{if $config.General.currency_sign ne "Y"}{$config.General.currency_symbol}{/if}{if $plain_text_message eq ""}</span>{/if} |
Re: How can I insert a new option in Store Settings?
Thanks this example give me a lot of idea about inserting new features.
Cheers |
All times are GMT -8. The time now is 10:23 AM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.