Link to home
Start Free TrialLog in
Avatar of Amanda Watson
Amanda WatsonFlag for Australia

asked on

After adding an item to cart, the page isn't going to the cart?

Hi,
Can someone help me write a redirection script for these pages here

http://www.maxtemp.com.au/index.php?option=com_virtuemart&page=shop.browse&category_id=6&Itemid=100001&vmcchk=1&Itemid=1

and
http://www.maxtemp.com.au/index.php?option=com_virtuemart&page=shop.browse&category_id=56&Itemid=1

Basically if you go to these pages (use login aaabbb/password: aaabbb) then add the item to the cart, the page doesn't go to the cart after it has been added.
It does this for all other pages that have more than one item on the page, so can someone help me write a script for this please so that on these pages is always redirects to the cart page after the item has been added to the cart?

Thanks,
Avatar of Gurvinder Pal Singh
Gurvinder Pal Singh
Flag of India image

i added one item to cart, after that it got redirected to cart by itself. I am not facing this issue
Avatar of Amanda Watson

ASKER

did you then get redirected to the cart?
Which browser are you using?
which method is being called at the onclick of 'Add to Cart' button?
Here is the form - does this help



addtocart-form.tpl.php
browse-notables.tpl.txt
Hello, can anyone help with this issue?
I did this
      

Hi Amanda,

In the ps_cart.php find the following:


// Ouput info message with cart update details /*
if($total_quantity !=0 || $total_updated !=0 || $total_deleted !=0) {
if( $total_quantity > 0 && $total_updated ==0 ) {
$msg = $VM_LANG->_('VM_CART_PRODUCT_ADDED',false);
} else {
$msg = $VM_LANG->_('VM_CART_PRODUCT_UPDATED',false);

}

// Comment out the following line to turn off msg i.e. //$vmLogger->tip( $msg );
$vmLogger->info( $msg );
}

and replace it with following code:


// Ouput info message with cart update details /*
if($total_quantity !=0 || $total_updated !=0 || $total_deleted !=0) {
if( $total_quantity > 0 && $total_updated ==0 ) {
$msg = $VM_LANG->_('VM_CART_PRODUCT_ADDED',false);
} else {
$msg = $VM_LANG->_('VM_CART_PRODUCT_UPDATED',false);
vmRedirect( $sess->url( '/index.php?page=shop.cart&option=com_virtuemart&Itemid=9999', true, false ) );
}

// Comment out the following line to turn off msg i.e. //$vmLogger->tip( $msg );
$vmLogger->info( $msg );
}



but you need to press add to cart twice before it works?
ASKER CERTIFIED SOLUTION
Avatar of Amanda Watson
Amanda Watson
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Found solution eleswhere