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.

 

Cart Product Ids

Cart Product Ids

Hi There,
Is this wrong?

$vm = JomGenius("virtuemart"); // need this at the start of every rule
if ( $vm->check( "cart_product_ids = 152" )
   and $vm->check("pagetype = cart" ) ) return 118;

If i used only the pagetype cart its worked! But, when i added the cart product id line, i cant see more the module 118. This product is into my cart.
Please help me !!


DEBUG
Module ID: 117
$option: com_virtuemart
$view: cart
$id:
$Itemid: 101
$timezone: UTC
$language: pt-br
$language_code: pt
$language_region: br
Incluindo módulos: Nenhum

danielmhd
Beginner Modder
ranks
useravatar
Offline
5 Posts
Administrator has disabled public posting

Re: Cart Product Ids

DEBUG
Module ID: 117
$option: com_virtuemart
$view: cart
$id:
$Itemid: 101
$timezone: UTC
$language: pt-br
$language_code: pt
$language_region: br
Incluindo módulos: Nenhum

danielmhd
Beginner Modder
ranks
useravatar
Offline
5 Posts
Administrator has disabled public posting

Re: Cart Product Ids

Hi Daniel,

I wonder if this is the problem:

- When the user adds something to the cart, VirtueMart adds the product using an AJAX request. This means that the entire page does not refresh. Only part of the page gets some new information.

This means that the module does not have a chance to be regenerated because modules only get generated when the entire page is requested.

If you refresh the entire page when that product is in the cart, does module 118 now show up?

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

Re: Cart Product Ids

Hi Stephen,

Thanks for the post.

I refreshed the page, but Module 118 dont load... sad

danielmhd
Beginner Modder
ranks
useravatar
Offline
5 Posts
Administrator has disabled public posting

Re: Cart Product Ids

Hi,

can you please tell me what version of Joomla and what version of 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
3314 Posts
User info in posts
Administrator has disabled public posting

Re: Cart Product Ids

Joomla! 2.5.8
VM 2.0.14

danielmhd
Beginner Modder
ranks
useravatar
Offline
5 Posts
Administrator has disabled public posting

Re: Cart Product Ids

On my test site I have VM2.6 installed, but I am pretty sure the cart detection worked fine under 2.0.14 as well.

Could you please try the following to see what JomGenius is reporting as the page type and cart contents:

$vm = JomGenius("virtuemart"); // need this at the start of every rule
$ids =  $vm->info( "cart_product_ids" );
echo "cart contents: ";
print_r($ids);
echo "<br>VM page type: " . $vm->info("pagetype" ) ;

Hopefully this will show that the cart contents are being detected properly - perhaps it's just an id problem?

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

Re: Cart Product Ids

Tnks for the anwser!

I Added one product (id 146) to cart and show this:

cart contents: Array ( [0] => 146::141:11;146:13;0 )
VM page type: cart

------

cart contents: Array ( [0] => 146::141:11;146:13;0 )
VM page type: category

danielmhd
Beginner Modder
ranks
useravatar
Offline
5 Posts
Administrator has disabled public posting

Re: Cart Product Ids

Ok it looks like the cart contents JomGenius method is bringing back more information than it should. Could you please also send me the results for when there are 2 products in the cart?

As I see it at the moment, I think the following will work for you, though this may have to change if extra products in the cart get put into the same string as the 1st product:

$vm = JomGenius("virtuemart"); // need this at the start of every rule
if ( $vm->check( "cart_product_ids starts with 152::" )
   and $vm->check("pagetype = cart" ) ) return 118;

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

Board Info

Board Stats:
 
Total Topics:
1685
Total Polls:
6
Total Posts:
5912
Total Posts Today:
4
User Info:
 
Total Users:
11504
Newest User:
toko solo
Members Online:
0
Guests Online:
191

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