Solved

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

Posted on 2011-09-06
11
332 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
Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

 
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 WordPress Site: 5 Essential Approaches

WordPress is the web's most popular CMS, but its dominance also makes it a target for attackers. Our eBook will show you how to:

Prevent costly exploits of core and plugin vulnerabilities
Repel automated attacks
Lock down your dashboard, secure your code, and protect your users

Question has a verified solution.

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

Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
Why do we like using grid based layouts in website design? Let's look at the live examples of websites and compare them to grid based WordPress themes.
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …
In this tutorial viewers will learn how to style a decorative dropcap for the first letter in a paragraph using CSS. In CSS, create a new paragraph class by typing "p.fancy": Then, to style only the first letter of the first sentence, include the ps…

717 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