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.

 

Empty Virtuemart cart if user is re-directed to specific URL.

Re: Empty Virtuemart cart if user is re-directed to specific URL.

Hi zmogus,

When you put them together like that, which part does not work? Does either of the conditions still work? Or do both stop working?

I can't see anything wrong with the code itself - that looks fine.

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

Re: Empty Virtuemart cart if user is re-directed to specific URL.

Hi,

Yes i agree that code looks ok. But when they are together both of them stop working, I mean that cart is nto emptied then if "page" condition is met. I will try to perfrom one more test and let you know how it went.

zmogus
Beginner Modder
ranks
useravatar
Offline
10 Posts
Administrator has disabled public posting

Re: Empty Virtuemart cart if user is re-directed to specific URL.

Hi, Stephen.

I am using Joomla 2.5.4 and Virtuemart 2.0.6.

I would like to know if it is possible to use MetaMod Pro to delete one product from the cart if the user add to the cart a different product from the same category. I found here that it is possible to clear the whole cart, but I need to know if I can delete just the product that belongs to the same category and keep any other product from a different category.

Thanks again for your very well done job and your great service.

vrans99
Beginner Modder
ranks
useravatar
Offline
4 Posts
Administrator has disabled public posting

Re: Empty Virtuemart cart if user is re-directed to specific URL.

[following up this request on http://www.metamodpro.com/forums/topic?id=1026#p4743 ]

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

Re: Empty Virtuemart cart if user is re-directed to specific URL.

Hi Stephen:

Is it possible to add a button (inside a Metamod module) to remove all the items in the cart. I`m a novice, so I need detailed instructions, if you please.
VM 2.0.6 & J2.5.4
Thanks in advance!!

Alex

graphos
Beginner Modder
ranks
useravatar
Offline
2 Posts
Administrator has disabled public posting

Re: Empty Virtuemart cart if user is re-directed to specific URL.

Hi Alex,

I had someone work with this on VM1.x on J1.5, but I am really not sure if this would work on J2.5. See http://www.metamodpro.com/forums/topic?id=727 for details.

If that code actually works on J2.5, then this is what you could do:

1 - create a standard HTML module with a "clear all items" link in it. This link would be to a particular page on your site, BUT with something like "?clearcart" or "&clearcart" at the end of it.

2 - in the MetaMod you could have:  [providing VM2.0 works in the same way as VM1.0)

if ($core_genius->check("url contains clearcart")) {
  require_once(CLASSPATH.'ps_cart.php');
  $ps_cart = new ps_cart;
  $ps_cart->reset();
  $_SESSION['savedcart']['idx']=0;
  $ps_cart->saveCart();
} else {
  return XXX;
}
// replace XXX with the module id of your module with the link in it.
// That will display that module on every page that the MetaMod is
// assigned to, EXCEPT when the person clicks on the link.


Sorry I really don't know if the cart-clearing code will work in VM2.0. Could you ask on their forums for some more info about that? It's not really a MetaMod issue.

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

Re: Empty Virtuemart cart if user is re-directed to specific URL.

Stephen:

Thanks for your answer!

But it didn't work. There isn't a ps_cart.php file in VM2.0 and I can't find something similar or with the specific function $ps_cart->reset(); or something similar.
rhis is the message i get:

Warning: require_once(CLASSPATHps_cart.php) [function.require-once]: failed to open stream: No such file or directory in /home/sibwana/public_html/vinos/modules/mod_metamod/helper.php(597) : eval()'d code on line 2

Fatal error: require_once() [function.require]: Failed opening required 'CLASSPATHps_cart.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/sibwana/public_html/vinos/modules/mod_metamod/helper.php(597) : eval()'d code on line 2

VM forums? I haven`t got answers to my posts.

If you know somthing else I can try... tell me

Thank you very much!!

Alex

graphos
Beginner Modder
ranks
useravatar
Offline
2 Posts
Administrator has disabled public posting

Board Info

Board Stats:
 
Total Topics:
1703
Total Polls:
6
Total Posts:
5940
Posts this week:
1
User Info:
 
Total Users:
7398
Newest User:
gobart1ramny
Members Online:
0
Guests Online:
91

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