Shop Hosting
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: Warenkorb im Header abschalten wenn Warenkorb leer?!

    XTCM-User

    • Frisch an Board
    • Beiträge: 61
    Hallo,
    bei mir hat der Einbau des Warenkorbs im Header nach Torstens Anleitung super geklappt.
    Ich würde jedoch gerne die ganze Box abschalten solange der Warenkorb leer ist, so das nichts mehr davon im Header zu sehen ist, auch nicht die cart.png.

    Hat jemand eine Idee wie der Code der box_cart.html bzw. der Stylesheet.css zu ändern ist.
    Gruß
    Marc



    Linkback: https://www.modified-shop.org/forum/index.php?topic=8616.0
    Marktplatz - Eine große Auswahl an neuen und hilfreichen Modulen sowie modernen Templates für die modified eCommerce Shopsoftware

    TF101

    • Fördermitglied
    • Beiträge: 165
    • Geschlecht:
    Warenkorb im Header abschalten wenn Warenkorb leer?!
    Antwort #1 am: 10. Oktober 2010, 10:42:56
    Hi,

    theoretisch müßte es reichen wenn Du in der box_cart.html
    im Abschnitt <!-- cart has no content -->

    den Teil:

    Code: PHP  [Auswählen]
    <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}>
                            <p><strong>0</strong> {#text_article#} | {#text_total#}: <strong>0,00 {$smarty.session.currency}</strong>{*#text_empty_cart#*}</p>
                    </div>
    löschst.

    Ist aber nicht getestet.

    Grüße
    Tom

    Modulfux

    • Experte
    • Beiträge: 3.590
    • Geschlecht:
    Warenkorb im Header abschalten wenn Warenkorb leer?!
    Antwort #2 am: 10. Oktober 2010, 11:35:44
    @Tom
    Das funktioniert nicht, weil du somit nur den Textinhalt des leeren Warenkorbes ausblendest und der div-Container aber weiterhin dargestellt wird.

    Hier die Lösung anhand der originalen Warenkorbbox des xtc5-Template:
    Original:

    Code: PHP  [Auswählen]
    {config_load file="$language/lang_$language.conf" section="boxes"}
    {if $deny_cart neq 'true'}
    <h2 class="boxcartheader">{#heading_cart#}</h2>
    <div{if $GV_AMOUNT =='' } class="boxcartbody" {else} class="boxcartbody"{/if}>
    {if $ACTIVATE_GIFT=='true'}
    {if $GV_AMOUNT neq ''}
    <p><strong>{#voucher_balance#}</strong> {$GV_AMOUNT}</p>
    <div class="hr"></div>
    {/if}
    {/if}
    {if $empty=='false'} <!-- cart has content -->
    {foreach name=aussen item=products_data from=$products}
    <p>{$products_data.QTY} x <a href="{$products_data.LINK}">{$products_data.NAME|truncate:20:"...":true}</a></p>
    {/foreach}
    <div class="hr"></div>
    <p style="text-align:right">{if $DISCOUNT}{#text_discount#} {$DISCOUNT}<br />{/if}
    {$UST}
    <strong>{#text_total#}:{$TOTAL}</strong><br />
    {if $SHIPPING_INFO}{$SHIPPING_INFO}{/if}</p>
    <div class="hr"></div>
    <p style="text-align:right;"><a href="{$LINK_CART}"><strong>{#heading_cart#} »</strong></a></p>
    {else} <!-- cart has no content -->
    <p>{#text_empty_cart#}</p>
    {/if}
    </div>
    {/if}
     
    geändert:

    Code: PHP  [Auswählen]
    {config_load file="$language/lang_$language.conf" section="boxes"}
    {if $deny_cart neq 'true'}
    {if $empty=='false'} <!-- cart has content -->
    <h2 class="boxcartheader">{#heading_cart#}</h2>
    <div{if $GV_AMOUNT =='' } class="boxcartbody" {else} class="boxcartbody"{/if}>
    {if $ACTIVATE_GIFT=='true'}
    {if $GV_AMOUNT neq ''}
    <p><strong>{#voucher_balance#}</strong> {$GV_AMOUNT}</p>
    <div class="hr"></div>
    {/if}
    {/if}
    {foreach name=aussen item=products_data from=$products}
    <p>{$products_data.QTY} x <a href="{$products_data.LINK}">{$products_data.NAME|truncate:20:"...":true}</a></p>
    {/foreach}
    <div class="hr"></div>
    <p style="text-align:right">{if $DISCOUNT}{#text_discount#} {$DISCOUNT}<br />{/if}
    {$UST}
    <strong>{#text_total#}:{$TOTAL}</strong><br />
    {if $SHIPPING_INFO}{$SHIPPING_INFO}{/if}</p>
    <div class="hr"></div>
    <p style="text-align:right;"><a href="{$LINK_CART}"><strong>{#heading_cart#} »</strong></a></p>
    </div>
    {/if}
    {/if}
     
    Somit wird ein leerer Warenkorb erst garnicht eingeblendet.

    Gruß
    Ronny

    zub

    • Schreiberling
    • Beiträge: 401
    Warenkorb im Header abschalten wenn Warenkorb leer?!
    Antwort #3 am: 10. Oktober 2010, 11:36:53
    @ modified eCommerce Shopsoftware-User
    ändere in der templates/source/boxes.php
    die Zeile

    Code: PHP  [Auswählen]
    if ($_SESSION['customers_status']['customers_status_show_price'] == 1) include(DIR_WS_BOXES . 'shopping_cart.php');
     
    in

    Code: PHP  [Auswählen]
    if ($_SESSION['cart']->count_contents()> 0) include(DIR_WS_BOXES . 'shopping_cart.php');
     
    Gruß
    zub

    Modulfux

    • Experte
    • Beiträge: 3.590
    • Geschlecht:
    Warenkorb im Header abschalten wenn Warenkorb leer?!
    Antwort #4 am: 10. Oktober 2010, 11:47:12
    @zub
    Ich glaube, damit wird aber je nach Kundenstatus ein neues Problem auftauchen. Wäre es nicht sinnvolle deine Lösung in eine Zeile zu packen, also so?:

    Code: PHP  [Auswählen]
    if ($_SESSION['customers_status']['customers_status_show_price'] == 1 && $_SESSION['cart']->count_contents()> 0) include(DIR_WS_BOXES . 'shopping_cart.php');
     
    *ungetestet*

    Gruß
    Ronny

    XTCM-User

    • Frisch an Board
    • Beiträge: 61
    Warenkorb im Header abschalten wenn Warenkorb leer?!
    Antwort #5 am: 29. Oktober 2010, 16:12:16
    Also ich habe es jetzt so lösen können!

    stylesheet.css

    Code: CSS  [Auswählen]
    #header #cart {
            z-index: 2;
        position: absolute;
            width: 980px;
            height: 120px;
            top: 10px;
            color: #fff;
            outline: none;
    }
    #header #cart a {      

    }
    #header #cart h2 {
        font-size: 20px;
            color: #fff;
            margin-left: 12px;
            margin-top: 12px;
    }
    #header #cart h3 {
        font-size: 16px;
            color: #fff;
            margin-left: 12px;
            margin-top: 9px;
    }
    #header #cart_not_empty {
            position: absolute;
            background: url(img/cart.png) no-repeat;
            width: 980px;
            height: 120px;
            margin-top: 19px;
            margin-left: 760px;
    }
     
    index.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'}
            <div id="cart_not_empty">
                    <a href="{$LINK_CART}"><h2 class="boxcartheader-menu"><strong>{#link_cart#}:</strong></h2>
                    <div{if $GV_AMOUNT =='' } class="boxcartbody-menu" {else} class="boxcartbody-menu"{/if}>
                <h3><strong>{#text_article#}: {$PRODUCTS} {#text_unit#}</strong>  <br /> {#text_total#}:     <strong>{$TOTAL}</strong></h3>
                    </div>
                    </a>
            </div>
        {else} <!-- cart has no content -->
            <a id="cart_empty" href="{$index}"></a>
    {/if}

        {if $ACTIVATE_GIFT=='true'}
            {if $GV_AMOUNT neq ''}
                <div class="boxcartbody-menu">{#voucher_balance#} <strong>{$GV_AMOUNT}</strong></div>
           {/if}
        {/if}
    {/if}
     
    [ Für Gäste sind keine Dateianhänge sichtbar ]

    Managed Server
    2 Antworten
    2557 Aufrufe
    02. August 2010, 19:02:17 von Haina
    17 Antworten
    12843 Aufrufe
    30. Juni 2013, 09:36:18 von InT-2k
    9 Antworten
    6214 Aufrufe
    03. August 2010, 14:22:56 von Tomcraft
               
    anything