Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

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

Posted on 2011-09-06
11
330 Views
Last Modified: 2012-08-13
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,
0
Comment
Question by:Amanda Watson
  • 7
  • 2
11 Comments
 
LVL 40

Expert Comment

by:gurvinder372
ID: 36502886
i added one item to cart, after that it got redirected to cart by itself. I am not facing this issue
0
 
LVL 11

Author Comment

by:Amanda Watson
ID: 36506501
0
 
LVL 11

Author Comment

by:Amanda Watson
ID: 36506503
did you then get redirected to the cart?
Which browser are you using?
0
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
LVL 40

Expert Comment

by:gurvinder372
ID: 36506524
which method is being called at the onclick of 'Add to Cart' button?
0
 
LVL 11

Author Comment

by:Amanda Watson
ID: 36506964
Here is the form - does this help



addtocart-form.tpl.php
browse-notables.tpl.txt
0
 
LVL 11

Author Comment

by:Amanda Watson
ID: 36519814
Hello, can anyone help with this issue?
0
 
LVL 11

Author Comment

by:Amanda Watson
ID: 36525769
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?
0
 
LVL 11

Accepted Solution

by:
Amanda Watson earned 0 total points
ID: 36525914
This fixed it
// 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);
vmRedirect( $sess->url( '/index.php?page=shop.cart&option=com_virtuemart&Itemid=9999', true, 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 );
}
0
 
LVL 11

Author Closing Comment

by:Amanda Watson
ID: 36553532
Found solution eleswhere
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses four methods for overlaying images in a container on a web page
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
The viewer will learn how to count occurrences of each item in an array.
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

789 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question