Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

show / hide items on a certain day / month etc

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #1  
Old 10-04-2004, 01:10 PM
 
magder magder is offline
 

Advanced Member
  
Join Date: Apr 2004
Posts: 51
 

Default show / hide items on a certain day / month etc

I have setup a store for an organization that needs to close the store once a week for religious reasons.

I've been manualy setting the store closed and then opening it in the general settings.

I'm sure no one has done this but I wondered if anyone knew of a simple way to automate this process.
__________________
x-cart 3.8
Reply With Quote
  #2  
Old 10-04-2004, 01:54 PM
  shan's Avatar 
shan shan is offline
 

X-Guru
  
Join Date: Sep 2002
Location: Birmingham, UK
Posts: 6,163
 

Default

if you want something to happen on say sunday ...


Code:
{if $smarty.now|date_format:"%A" eq sunday} do this {/if}


http://smarty.php.net/manual/en/language.modifier.date.format.php

or

http://smarty.php.net/manual/en/language.variables.smarty.now.php

for more info
__________________
Looking for a reliable X-cart host ?
You wont go wrong with either of these.

EWD Hosting
Hands On Hosting
Reply With Quote
  #3  
Old 10-05-2004, 03:57 PM
  adpboss's Avatar 
adpboss adpboss is offline
 

X-Man
  
Join Date: Feb 2003
Location: Ontario, Canada
Posts: 2,389
 

Default

Move to Custom Mods. This is too darn useful.

Imagine having a recurring sale every Friday. You could code the Sale message to appear automatically without having to manually update your site text.

The possibilities are endless.

Nice post Shan.
Reply With Quote
  #4  
Old 10-07-2004, 08:44 AM
 
magder magder is offline
 

Advanced Member
  
Join Date: Apr 2004
Posts: 51
 

Default

Shan would are you saying I can just switch templates at a particular time?

Is there a way I could just add a redirect somewhere wrapped in the conditional tag?

Is that what the store closed setting does?

Thanks.
__________________
x-cart 3.8
Reply With Quote
  #5  
Old 10-07-2004, 08:48 AM
  adpboss's Avatar 
adpboss adpboss is offline
 

X-Man
  
Join Date: Feb 2003
Location: Ontario, Canada
Posts: 2,389
 

Default

You could PROBABLY wrap a fast meta refresh to a page explaining why you are closed.
Reply With Quote
  #6  
Old 10-07-2004, 09:13 AM
  shan's Avatar 
shan shan is offline
 

X-Guru
  
Join Date: Sep 2002
Location: Birmingham, UK
Posts: 6,163
 

Default

i was thinking in home.tpl you could say

if sunday show closed message

else show home.tpl page as normal
__________________
Looking for a reliable X-cart host ?
You wont go wrong with either of these.

EWD Hosting
Hands On Hosting
Reply With Quote
  #7  
Old 10-07-2004, 09:16 AM
  adpboss's Avatar 
adpboss adpboss is offline
 

X-Man
  
Join Date: Feb 2003
Location: Ontario, Canada
Posts: 2,389
 

Default

True but if your store is really religious (I am trying to be serious as I type), then they shouldn't be able to place orders on religious days off.

Otherwise the "store" would be working.

I guess it depends on the interpretation and implementation.
Reply With Quote
  #8  
Old 10-07-2004, 09:28 AM
  Jon's Avatar 
Jon Jon is offline
 

X-Guru
  
Join Date: Oct 2002
Location: Vancouver, Canada
Posts: 4,200
 

Default

What I would do, is create a php script that connects to the database and changes the general settings open/close toggle off.

Then I'd create a second file that that toggles the store back on.

I'd then setup a weekly cron script to run the close script when needed, and then runs the open script to turn it back on when needed.
Reply With Quote
  #9  
Old 10-07-2004, 09:34 AM
  shan's Avatar 
shan shan is offline
 

X-Guru
  
Join Date: Sep 2002
Location: Birmingham, UK
Posts: 6,163
 

Default

could do, long way round though
__________________
Looking for a reliable X-cart host ?
You wont go wrong with either of these.

EWD Hosting
Hands On Hosting
Reply With Quote
  #10  
Old 10-07-2004, 09:50 AM
  Jon's Avatar 
Jon Jon is offline
 

X-Guru
  
Join Date: Oct 2002
Location: Vancouver, Canada
Posts: 4,200
 

Default

It is a bit more to setup, but really wouldn't take more than 15 minutes or so. The only reason personally I'd prefer to do it this way is that it would physically close the store using the x-cart infrastructure instead of just changing the display template.

The other way is definitely simpler though The code could be put around the center text include in /customer/skin1/home.tpl
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 01:32 AM.

   

 
X-Cart forums © 2001-2020