Solved

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

Posted on 2011-09-06
11
331 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
[X]
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
  • 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

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

JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
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 the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

749 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