Contributions
Continue Shopping 'Fix'
Continue Shopping 'Fix' 1.0
Added 1.2.05 by Sincraft (whitestype@yahoo.com)
(Credits go to: Steve Bisset - OSC Team Member, for the actual code)
-----
What Is It?
-----
The purpose of this rather short but neccessary Contribution is to take the user back to the main Catalog page after they click the button CONTINUE SHOPPING , Once they add a product to their cart. By Default: OSC 2.2 Takes the user back to the product they recently added. Customers were getting confused and thought there product wasn't being added. This truly allows customers to....CONTINUE SHOPPING, and that's why we have our pages up right! :)
-----
How to Install.
-----
BACKUP THIS FILE FIRST! Then...
*In catalog/shopping_cart.php change this line of code*
<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>
*TO 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>
DONE.
(copy from here or download file, same thing)
Expand All / Collapse All
The prior solutions to this problem did not work for me. The solution that worked for me was to combine the product_info page check described earlier with another change to force the first entry in navigation history to always be the home page,
All credit to FWR Media - Found his solution and though others may benefit. File attached same as written here.
Quote from FWR Media
"I've always been confused by the continue button in the shopping cart page .. why on earth would a user want to return to the product they just added to cart (or am I missing something). I'm sure this must have been done before but I've not seen it.
Anyway this tip will modify the continue button and users will be sent to the category of the last product they added to cart."
catalog/shopping_cart.php
Find ...
CODE
<td class="main"><?php echo tep_image_submit('button_update_cart.gif', IMAGE_BUTTON_UPDATE_CART); ?></td>
<?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>
<?php
}
?>
Replace with ..
CODE
<td class="main"><?php echo tep_image_submit('button_update_cart.gif', IMAGE_BUTTON_UPDATE_CART); ?></td>
<?php
$back = sizeof($navigation->path)-2;
// BOF FWR Mod category based continue button
$count = count($products);
if( isset($products[$count-1]['id']) ) {
$continueButtonId = tep_get_product_path(str_replace(strstr($products[$count-1]['id'], '{'), '', $products[$count-1]['id']));
}
if( isset($continueButtonId) ) {
?>
<td align="center" class="main"><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT, 'cPath=' . $continueButtonId) . '">' . tep_image_button('button_continue_shopping.gif', IMAGE_BUTTON_CONTINUE_SHOPPING) . '</a>'; ?></td>
<?php
// if (isset($navigation->path[$back])) {
} elseif (isset($navigation->path[$back])) {
// EOF FWR Mod category based continue button
?>
<td align="center" class="main"><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image_button('button_continue_shopping.gif', IMAGE_BUTTON_CONTINUE_SHOPPING) . '</a>'; ?></td>
<?php
}
?>
I got around the same problem a different way.
In shopping_cart.php replace
$back = sizeof($navigation->path)-2;
if (isset($navigation->path[$back])) {
With
$back = sizeof($navigation->path)-2;
if($navigation->path[$back]['page']=="product_info.php"){
$back = sizeof($navigation->path)-3;
}
if (isset($navigation->path[$back])) {
Continue Shopping 'Fix' 1.0
Added 1.2.05 by Sincraft (whitestype@yahoo.com)
(Credits go to: Steve Bisset - OSC Team Member, for the actual code)
-----
What Is It?
-----
The purpose of this rather short but neccessary Contribution is to take the user back to the main Catalog page after they click the button CONTINUE SHOPPING , Once they add a product to their cart. By Default: OSC 2.2 Takes the user back to the product they recently added. Customers were getting confused and thought there product wasn't being added. This truly allows customers to....CONTINUE SHOPPING, and that's why we have our pages up right! :)
-----
How to Install.
-----
BACKUP THIS FILE FIRST! Then...
*In catalog/shopping_cart.php change this line of code*
<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>
*TO 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>
DONE.
(copy from here or download file, same thing)
Note: Contributions are used at own risk.