Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

How do I add a "Continue shopping" button?


Juzzyman

Recommended Posts

How do I add a "Continue Shopping" button to the shopping cart?

 

Once an item has been added to the shopping cart you end up on that page with an option to remove but to go back to the catalog is a little bit of process. I would like to add a "Continue Shopping" button that takes you back to the catalog.

 

Thanks for your help!

Link to comment
Share on other sites

I though standard oscommerce had a continue shopping button, my site does.

 

Its should be in your shopping_cart.php file and look something like

 

<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(FILENAME_DEFAULT) . '">' . tep_image_button('button_continue_shopping.gif', IMAGE_BUTTON_CONTINUE_SHOPPING) . '</a>'; ?></td><?php //}?>

<td align="right" class="main"><?php echo '<a href="' . tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL') . '">' . tep_image_button('button_checkout.gif', IMAGE_BUTTON_CHECKOUT) . '</a>'; ?></td>

<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>

REMEMBER BACKUP, BACKUP AND BACKUP

Link to comment
Share on other sites

How do I add a "Continue Shopping" button to the shopping cart? I would like to add a "Continue Shopping" button that takes you back to the catalog.

 

 

depends on what version osc you using!

Link to comment
Share on other sites

I though standard oscommerce had a continue shopping button, my site does.

 

Its should be in your shopping_cart.php file and look something like

 

<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(FILENAME_DEFAULT) . '">' . tep_image_button('button_continue_shopping.gif', IMAGE_BUTTON_CONTINUE_SHOPPING) . '</a>'; ?></td><?php //}?>

<td align="right" class="main"><?php echo '<a href="' . tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL') . '">' . tep_image_button('button_checkout.gif', IMAGE_BUTTON_CHECKOUT) . '</a>'; ?></td>

<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>

I don't have this on my site!

 

Where would I add the code?

Link to comment
Share on other sites

I don't have this on my site!

 

Where would I add the code?

 

There is no need to touch that code line above, below is much easier.

 

 

catalog/shopping_cart.php

 

 

Find:

 

<div class="buttonSet">

<span class="buttonAction"><?php echo tep_draw_button(IMAGE_BUTTON_CHECKOUT, 'triangle-1-e', tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'), 'primary'); ?></span>

</div>

 

 

Replace with:

<div class="buttonSet" align="right">

<?php echo tep_draw_button(IMAGE_BUTTON_CONTINUE_SHOPPING, 'triangle-1-w', tep_href_link(FILENAME_REDIRECT)); ?>

<span class="buttonAction"><?php echo tep_draw_button(IMAGE_BUTTON_CHECKOUT, 'triangle-1-e', tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'), 'primary'); ?></span>

</div>

 

You'll be pleasantly surprised. :D

Link to comment
Share on other sites

There is no need to touch that code line above, below is much easier.

 

 

catalog/shopping_cart.php

 

 

Find:

 

<div class="buttonSet">

<span class="buttonAction"><?php echo tep_draw_button(IMAGE_BUTTON_CHECKOUT, 'triangle-1-e', tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'), 'primary'); ?></span>

</div>

 

 

Replace with:

<div class="buttonSet" align="right">

<?php echo tep_draw_button(IMAGE_BUTTON_CONTINUE_SHOPPING, 'triangle-1-w', tep_href_link(FILENAME_REDIRECT)); ?>

<span class="buttonAction"><?php echo tep_draw_button(IMAGE_BUTTON_CHECKOUT, 'triangle-1-e', tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'), 'primary'); ?></span>

</div>

 

You'll be pleasantly surprised. :D

wildvettes.

 

YOU ROCK!! Thanks again.

Your stuff always just works!

Link to comment
Share on other sites

wildvettes.

 

YOU ROCK!! Thanks again.

Your stuff always just works!

 

lol just learning the hard way I guess, at least this stuff is starting to make more sense to me.

 

Also on the code above I didn't factor that you may have a different redirect path at some point.

 

Change FILENAME_REDIRECT to FILENAME_DEFAULT and you'll never have to worry about it, probably should have just coded it that way the first time.

 

:thumbsup:

Link to comment
Share on other sites

lol just learning the hard way I guess, at least this stuff is starting to make more sense to me.

 

Also on the code above I didn't factor that you may have a different redirect path at some point.

 

Change FILENAME_REDIRECT to FILENAME_DEFAULT and you'll never have to worry about it, probably should have just coded it that way the first time.

 

:thumbsup:

Made the change.

Thanks!

Link to comment
Share on other sites

  • 6 months later...

I though standard oscommerce had a continue shopping button, my site does.

 

Its should be in your shopping_cart.php file and look something like

 

<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(FILENAME_DEFAULT) . '">' . tep_image_button('button_continue_shopping.gif', IMAGE_BUTTON_CONTINUE_SHOPPING) . '</a>'; ?></td><?php //}?>

<td align="right" class="main"><?php echo '<a href="' . tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL') . '">' . tep_image_button('button_checkout.gif', IMAGE_BUTTON_CHECKOUT) . '</a>'; ?></td>

<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>

I have most of this on my ms2rc2 site except that the tep_href_link(FILENAME_DEFAULT) . '"> says tep_href_link($navigation->path[$back]['page'], tep_array_to_string($navigation->path[$back]['get'], array('action')), $navigation->path[$back]['mode']) . '">

 

When I click on a product and then add to cart and then try to continue shopping, it goes to people who bought this also bought. How do I go back to continue shopping from where I left off?

Link to comment
Share on other sites

  • 2 weeks later...
  • 7 months later...

There is no need to touch that code line above, below is much easier.

 

 

catalog/shopping_cart.php

 

 

Find:

 

<div class="buttonSet">

<span class="buttonAction"><?php echo tep_draw_button(IMAGE_BUTTON_CHECKOUT, 'triangle-1-e', tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'), 'primary'); ?></span>

</div>

 

 

Replace with:

<div class="buttonSet" align="right">

<?php echo tep_draw_button(IMAGE_BUTTON_CONTINUE_SHOPPING, 'triangle-1-w', tep_href_link(FILENAME_REDIRECT)); ?>

<span class="buttonAction"><?php echo tep_draw_button(IMAGE_BUTTON_CHECKOUT, 'triangle-1-e', tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'), 'primary'); ?></span>

</div>

 

You'll be pleasantly surprised. biggrin.gif

 

Thanks, this works great for me.

 

But to improve this solution can the link send us not to main page but al least the category of that product ($current_category_id?) - or if its possible to the category page cause thats a lot of sites with many pages per category..

 

Thanks in advance, i'll continue looking for a solution and past hehe...

Link to comment
Share on other sites

Like this send you back to product you chose(oscommerce 2.3.1):

<div class="buttonSet" align="right">
<?php $urlfrom = $_SERVER['HTTP_REFERER']; ?>
<?php echo tep_draw_button('Continuar às compras', 'triangle-1-w', $urlfrom, 'primary'); ?>
<span class="buttonAction"><?php echo tep_draw_button(IMAGE_BUTTON_CHECKOUT, 'triangle-1-e', tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'), 'primary'); ?></span>
</div>

 

Continue looking for solution that sends the costumer back to category of the product he choses...

;-)

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...