Suspend Trading

Hi ALL



Is there a way to suspend trading i.e. store still open for viewing but no way to add to cart?



This would be for example to allow for holidays etc!!!



Have searched but can’t find anything, don’t want to “temporarily close” the store!



Thanks in advance



Barryh

nothing exists that I know of but it would be a fairly easy modification to implement for someone that has the time…

  1. Run this on your database:



INSERT INTO `cscart_settings` (`option_id`,`option_name`,`section_id`,`subsection_id`,`option_type`,`value`,`position`,`is_global`) VALUES (910001,'holiday','General','','C','N',52,'Y');
INSERT INTO `cscart_settings_descriptions` (`object_id`,`description`,`object_type`,`lang_code`,`object_string_id`) VALUES (910001,'Disable shopping for the holiday','O','EN','');
UPDATE `cscart_settings` SET `position`=53 WHERE `option_id`=10028;
2. Add a language variable:



closed_for_holiday = “We are closed for the holiday. Sorry for any inconvenience.”



You may choose your own phrase.



3. In “buttons/add_to_cart.tpl”



ADD



{* $Id: add_to_cart.tpl 3612 2007-08-09 13:56:41Z zeke $ *}
[COLOR=Red]{if $settings.General.holiday == 'Y'}
{$lang.closed_for_holiday}
{else}[/COLOR]
{if $settings.General.allow_anonymous_shopping == 'Y' || $auth.user_id}
{*include file="buttons/button.tpl" but_text=$but_text|default:$lang.add_to_cart but_type="" but_onclick=$but_onclick but_href=$but_href but_target=$but_target action_but="action_" but_style=$but_style*}
{include file="buttons/button.tpl" but_text=$lang.add_to_cart_image no_class="true" but_type="" but_onclick=$but_onclick but_href=$but_href but_target=$but_target action_but="action_" but_style=$but_style}
{else}
{include file="buttons/button.tpl" but_text=$lang.login_to_buy but_type="" but_href="$index_script?$target_name=auth&$mode_name=login_form&redirect_url=$c_url" but_style="text" action_but=$action_but}
{/if}
[COLOR=Red]{/if}[/COLOR]












Very nice, Matt and thanks.

If you want to mention a specific holiday easily here’s the mod.


  1. If you’re already using the previous version, undo the changes and apply the following ones.


  2. Run this on your database.


INSERT INTO `cscart_settings` (`option_id`,`option_name`,`section_id`,`subsection_id`,`option_type`,`value`,`position`,`is_global`) VALUES (910001,'holiday','General','','I','',52,'Y');
INSERT INTO `cscart_settings_descriptions` (`object_id`,`description`,`object_type`,`lang_code`,`object_string_id`) VALUES (910001,'Disable shopping for holiday? Enter name of holiday.','O','EN','');
UPDATE `cscart_settings` SET `position`=53 WHERE `option_id`=10028;




3. Add a language variable.



closed_for = “Closed for”

inconvenience = “We’re sorry for any inconvenience.”



4. In “buttons/add_to_cart.tpl”



Add



{* $Id: add_to_cart.tpl 3612 2007-08-09 13:56:41Z zeke $ *}
[COLOR=red]{if $settings.General.holiday}[/COLOR]
[COLOR=red] {$lang.closed_for} {$settings.General.holiday}. {$lang.inconvenience}[/COLOR]
[COLOR=red]{else}[/COLOR]
{if $settings.General.allow_anonymous_shopping == 'Y' || $auth.user_id}
{*include file="buttons/button.tpl" but_text=$but_text|default:$lang.add_to_cart but_type="" but_onclick=$but_onclick but_href=$but_href but_target=$but_target action_but="action_" but_style=$but_style*}
{include file="buttons/button.tpl" but_text=$lang.add_to_cart_image no_class="true" but_type="" but_onclick=$but_onclick but_href=$but_href but_target=$but_target action_but="action_" but_style=$but_style}
{else}
{include file="buttons/button.tpl" but_text=$lang.login_to_buy but_type="" but_href="$index_script?$target_name=auth&$mode_name=login_form&redirect_url=$c_url" but_style="text" action_but=$action_but}
{/if}
[COLOR=red]{/if}[/COLOR]

Not tried it yet, but now I will, thanks again Matt.

Hi



Thanks for that!!!



I may need to close the store for a period of time and didn’t want the customers locked out. I will set this up soon. It looks to be what we want.

Thank you for your time and input.



Barryh

Works like a charm!!!



Thank you very much, this mod will come in very handy for periods of stock taking or relocation - recommended.



Your contribution to this forum puts the rest of us to shame.



Barry

Thank you, BarryH. :oops::slight_smile: I enjoy participating here in the forums.

Good Idea!





Lee Li Pop

Thanks hero, you are great. Keep it up. :slight_smile: