Welcome to the MetaMod and Chameleon Support Forums.

Before posting, please check out the FAQs.

helpme

 

Need extra help with your Joomla site? Consider paid Joomla support by the developer of Chameleon and MetaMod.

 

show chat module mon-fri 8am-4pm only on certain virtuemart page types

show chat module mon-fri 8am-4pm only on certain virtuemart page types

We wanted to show a module that showed a chat icon

    only on certain virtuemart page types

    only mon-fri between 8am and 4 pm


The following seems to be working. I'd appreciate any comments/improvements.

This was on a j 2.5 site running the free meta mod

I had to figure out the server time offset. I basically played around until I figured there was a four hour offset.

I realize that I'm using 23:59 . I wasn't sure if 24:00 would work. In any event, we'll probably change that to end the chat icon display 15 minutes before the end of the shift.

I used a nested If statement. The first part checks the day/time. If it passes that, then it checks for virtuemart page types.

Code:

$vm = JomGenius("virtuemart"); // need this at the start of every rule


// This is to show the chat icon m-f 8-4. However
// we need to add 4 hours to offset for the server
// being set to UTC in joomla

if ($core_genius->inTimeSpan( "mon 12:00 - mon 23:59;
          tue 12:00 - tue 23:59;
          wed 12:00 - wed 23:59;
          thu 12:00 - thu 23:59;
          sat 00:01 - sat 14:00;
          fri 12:00 - fri 23:59") )   {

// If the date-time above is met, then the code
// below will only show the chat on certain
// virtuemart page types.


       if ( $vm->check( "pagetype starts with cart" ) ) return 124;

       if ( $vm->check( "pagetype starts with product" ) ) return 124;

       if ( $vm->check( "pagetype = category" ) ) return 124;
 

cmendla
Beginner Modder
ranks
useravatar
Offline
1 Posts
Administrator has disabled public posting

Board Info

Board Stats:
 
Total Topics:
1684
Total Polls:
6
Total Posts:
5940
Posts this week:
1
User Info:
 
Total Users:
5161
Newest User:
kbmgkey234q
Members Online:
0
Guests Online:
412

Online: 
There are no members online

Forum Legend:

 Topic
 New
 Locked
 Sticky
 Active
 New/Active
 New/Locked
 New Sticky
 Locked/Active
 Active/Sticky
 Sticky/Locked
 Sticky/Active/Locked