Jump to content



Latest News: (loading..)

- - - - -

How to insert Shopping Cart box in custom layout

shopping cart box

  • Please log in to reply
5 replies to this topic

#1   willianroberg_296579

willianroberg_296579
  • Members
  • 3 posts
  • Real Name:Willian

Posted 25 May 2012 - 08:28 PM

Hello everyone, I´m currently building a custom site and I would like for the shopping cart box to showup in a especific area, Can someone help with the code to render the shopping cart box inside a div that I have on my page? Thanks everyone.

#2 ONLINE   DunWeb

DunWeb

    The Censored One

  • Members
  • 12,723 posts
  • Real Name:Chris
  • Gender:Male
  • Location:Ontario, Canada

Posted 25 May 2012 - 08:31 PM

@willianroberg_296579

Perhaps if you show us the code you are trying to work with, we can help you with the integration.




Chris
:|: Was this post helpful ? Click the LIKE THIS button :|:

See my Profile (click here)

#3   willianroberg_296579

willianroberg_296579
  • Members
  • 3 posts
  • Real Name:Willian

Posted 25 May 2012 - 08:45 PM

there is nothing to show actually, I turned the box off using the admin panel, so it doesnt showup on any of the sidebars, I wanted to know what the php code is to actually put that box else where on the page, something in the line of <?php include(DIR_WS_MODULES . '/shopping_cart.php'); ?>  but this didn´t work :S

#4   willianroberg_296579

willianroberg_296579
  • Members
  • 3 posts
  • Real Name:Willian

Posted 25 May 2012 - 08:47 PM

<div class="lateral">
<div class="indent-banner">
<a href="#"><img src="images/banner_1.png" class="png" alt=""></a>
</div>
<?php include(DIR_WS_MODULES . '/shopping_cart.php'); ?> 

</div>


#5 ONLINE   burt

burt

    Code Monkey

  • Community Team
  • 7,744 posts
  • Real Name:G Burton
  • Gender:Male
  • Location:UK/DEV/on

Posted 25 May 2012 - 08:49 PM

You need to separate data from execution.

http://multimixer.gr/03/01/2011/separating-data-from-execution-in-oscommerce-boxes/
eBooks / Templates

Warning: My posts may contain Horsemeat.

#6   MrPhil

MrPhil
  • Members
  • 4,129 posts
  • Real Name:Phil
  • Gender:Male

Posted 26 May 2012 - 01:29 AM

So osC is going to be just a subsection of your site, but when the visitor is off of the osC pages, you still want them to be able to see some aspect of the cart, and maybe be able to click on it to return to the full osC? That's not easy. osC is really architected to own the whole show, and it's quite difficult to split off bits and pieces of it. You would have to do something to properly initialize the cart display, even if your visitor hasn't even gone into the store. You need to preserve the session information whenever the customer wanders outside of the store, or you'll lose the cart. You may have to use tep_href_link() everywhere in your site.

The cart display might be solvable by simply setting a global flag on your site as to whether there's stuff in the cart (initial: no) and modifying osC to update this global flag as cart contents change. If the purpose is merely to remind the visitor that they have stuff in the cart, that may be adequate. You then just display a "cart empty" or "cart full" button, per the flag, linked into the appropriate place in osC.