Need extra help with your Joomla site? Consider paid Joomla support by the developer of Chameleon and MetaMod.
- Index
- » MetaMod
- » MetaMod General Support
- » Cart Product Ids
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
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
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
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
- Index
- » MetaMod
- » MetaMod General Support
- » Cart Product Ids
Board Info
- Board Stats:
- Total Topics:
- 1689
- Total Polls:
- 6
- Total Posts:
- 5941
- Posts this week:
- 1
- User Info:
- Total Users:
- 7618
- Newest User:
- goure1dhowen
- Members Online:
- 0
- Guests Online:
- 151
- 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