Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Continue_Shopping button


WendiWest

Recommended Posts

The current code in the continue shopping button always takes the user back one page:

 

<td class="main"><?php echo '<a href="' . tep_href_link($navigation->path[$back]['page'], tep_array_to_string($navigation->path[$back]['get'], array('action')), $navigation->path[$back]['mode']) . '">' . tep_image_button('button_continue_shopping.gif', IMAGE_BUTTON_CONTINUE_SHOPPING) . '</a>';

?></td>

 

The problem with this is products that have attributes will always redirect back into the product page while products without attributes will redirect back to the current Category list of products page. My client wants this button to ALWAYS go back to the current Category list of products page.

 

Can anyone help?? I've posted numerous times and very rarely get any responses. We are now weeks away from launch. . . please help.

 

www.lunchandearn.com/catalog

 

Thank you.

The fool thinks himself to be wise, but the wise man knows himself to be a fool. --William Shakespeare

Link to comment
Share on other sites

I found a post where you can just say tep_href_link(FILENAME) . . .etc. So this takes you back to the home page. But this doesn't quite work. How can I go back to the "list" of products by the category chosen.

 

Can anyone help?

The fool thinks himself to be wise, but the wise man knows himself to be a fool. --William Shakespeare

Link to comment
Share on other sites

I have looked at the code for shopping_cart.php. right before the continue shopping link around line 210 there is this:

 

$back = sizeof($navigation->path)-2;

if (isset($navigation->path[$back])) {

 

changing that 2 to a 3 seems to give the desired action. let me know if this is helpful.

Link to comment
Share on other sites

after changing the code on my site for this, I noticed that the continue button disappeard in the shopping cart. I am not sure what is causing this. I will look further into the situation and let you know what my fix is for this.

Link to comment
Share on other sites

I have looked at the code for shopping_cart.php. right before the continue shopping link around line 210 there is this:

 

$back = sizeof($navigation->path)-2;

    if (isset($navigation->path[$back])) {

 

changing that 2 to a 3 seems to give the desired action. let me know if this is helpful.

 

 

Thanks a bunch for looking at this. While this action partially helps, it does not take all products into account. Meaning, when a product has attributes, you select it and the product form opens up - then you select add to cart. So changing back to a 3 works for this HOWEVER if a product does not have attributes, you select the buy now for the product and it goes directly to the order form with a quantity one selected, therfore, when it goes back 3, it does not go to the products by subcategory list, but back to the subcategories by Category list.

 

I think I need some type of "If the product has attributes, go back 3 and if the product does not have attributes, go back 2. Would you have any idea how to do this?

 

Thanks a million for your time.

The fool thinks himself to be wise, but the wise man knows himself to be a fool. --William Shakespeare

Link to comment
Share on other sites

  • 2 weeks later...

OK - I may be getting closer - but would really appreciate any help!!! I figured if I copy something like :

 

if (isset($products[$i]['attributes']) && is_array($products[$i]['attributes'])) {

 

$back = sizeof($navigation->path)-3;

if (isset($navigation->path[$back])) {

} else {

$back = sizeof($navigation->path)-2;

if (isset($navigation->path[$back])) {

 

}

 

This too causes the continue shopping button to disappear! I'm assuming it's because the if(isset($navigation-> path[$back])) { line of code is using the closing "}" as it's ending to the if statement, so it then ignores the code for the IMABE_BUTTON_CONTINUE_SHOPPING portion. :angry:

 

I'm only a beginner at php and would really appreciate any assistance!!

 

Thanks!

The fool thinks himself to be wise, but the wise man knows himself to be a fool. --William Shakespeare

Link to comment
Share on other sites

I'm ready to give up! If I enter the code:

 

<?php

if (isset($products[$i]['attributes']) && is_array($products[$i]['attributes'])) {

$back = sizeof($navigation->path)-3;

} else {

$back = sizeof($navigation->path)-2;

}

if (isset($navigation->path[$back])) {

?>

 

I get back my continue shopping - but it still always goes back 1 page - into the product subcategory list if the product has no attributes or right back into the product page if the product does have attributes!!!

 

What's up?!?!?

 

Please help someone getting very frustrated with php and osCommerce. . .

The fool thinks himself to be wise, but the wise man knows himself to be a fool. --William Shakespeare

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...