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.

 

virtuemart recipes

virtuemart recipes

Hello,
I know this question was answered before, but I tried and did not successful!
Iwant show modules only on virtuemart homepage.
---------
joomla 2.5.17 (after upgrade from j1.5)
virtuemart 1.2b
Metamod pro
My site URL: www.alsamet.com/jupgrade
My home page is virtuemart componenet!
Debug : On
---------
What is the correct code please?
thank you

asishlla
Junior Modder
ranks
useravatar
Offline
20 Posts
Administrator has disabled public posting

Re: virtuemart recipes

Can you please try the following, to see what page MetaMod thinks you are on, on the front page of the site:

1 - create a MetaMod and assign it to ALL pages (and a valid module position, and published)
2 - in the MetaMod, turn on Advanced Debug mode
3 - in the MetaMod, use the following PHP:

$vm = JomGenius("virtuemart");
echo "page type: " . $vm->info("pagetype") . "<br />";

4 - visit the front page of the site and see what the MetaMod says. Copy and paste the output into the forum here.

Thanks,
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
3313 Posts
User info in posts
Administrator has disabled public posting

Re: virtuemart recipes

Thank you
Here is the code:

Code:

if (

$option == 'com_virtuemart'
and $view == 'default'
and $Itemid == '54'
) return XXX; /* replace XXX with the module ID or position to display */
MetaMod debug info:
Module ID: 122
$option: com_virtuemart
$view: default
$id:
$Itemid: 54
$timezone: UTC
$language: ar
$language_code: ar
$language_region:
page type:
Including modules: nothing

asishlla
Junior Modder
ranks
useravatar
Offline
20 Posts
Administrator has disabled public posting

Re: virtuemart recipes

Ok, the strange thing is that MetaMod is not reporting the pagetype as anything. However we can target it using the other PHP code suggested there:

Code:

if ( 

$option == 'com_virtuemart'
and $view == 'default'
and $Itemid == '54'
) return XXX; /* replace XXX with the module ID or position to display */

Does that work for you?

Cheers,
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
3313 Posts
User info in posts
Administrator has disabled public posting

Re: virtuemart recipes

thank you
the module still work in all pages sad

asishlla
Junior Modder
ranks
useravatar
Offline
20 Posts
Administrator has disabled public posting

Re: virtuemart recipes

Hi,

there are 2 main reasons why this can happen:

1 - you have the module assigned to some or all menu items and in a valid module position, and it's published. In this case MetaMod can't control it. To test if this is the case, unpublish the MetaMod. If the module still appears, you need to either set it to "menu items: none" or to a non-existant module position.

2 - If the module still disappears when the MetaMod is unpublished, but appears all the time when MetaMod is published, then there are 2 main reasons:

a - if you have the module id in MetaMod's "quick module id or position include" box, then you need to REMOVE it from there. Leave it blank.

b - the PHP rule is somehow causing the module to appear. i.e. the logic is wrong.


So if it's 2b that's the problem, then that must mean that for all the other pages the MetaMod was appearing on, they must have all had "option=com_virtuemart" and "view=default" and "Itemid=54". To fix that we just need to narrow down a bit more what makes the front page unique. So, if that's the case, can you please repeat the test on each one of the other pages where the module is wrongly appearing, and paste in the contents of the PHP code from MetaMod's output? e.g. an example of a product page, category page, etc.

Lastly, could you please tell me what exact version of MetaMod and VM you are using?

Thanks,
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
3313 Posts
User info in posts
Administrator has disabled public posting

Re: virtuemart recipes

Hello Stephen , thank you for help.
No thing from your post is the reason!
i worked before with metamod and always was fine smile
the version of metamod is:
MetaMod v3.15, 2013-11-30
MetaMod Pro plugin v3.15, 2013-11-30 is installed and enabled.
JomGenius v19 is provided by MetaMod
version of VM : VirtueMart 1.2.0b stable
------
the VM module (latest prudects) not assigned to any menu and its published in correct position , and metamod assigned to home page only!
------
Now i enable the metamod advanced debug and here is the results:
Home page debug code:

Code:

if (

$option == 'com_virtuemart'
and $view == 'default'
and $Itemid == '54'
) return XXX; /* replace XXX with the module ID or position to display */

Module ID: 122
$option: com_virtuemart
$view: default
$id:
$Itemid: 54
$timezone: UTC
$language: ar
$language_code: ar
$language_region:
Including modules: 104
---------------
One category page code:

Code:

if (

$option == 'com_virtuemart'
and $view == 'default'
and $jinput->get('page') == 'shop.browse'
and $jinput->get('category_id') == '5'
and $Itemid == '54'
) return XXX; /* replace XXX with the module ID or position to display */

Module ID: 122
$option: com_virtuemart
$view: default
$id:
$Itemid: 54
$timezone: UTC
$language: ar
$language_code: ar
$language_region:
Including modules: 104
---------------
prudect page code:

Code:

if (

$option == 'com_virtuemart'
and $view == 'default'
and $jinput->get('page') == 'shop.product_details'
and $jinput->get('category_id') == '31'
and $Itemid == '54'
and $jinput->get('product_id') == '2290'
and $jinput->get('flypage') == 'flypage_new.tpl'
) return XXX; /* replace XXX with the module ID or position to display */

Module ID: 122
$option: com_virtuemart
$view: default
$id:
$Itemid: 54
$timezone: UTC
$language: ar
$language_code: ar
$language_region:
Including modules: 104
---------------
Note: metamod assigned only on home page!
Thank you alot friend.
Firas gunaim

asishlla
Junior Modder
ranks
useravatar
Offline
20 Posts
Administrator has disabled public posting

Re: virtuemart recipes

Ok, I think I found the problem. You are using Joomla 2.5.7 but a strange version of VM: 1.2.0b. I can't even find VM1.2.0b on the download list at virtuemart.net!

The VM support in MetaMod for Joomla 2.5+ only works for VMv2.0 and above.

However, based on the code you sent above (thank you!) you should be able to restrict the modules to the home page with this PHP code:

if ($option == "com_virtuemart"
and $jinput->get('page') == ''
and $jinput->get('category_id') == ''
) return XXX; /* replace XXX with the module ID or position to display */

Cheers,
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
3313 Posts
User info in posts
Administrator has disabled public posting

Board Info

Board Stats:
 
Total Topics:
1667
Total Polls:
6
Total Posts:
5910
Total Posts Today:
1
User Info:
 
Total Users:
10152
Newest User:
kasautiizindagiikay
Members Online:
0
Guests Online:
347

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