Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

That *silly!* continue shopping button...


bmac

Recommended Posts

Does anyone know how to change the "Continue Shopping" button so it will return to either the main page or the most recent category page? I have read through _tons_ of unanswered posts regarding this issue, with no success or solution.

 

People on my site keep getting confused and think that their items aren't being added properly because they keep getting kicked back one step.

 

Please help! Thank you all.

 

best,

 

Brian

Link to comment
Share on other sites

go to catalog/shopping_cart.php

 

find this code on lines 195-199

 

<?php
   $back = sizeof($navigation->path)-2;
   if (isset($navigation->path[$back])) {
?>
               <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>

 

I'm not the best in php, but you have to redefine the variable $back to make it go to the index page instead of going back one page. Don't ask me how to do it exactly, but I could figure it out if I spent the time on it... so I am sure that if you play around with it a bit you can figure it out.

 

good luck,

 

Sethman

Link to comment
Share on other sites

the $back variable is set in application_top.php

If you look in the buynow or addproduct case section, you can see there is takes a part of the breadcrumb.

So iso using eg -1, put -2 and you got the page you want.

KEEP CALM AND CARRY ON

I do not use the responsive bootstrap version since i coded my responsive version earlier, but i have bought every 28d of code package to support burts effort and keep this forum alive (albeit more like on life support).

So if you are still here ? What are you waiting for ?!

 

Find the most frequent unique errors to fix:

grep "PHP" php_error_log.txt | sed "s/^.* PHP/PHP/g" |grep "line" |sort | uniq -c | sort -r > counterrors.txt

Link to comment
Share on other sites

I guess I would modify the line in shopping_cart.php that reads:

 

<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>

 

If you need something more concrete, let me know and I'lll take a shot at an actual rewrite.

Link to comment
Share on other sites

If you want to go to index just use this

 

<td class="main"><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT)'">' . tep_image_button('button_continue_shopping.gif', IMAGE_BUTTON_CONTINUE_SHOPPING) . '</a>'; ?></td>

 

should work fine

Link to comment
Share on other sites

Hey all,

 

Thank you so much for the quick responses.

 

Dennis, I just tried your suggestion but am getting this error:

 

Parse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ',' or ';' in /home/stuart/public_html/mactac/shopping_cart.php on line 199

 

I'm going to restore my backup and try the other approaches. I'll keep you all posted with any success. Thank you all _very_ much for your help!

 

best,

 

Brian

 

 

 

If you want to go to index just use this

 

<td class="main"><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT)'">' . tep_image_button('button_continue_shopping.gif', IMAGE_BUTTON_CONTINUE_SHOPPING) . '</a>'; ?></td>

 

should work fine

Link to comment
Share on other sites

but it does loose the cpath, so continue shopping is basically goto "top", no memory of the catalog page you were browsing. If you don't have many products this might be ok, but if there are lots, I wouldn't recommend this.

KEEP CALM AND CARRY ON

I do not use the responsive bootstrap version since i coded my responsive version earlier, but i have bought every 28d of code package to support burts effort and keep this forum alive (albeit more like on life support).

So if you are still here ? What are you waiting for ?!

 

Find the most frequent unique errors to fix:

grep "PHP" php_error_log.txt | sed "s/^.* PHP/PHP/g" |grep "line" |sort | uniq -c | sort -r > counterrors.txt

Link to comment
Share on other sites

Don't know if this will help anyone, but it appears to work (at least so far with *very* limited testing), but if you change the lines (about 189 on my shopping_cart.php page) just above the $navigation->path[$back] code:

 

<?php
   $back = sizeof($navigation->path)-2;
   if (isset($navigation->path[$back])) {
?>

 

 

to

 

<?php
   $back = sizeof($navigation->path)-3;
   if (isset($navigation->path[$back])) {
?>

 

Clicking on Continue Shopping will now take you back just one more page, I believe so that you can REALLY continue shopping!

 

Please correct me if I'm wrong, but it really seems to work so far.

Link to comment
Share on other sites

ah, yes, that's what I was pointing to. I thought it was in application_top, guess not ... :blush:

KEEP CALM AND CARRY ON

I do not use the responsive bootstrap version since i coded my responsive version earlier, but i have bought every 28d of code package to support burts effort and keep this forum alive (albeit more like on life support).

So if you are still here ? What are you waiting for ?!

 

Find the most frequent unique errors to fix:

grep "PHP" php_error_log.txt | sed "s/^.* PHP/PHP/g" |grep "line" |sort | uniq -c | sort -r > counterrors.txt

Link to comment
Share on other sites

Thanks visualpeople

 

That is a least better than before.

 

But Is there a way to recognise where the variable $back will be going, like this

 

I know nothing of PHP so I will just put in english with a simple IF THEN ELSE statement

 

IF $navigation->path PAGE = product_info.php (or part thereof)

 

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

 

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

 

Is that possible in PHP ??

 

 

I would love that as I have a mixture of downloadable and non-downloadable products

 

Regards

Day

Link to comment
Share on other sites

or even better

 

IF $navigation->path PAGE = product_info.php (or part thereof)

 

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

 

ELSE IF $navigation->path PAGE = index.php (or part thereof)

 

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

 

ELSE $back = index.php;

 

 

Regards

Day

Link to comment
Share on other sites

  • 1 month later...

Thanks so much, this is exactly what I needed. I was originally searching because my continue button had disappeared and I wanted a way to put it back. I ran across this post and this is something I've been trying to figure out for awhile. I changed the code and it works, my continue shopping button is even back, and now it's better than ever. Again, Thanks so much.

 

Cyndi

Is it reality or just a dream, for some there is no difference.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...