THELIA Forum

Welcome to the THELIA support and discusssion forum

Announcement

Rejoignez la communauté sur le Discord Thelia : https://discord.gg/YgwpYEE3y3

Offline


Je suis en train de travailler sur le front-office de notre place de marché.
Pour pouvoir avoir un rendu du panier dans la barre de menu principal, j'ai mis dans \templates\frontOffice\theliaartabanmarketplacetemplatefrontoffice\includes\mini-cart.html le code suivant :

<ul class="nav navbar-nav navbar-cart navbar-right">
    {ifloop rel="cartloop"}
    <li class="dropdown pull-right cart-not-empty cart-container">
        <a href="{url path="/cart"}" rel="nofollow" class="cart">
           <span class="glyphicon glyphicon-shopping-cart" aria-hidden="true"></span> <span class="badge">{cart attr="count_item"}</span>
        </a>
        <div class="dropdown-menu cart-content">
            <form id="form-cart-mini" action="{url path="/order/delivery"}" method="post">
                  <table class="table table-cart-mini">
                    <colgroup>
                        <col width="70">
                        <col>
                        <col width="100">
                    </colgroup>
                    <tbody>
                        {assign "total_price" 0}
                        {loop type="cart" name="cartloop"}
                        <tr>
                            <td class="image">
                                {ifloop rel="pse-first-image"}
                                {loop type="product-sale-elements-image" name="pse-first-image" product_sale_elements_id=$PRODUCT_SALE_ELEMENTS_ID limit="1"}
                                {loop type="image" name="product-image" id=$PRODUCT_IMAGE_ID product=$PRODUCT_ID limit="1" width="118" height="60"}
                                {assign var="product_image_url" value=$IMAGE_URL}
                                <img src="{$IMAGE_URL nofilter}" alt="{$TITLE}">
                                {/loop}
                                {/loop}
                                {/ifloop}
                                {elseloop rel="pse-first-image"}
                                {loop type="image" name="product-image" product=$PRODUCT_ID limit="1" width="118" height="60"}
                                <img src="{$IMAGE_URL nofilter}" alt="{$TITLE}">
                                {/loop}
                                {/elseloop}
                            </td>
                            <td class="product">
                                <h3 class="name" style="margin:0">
                                    {$TITLE}
                                </h3>
                                <a href="{token_url path="/cart/delete/$ITEM_ID"}" class="btn btn-remove" data-tip="tooltip" data-title="Delete" data-original-title=""><i class="fa fa-trash"></i> <span>{intl l="Remove" d="hookcart.fo.default"}</span></a>
                            </td>
                            <td class="unitprice text-center">
                                {if $IS_PROMO == 1}
                                {assign "real_price" $PROMO_TAXED_PRICE}
                                {assign "real_total_price" $TOTAL_PROMO_TAXED_PRICE}
                                {else}
                                {assign "real_price" $TAXED_PRICE}
                                {assign "real_total_price" $TOTAL_TAXED_PRICE}
                                {/if}
                                <span class="qty">{$QUANTITY}</span> X <span class="price" style="font-size:1em;">{format_money number=$real_price}</span>
                                {assign "total_price" $total_price + $real_total_price}
                            </td>
                        </tr>
                        {/loop}
                    </tbody>
                    <tfoot>
                        <tr>
                            <td colspan="2" class="empty">
                                <a href="{url path="/cart"}" role="button" class="btn btn-default btn-sm"><i class="fa fa-eye"></i> {intl l="View Cart" d="hookcart.fo.default"}</a>
                                <a href="{url path="/order/delivery"}" role="button" class="btn btn-primary btn-sm"><i class="fa fa-chevron-right"></i> {intl l="Checkout" d="hookcart.fo.default"}</a>
                                {*<button type="submit" name="checkout" class="btn btn-primary btn-sm">{intl l="Checkout" d="hookcart.fo.default"}</button>*}
                            </td>
                            <td class="total">
                                <div class="total-price">
                                    <span class="price">{format_money number=$total_price}</span>
                                </div>
                            </td>
                        </tr>
                    </tfoot>
                </table>
            </form>
        </div>
    </li>
    {/ifloop}
    {elseloop rel="cartloop"}
    <li class="dropdown pull-right cart-container">
        <a href="{url path="/cart"}" rel="nofollow" class="cart">
           <span class="glyphicon glyphicon-shopping-cart" aria-hidden="true"></span> <span class="badge">0</span>
        </a>
        <div class="dropdown-menu cart-content">
            <p>{intl l="You have no items in your shopping cart." d="hookcart.fo.default"}</p>
        </div>
    </li>
    {/elseloop}
</ul>

Après l'ajout d'un produit dans le panier, j'ai, sur la page html, le code suivant :

......
<ul class="nav navbar-nav navbar-cart navbar-right">
    <li class="dropdown pull-right cart-not-empty cart-container">
    <li class="dropdown pull-right cart-not-empty cart-container">
.......

Et oui, il y a un li imbriqué l'un dans l'autre avec les mêmes classes....
Je pense que c'est un problème d'ajax, mais je ne vois pas du tout où ça se passe.

Si quelqu'un à une piste....
Et bonne année 2019 à tous !