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.

 

Produktkathegorie an einen bestimmten Tag dastellen

Produktkathegorie an einen bestimmten Tag dastellen

Hallo

ich benutze VirtueMart 3.0.9  und Chameleon

Ich möchte an eine Tag der Woche eine bestimmte Produktkathegorie darstellen und eine andere ausblenden.
An den anderen Tagen der Woche genau umgedreht.

Wie kann ich dies am besten lösen.

Mit freundlichen Grüßen
Kaule

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

Re: Produktkathegorie an einen bestimmten Tag dastellen

Hi Kaule,

thanks for your question. I trust you can either read English or that Google Translate can help you smile

In answer to the question, the answer is a little complicated.

It all depends on how you display the category:
- if you have a menu item for a page that displays just 1 category, then Chameleon could hide that menu item and display another one with a different category instead.
- or, Chameleon can also change the category id of the category that the page will display.

However, if someone is viewing the hierarchy of categories e.g. sports -> cycling -> bikes -> MTB  then Chameleon can't change the way that the hierarchy will appear as people navigate through it.

So if you want to "feature" a category on a certain day of the week, then I'd set up a menu item that displays all the items from a certain category. Using Chameleon, we're going to detect which day of the week it is, and change the parameters of the menu item based on that, so that you can tell it to show a different category instead.

There's a box in the Succeed Action called PHP where can put in a snippet of code to tell VM which category to display, overriding the category in the menu item.

e.g.
JRequest::setVar("virtuemart_category_id",8);

So:
1 - create a new Chameleon rule and name it "mondays".
2 - in the Environment tab, enter "monday 00:00" as the start date/time, and "monday 11:59" as the end date/time
3 - in the Menu Handling tab, select the menu item that you want to be affected by this change (the one that displays the category page)
4 - in the VirtueMart tab, select "page type": category AND manufacturer.products (select both items in the select box)
5 - in the Actions tab, in the PHP box, add the following, editing the category id to whichever one you want to display on that page on Mondays.

JRequest::setVar("virtuemart_category_id", 8);

6 - Save the rule
7 - repeat this, creating a new rule for each day of the week that you want to display a different category.

#3 and #4 are important so that the rule only activates on the exact page that you want it to apply to. Otherwise it might create problems on other pages.

I've tested this and it works on my test system. I trust it will do what you want it to do. This does depend on what type of page you want to change though. There are several other techniques that can be used, so please ask if this does not suit your situation.

Best regards,
Stephen

Stephen Brandon
MetaMod / Chameleon developer
If you use MetaMod or Chameleon, please post a rating and a review at the Joomla! Extensions Directory: Chameleon | MetaMod

metamodguy
useravatar
Offline
3328 Posts
User info in posts
Administrator has disabled public posting

Board Info

Board Stats:
 
Total Topics:
1679
Total Polls:
6
Total Posts:
5933
Posts this week:
3
User Info:
 
Total Users:
4412
Newest User:
doyal54741
Members Online:
1
Guests Online:
145

Online: 
doyal54741

Forum Legend:

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