Results 1 to 5 of 5
  1. #1
    Join Date
    Jul 2010
    Posts
    24
    Plugin Contributions
    0

    Default Shopping cart in header

    Hello,

    I would like to put my shopping cart into the top of the header (see attached file).

    Does any one can help me ?
    Attached Images Attached Images  

  2. #2
    Join Date
    Feb 2005
    Location
    Lansing, Michigan USA
    Posts
    20,024
    Plugin Contributions
    3

    Default Re: Shopping cart in header


  3. #3
    Join Date
    Jul 2010
    Posts
    24
    Plugin Contributions
    0

    Default Re: Shopping cart in header

    Thanks, I tried the 2nd... But it's only display :

    Code:
    TEXT_TOTAL_ITEMS2  TEXT_TOTAL_AMOUNT€578.99
    here is the code I added to my tpl_header

    Code:
    <div class="panier"> <div id="cont_panier"><?php require(DIR_WS_MODULES . 'sideboxes/cart_summary.php'); ?></div></div>
    here is the content of cart_summary.php into includes/modules/sideboxes :

    Code:
    <?php
    /**
     * cart_summary ("sidebox") - this sidebox can be used to display a summary of the customer's cart content in header or sidebox
     *
     * @package sideboxes
     * @copyright Copyright 2003-2006 Zen Cart Development Team
     * @copyright Portions Copyright 2003 osCommerce
     * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
     * @version $Id: cart_summary.php  $
     */
    
      $item_separator = ($box_id == '') ? '&nbsp;&nbsp;' : '<br />';
    
      $totalsDisplay = '';
      switch (true) {
        case (SHOW_TOTALS_IN_CART == '1'):
          $totalsDisplay = TEXT_TOTAL_ITEMS . $_SESSION['cart']->count_contents() . $item_separator . TEXT_TOTAL_WEIGHT . $_SESSION['cart']->show_weight() . TEXT_PRODUCT_WEIGHT_UNIT . $item_separator . TEXT_TOTAL_AMOUNT . $currencies->format($_SESSION['cart']->show_total());
          break;
        case (SHOW_TOTALS_IN_CART == '2'):
          $totalsDisplay = TEXT_TOTAL_ITEMS . $_SESSION['cart']->count_contents() . ($_SESSION['cart']->show_weight() > 0 ? $item_separator . TEXT_TOTAL_WEIGHT . $_SESSION['cart']->show_weight() . TEXT_PRODUCT_WEIGHT_UNIT : '') . $item_separator . TEXT_TOTAL_AMOUNT . $currencies->format($_SESSION['cart']->show_total());
          break;
        case (SHOW_TOTALS_IN_CART == '3'):
          $totalsDisplay = TEXT_TOTAL_ITEMS . $_SESSION['cart']->count_contents() . $item_separator . TEXT_TOTAL_AMOUNT . $currencies->format($_SESSION['cart']->show_total());
          break;
      }
      $content = $totalsDisplay;
    
    /////////////////////////
    // Determine whether displaying as sidebox should be disabled, based on Admin settings under Admin->Configuration->Stock
      $show_shopping_cart_box = true;
      switch (true) {
        case (SHOW_SHOPPING_CART_BOX_STATUS == '0'):
          $show_shopping_cart_box = true;
          break;
        case (SHOW_SHOPPING_CART_BOX_STATUS == '1'):
          if ($_SESSION['cart']->count_contents() > 0 || (isset($_SESSION['customer_id']) && zen_user_has_gv_account($_SESSION['customer_id']) > 0)) {
            $show_shopping_cart_box = true;
          } else {
            $show_shopping_cart_box = false;
          }
          break;
        case (SHOW_SHOPPING_CART_BOX_STATUS == '2'):
          if ( ( ($_SESSION['cart']->count_contents() > 0) || (isset($_SESSION['customer_id']) && zen_user_has_gv_account($_SESSION['customer_id']) > 0) ) && ($_GET['main_page'] != FILENAME_SHOPPING_CART) ) {
            $show_shopping_cart_box = true;
          } else {
            $show_shopping_cart_box = false;
          }
          break;
      }
    ///////////////////////
    
    
      require($template->get_template_dir('tpl_cart_summary.php',DIR_WS_TEMPLATE, $current_page_base,'sideboxes'). '/tpl_cart_summary.php');
    
      if ($box_id !='' && $show_shopping_cart_box == true) {
        $title = '<label>' . BOX_HEADING_CART_CONTENTS . '</label>';
        $title_link = false;
        require($template->get_template_dir($column_box_default, DIR_WS_TEMPLATE, $current_page_base,'common') . '/' . $column_box_default);
      } else {
        if ($show_shopping_cart_box == true)
        require($template->get_template_dir('tpl_box_header.php',DIR_WS_TEMPLATE, $current_page_base,'common'). '/tpl_box_header.php');
      }
    ?>
    Can anyone help me ?

    Thanks

  4. #4
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Shopping cart in header

    You are missing a language file for the mod. Perhaps there is only an /english/ file. If so, you will need to copy and translate it into a /french/ version.

  5. #5
    Join Date
    Jul 2010
    Posts
    24
    Plugin Contributions
    0

    Default Re: Shopping cart in header

    Oops, my bad... Many thanks, it works !

 

 

Similar Threads

  1. v150 Add a View Cart link to my shopping cart header, in 12leaves template?
    By Serg in forum All Other Contributions/Addons
    Replies: 10
    Last Post: 22 Aug 2012, 02:49 AM
  2. Shopping Cart and Items in Cart in the Header
    By sendmenews in forum General Questions
    Replies: 10
    Last Post: 25 Oct 2011, 02:09 AM
  3. Show number of products in cart by shopping cart in header
    By robertwhitis in forum Templates, Stylesheets, Page Layout
    Replies: 11
    Last Post: 27 Mar 2011, 07:15 PM
  4. Shopping Cart Header
    By helpme in forum Addon Templates
    Replies: 1
    Last Post: 2 Feb 2011, 11:08 PM
  5. Shopping cart in header
    By shopyoungway in forum General Questions
    Replies: 25
    Last Post: 12 Apr 2009, 10:01 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR