Neuigkeiten
  • Die modified eCommerce Shopsoftware ist kostenlos, aber nicht umsonst.
    Spenden
  • Damit wir die modified eCommerce Shopsoftware auch zukünftig kostenlos anbieten können:
    Spenden
  • Thema: Eine Box duplizieren?

    Rizzm

    • Neu im Forum
    • Beiträge: 9
    Eine Box duplizieren?
    am: 13. April 2014, 17:33:50
    Hallo, ich würde gerne eine box duplizieren um sie dann mit anderem style in der seite einzufügen, ich habe nach einer lösung gesucht und nicht gefunden, vielleicht kann mir jemand weiter helfen?

    Linkback: https://www.modified-shop.org/forum/index.php?topic=29955.0

    noRiddle (revilonetz)

    • Experte
    • Beiträge: 13.988
    • Geschlecht:
    Re: Eine Box duplizieren?
    Antwort #1 am: 13. April 2014, 17:58:01
    Dann helfe ich dir mal finden ;-)

    Eine solche Box kann in der index.html des Templates an gewünschter Stelle eingefügt werden und muß keine "Seitenbox" sein.

    Gruß,
    noRiddle

    Rizzm

    • Neu im Forum
    • Beiträge: 9
    Re: Eine Box duplizieren?
    Antwort #2 am: 15. April 2014, 15:27:24
    also ich will die box mit dem warenkorb in die navileiste unter dem logo reinbringen:

    die umbenannte box_navicart.html:

    Code: PHP  [Auswählen]
    {config_load file="$language/lang_$language.conf" section="index"}
    {config_load file="$language/lang_$language.conf" section="shopping_cart"}
    {config_load file="$language/lang_$language.conf" section="boxes"}
    {if $deny_cart neq 'true'}
            {if $empty=='false'}
                    <h2 class="boxcartheader-menu"><a href="{$LINK_CART}"><strong>{#link_cart#}:</strong></a></h2>
                    <div{if $GV_AMOUNT =='' } class="boxcartbody-menu" {else} class="boxcartbody-menu"{/if}>
                            <a href="{$LINK_CART}"><div id="warenkorb"><strong>{$PRODUCTS}</strong></div> {#text_article#} | {#text_total#}:<strong>{$TOTAL}</strong></a>
                    </div>
            {else} <!-- cart has no content -->
                    <h2 class="boxcartheader-menu"><a href="{$LINK_CART}"><strong>{#link_cart#}:</strong></a></h2>
                    <div{if $GV_AMOUNT =='' } class="boxcartbody-menu" {else} class="boxcartbody-menu"{/if}>
                            <a href="{$LINK_CART}"><div id="warenkorb"><strong>0</strong></div> {#text_article#} | {#text_total#}: <strong>0,00 {$smarty.session.currency}</strong>{*#text_empty_cart#*}</a>
                    </div>
    {/if}
     
            {if $ACTIVATE_GIFT=='true'}
                    {if $GV_AMOUNT neq ''}
                            <div class="boxcartbody-menu">{#voucher_balance#} <strong>{$GV_AMOUNT}</strong></div>
                    {/if}
            {/if}
    {/if}

    und die shopping_navicart.php

    Code: PHP  [Auswählen]
    <?php
      /* -----------------------------------------------------------------------------------------
       $Id: shopping_cart.php 3072 2012-06-18 15:01:13Z hhacker $

       modified eCommerce Shopsoftware
       http://www.modified-shop.org

       Copyright (c) 2009 - 2013 [www.modified-shop.org]
       -----------------------------------------------------------------------------------------
       based on:
       (c) 2000-2001 The Exchange Project  (earlier name of osCommerce)
       (c) 2002-2003 osCommerce(shopping_cart.php,v 1.18 2003/02/10); www.oscommerce.com
       (c) 2003 nextcommerce (shopping_cart.php,v 1.15 2003/08/17); www.nextcommerce.org
       (c) 2006 XT-Commerce (shopping_cart.php 1281 2005-10-03); www.(( Wir dulden keine kommerziellen Werbelinks - Bitte Forenregeln beachten! ))

       Released under the GNU General Public License
       ---------------------------------------------------------------------------------------*/


      $box_smarty = new smarty;

      $box_smarty->assign('tpl_path', 'templates/'.CURRENT_TEMPLATE.'/');

      // define defaults
      $products_in_cart = array ();
      $discount = $qty = 0;
      $total = 0.0;

      // include needed files
      require_once (DIR_FS_INC.'xtc_recalculate_price.inc.php');


      if ($_SESSION['cart']->count_contents() > 0) {

        $total = $_SESSION['cart']->show_total();

        // build array with cart content and count quantity  
        if (strpos($PHP_SELF, FILENAME_LOGOFF) === false) {
          $products = $_SESSION['cart']->get_products();
          $sizeof_products = sizeof($products);
          for ($i = 0, $n = $sizeof_products; $i < $n; $i++) {
            $qty += $products[$i]['quantity'];
            $products_in_cart[] = array ('QTY' => $products[$i]['quantity'],
                                         'LINK' => xtc_href_link(FILENAME_PRODUCT_INFO, xtc_product_link($products[$i]['id'], $products[$i]['name'])),
                                         'NAME' => $products[$i]['name']);
          }
        }

        // sales discount
        if ($_SESSION['customers_status']['customers_status_ot_discount_flag'] == '1' && $_SESSION['customers_status']['customers_status_ot_discount'] != '0.00') {
          if ($_SESSION['customers_status']['customers_status_show_price_tax'] == 0 && $_SESSION['customers_status']['customers_status_add_tax_ot'] == 1) {
            $price = $total-$_SESSION['cart']->show_tax(false);
          } else {
            $price = $total;
          }
          $discount = $xtPrice->xtcGetDC($price, $_SESSION['customers_status']['customers_status_ot_discount']);
          $box_smarty->assign('DISCOUNT', $xtPrice->xtcFormat(($discount * (-1)), $price_special = 1, $calculate_currencies = false));
        }
       
        // generate total price
        if ($_SESSION['customers_status']['customers_status_show_price'] == '1') {
          if ($discount) {
            if ($_SESSION['customers_status']['customers_status_show_price_tax'] == 0 && $_SESSION['customers_status']['customers_status_add_tax_ot'] == 0)
              $total-=$discount;
            if ($_SESSION['customers_status']['customers_status_show_price_tax'] == 0 && $_SESSION['customers_status']['customers_status_add_tax_ot'] == 1)
              $total-=$discount;
            if ($_SESSION['customers_status']['customers_status_show_price_tax'] == 1)
              $total-=$discount;
          }
          $box_smarty->assign('TOTAL', $xtPrice->xtcFormat($total, true));
        }

        $box_smarty->assign('UST', $_SESSION['cart']->show_tax());
        $box_smarty->assign('SHIPPING_INFO', SHOW_SHIPPING == 'true' ? $main->getShippingLink() : '');

      }

      $box_smarty->assign('deny_cart', strpos($PHP_SELF, 'checkout') !== false ? 'true' : 'false'); // no cart at the checkout
      $box_smarty->assign('products', $products_in_cart);
      $box_smarty->assign('PRODUCTS', $qty);
      $box_smarty->assign('empty', $qty > 0 ? 'false' : 'true');
      $box_smarty->assign('ACTIVATE_GIFT', ACTIVATE_GIFT_SYSTEM == 'true' ? 'true' : false);

      // GV Code
      if (isset($_SESSION['customer_id'])) {
        $gv_query = xtc_db_query("-- /templates/".CURRENT_TEMPLATE."/source/boxes/shopping_navicart.php
                                  SELECT amount
                                    FROM "
    .TABLE_COUPON_GV_CUSTOMER."
                                   WHERE customer_id = '"
    .(int)$_SESSION['customer_id']."'");
        $gv_result = xtc_db_fetch_array($gv_query);
        if ($gv_result['amount'] > 0) {
          $box_smarty->assign('GV_AMOUNT', $xtPrice->xtcFormat($gv_result['amount'], true, 0, true));
          $box_smarty->assign('GV_SEND_TO_FRIEND_LINK', '<a href="'.xtc_href_link(FILENAME_GV_SEND).'">');
        }
        if (isset($_SESSION['gv_id'])) {
          $gv_query = xtc_db_query("-- /templates/".CURRENT_TEMPLATE."/source/boxes/shopping_navicart.php
                                    SELECT coupon_amount
                                      FROM "
    .TABLE_COUPONS."
                                     WHERE coupon_id = '"
    .(int)$_SESSION['gv_id']."'");
          $coupon = xtc_db_fetch_array($gv_query);
          $box_smarty->assign('COUPON_AMOUNT2', $xtPrice->xtcFormat($coupon['coupon_amount'], true, 0, true));
        }
        if (isset($_SESSION['cc_id'])) {
          $box_smarty->assign('COUPON_HELP_LINK', '<a target="_blank" class="thickbox" title="Information" href="'.xtc_href_link(FILENAME_POPUP_COUPON_HELP, 'cID='.$_SESSION['cc_id']. '&KeepThis=true&TB_iframe=true&height=400&width=600', $request_type).'">Information</a>');
        }
      }

      $box_smarty->assign('LINK_CART', xtc_href_link(FILENAME_SHOPPING_NAVICART, '', 'NONSSL'));
      $box_smarty->caching = 0;
      $box_smarty->assign('language', $_SESSION['language']);
      $box_shopping_navicart = $box_smarty->fetch(CURRENT_TEMPLATE.'/boxes/box_navicart.html');
      $smarty->assign('box_NAVICART', $box_shopping_navicart);
    ?>

    aber es wird nichts angezeigt, kann mir jemand weiterhelfen?

    noRiddle (revilonetz)

    • Experte
    • Beiträge: 13.988
    • Geschlecht:
    Re: Eine Box duplizieren?
    Antwort #3 am: 15. April 2014, 15:39:35
    Und warum benutzt du nicht diese Anleitung ?
    Eine neue Box ist doch eigtl. nicht nötig.

    Gruß,
    noRiddle

    Rizzm

    • Neu im Forum
    • Beiträge: 9
    Re: Eine Box duplizieren?
    Antwort #4 am: 15. April 2014, 15:47:26
    diese anleitung ist schon im oberen beispiel drin, ich will den warenkorb nämlich 2 mal auf der seite haben. ich will nämlich, dass die navileiste die quer liegt später per javascript auf der seite fixiert. dann hat man immer im blick was im warenkorb abgeht

    Godzilla

    • Schreiberling
    • Beiträge: 489
    Re: Eine Box duplizieren?
    Antwort #5 am: 15. April 2014, 16:25:19
    und wo hakt es jetzt genau, du hast nämlich noch nicht gesagt ob die kopierte box nun angezeigt wird oder nicht oder ob es jetzt nur probleme damit gibt, die box zu fixieren

    Rizzm

    • Neu im Forum
    • Beiträge: 9
    Re: Eine Box duplizieren?
    Antwort #6 am: 15. April 2014, 16:58:51
    habe bereits eine lösung gefunden, und zwar folgend:

    in die datei shopping_cart.php habe ich am ende folgendes hinzugefügt:

    Code: PHP  [Auswählen]
      $box_shopping_cart2 = $box_smarty->fetch(CURRENT_TEMPLATE.'/boxes/box_navicart.html');
      $smarty->assign('box_NAVICART', $box_shopping_cart2);

    danach die box_cart.html dupliziert und umbenannt in box_navicart.html, schon hatte ich zwei verschiedene warenkörbe mit der möglichkeit sie verschieden zu stylen und einzusetzen
    11 Antworten
    5488 Aufrufe
    23. Oktober 2011, 12:53:08 von franky_n
    10 Antworten
    5207 Aufrufe
    23. September 2013, 17:23:50 von except
    1 Antworten
    1800 Aufrufe
    23. Oktober 2013, 07:11:38 von nasenmann
               
    anything