Hi,
First of all,
These 2 variables;
vmSiteurl = '' ;
vmLang = "";
Are defined by Virtuemart Component. And Virtuemart doesn't defined them in every page, simply because those are not necessary in all pages. Those variables are required to run the "removal" function.
Shopping cart page is just one of them. Removing the product from "shopping cart module" through the module while you are in shopping cart page, doesn't make any sense. Because there is already DELETE button in the shopping cart page.
See the screenshot to understand what i am saying:
Attachment Pasted_Image_6_8_13_3_59_AM-3-3-3.gif not found
Beside, just consider this; you deleted the product from the dropdown shopping cart module. Since the removal will be AJAX based only through module, product will be gone from the module, but the shopping cart page will have the product (even though it doesn't exist anymore in the system, but this is advantage of AJAX, refreshing the entire page is not required to do things.) the shopping cart page (the whole page) won't be updated by AJAX. it will require a regular page refresh.
Anyway, if you insist to make shopping cart module AJAX function works in shopping cart page, (where those 2 variables are not defined) You can manually define those variables, and no matter which page you are, our shopping cart module will run the removal function.
Open this PHP file:
/modules/mod_flexible_cart/tmpl/default.php
And find this line (line 60th):
jQuery.getJSON(vmSiteurl+'index.php?option=com_virtuemart&nosef=1&view=cart&task=viewJS&format=json'+vmLang,
and replace it with this:
vmSiteurl = 'http://demo.multitec.gr/' ;
vmLang = "";
jQuery.getJSON(vmSiteurl+'index.php?option=com_virtuemart&nosef=1&view=cart&task=viewJS&format=json'+vmLang,
And the dropdown shopping cart will remove the product from the module (even though you are in the shopping cart page)
But believe me, this is not what you are looking for. IF you did it, your buyers would be confused. Because in the lower of screen, they will keep seeing the product in the shopping cart page, while the "shopping cart" module says: NO PRODUCT IN THE CART.
Regards.
Forum Support.