价格未在导航中更新(前端)

时间:2017-05-24 10:27:18

标签: woocommerce woocommerce-theming

我已复制http://demo.woothemes.com/boutique/product/woo-ninja-3/

中的代码
<ul id="site-header-cart" class="site-header-cart menu">
            <li class="">
                                                    <a class="cart-contents" href="http://demo.woothemes.com/boutique/cart/" title="View your shopping cart">
                <span class="amount">£168.00</span> <span class="count">12 items</span>
            </a>


                    </li>
            <li>
                <div class="widget woocommerce widget_shopping_cart" style="opacity: 1;"><div class="widget_shopping_cart_content">

<ul class="cart_list product_list_widget ">


                            <li class="mini_cart_item">
                        <a href="http://demo.woothemes.com/boutique/cart/?remove_item=fbd7939d674997cdb4692d34de8633c4&amp;_wpnonce=ab5f6b26c4" class="remove" title="Remove this item" data-product_id="76" data-product_sku="">×</a>                                                  <a href="http://demo.woothemes.com/boutique/product/woo-ninja-3/">
                                <img width="150" height="150" src="//demo.woothemes.com/boutique/wp-content/uploads/sites/79/2013/06/6771456709_fc540cc175_b.jpg?w=150&amp;h=150&amp;crop=1" class="attachment-shop_thumbnail size-shop_thumbnail wp-post-image" alt="" srcset="//demo.woothemes.com/boutique/wp-content/uploads/sites/79/2013/06/6771456709_fc540cc175_b-150x150.jpg 150w, //demo.woothemes.com/boutique/wp-content/uploads/sites/79/2013/06/6771456709_fc540cc175_b-500x500.jpg 500w, //demo.woothemes.com/boutique/wp-content/uploads/sites/79/2013/06/6771456709_fc540cc175_b-800x800.jpg 800w" sizes="(max-width: 150px) 100vw, 150px">Woo Ninja&nbsp;                         </a>

                        <span class="quantity">6 × <span class="woocommerce-Price-amount amount"><span class="woocommerce-Price-currencySymbol">£</span>15.00</span></span>                 </li>
                                        <li class="mini_cart_item">
                        <a href="http://demo.woothemes.com/boutique/cart/?remove_item=7cbbc409ec990f19c78c75bd1e06f215&amp;_wpnonce=ab5f6b26c4" class="remove" title="Remove this item" data-product_id="70" data-product_sku="">×</a>                                                  <a href="http://demo.woothemes.com/boutique/product/flying-ninja/">
                                <img width="150" height="150" src="//demo.woothemes.com/boutique/wp-content/uploads/sites/79/2013/06/6771457369_92e02576a8_o.jpg?w=150&amp;h=150&amp;crop=1" class="attachment-shop_thumbnail size-shop_thumbnail wp-post-image" alt="" srcset="//demo.woothemes.com/boutique/wp-content/uploads/sites/79/2013/06/6771457369_92e02576a8_o-150x150.jpg 150w, //demo.woothemes.com/boutique/wp-content/uploads/sites/79/2013/06/6771457369_92e02576a8_o-500x500.jpg 500w" sizes="(max-width: 150px) 100vw, 150px">Flying Ninja&nbsp;                          </a>

                        <span class="quantity">4 × <span class="woocommerce-Price-amount amount"><span class="woocommerce-Price-currencySymbol">£</span>12.00</span></span>                 </li>
                                        <li class="mini_cart_item">
                        <a href="http://demo.woothemes.com/boutique/cart/?remove_item=735b90b4568125ed6c3f678819b6e058&amp;_wpnonce=ab5f6b26c4" class="remove" title="Remove this item" data-product_id="67" data-product_sku="">×</a>                                                  <a href="http://demo.woothemes.com/boutique/product/ship-your-idea-3/">
                                <img width="150" height="150" src="//demo.woothemes.com/boutique/wp-content/uploads/sites/79/2013/06/6771457549_3838523969_b.jpg?w=150&amp;h=150&amp;crop=1" class="attachment-shop_thumbnail size-shop_thumbnail wp-post-image" alt="" srcset="//demo.woothemes.com/boutique/wp-content/uploads/sites/79/2013/06/6771457549_3838523969_b-150x150.jpg 150w, //demo.woothemes.com/boutique/wp-content/uploads/sites/79/2013/06/6771457549_3838523969_b-500x500.jpg 500w" sizes="(max-width: 150px) 100vw, 150px">Ship Your Idea Silver Plated Ring&nbsp;                         </a>

                        <span class="quantity">2 × <span class="woocommerce-Price-amount amount"><span class="woocommerce-Price-currencySymbol">£</span>15.00</span></span>                 </li>


</ul><!-- end product list -->


    <p class="total"><strong>Subtotal:</strong> <span class="woocommerce-Price-amount amount"><span class="woocommerce-Price-currencySymbol">£</span>168.00</span></p>


    <p class="buttons">
        <a href="http://demo.woothemes.com/boutique/cart/" class="button wc-forward">View Cart</a>
        <a href="http://demo.woothemes.com/boutique/checkout/" class="button checkout wc-forward">Checkout</a>
    </p>


</div></div>            </li>
        </ul>

进入我自己的模板;但是由于某种原因,小部件正在更新数据,如下所示,“购物车内容”区域不会更新金额和项目数。

<li class="">
    <a class="cart-contents" href="http://demo.woothemes.com/boutique/cart/" title="View your shopping cart">
        <span class="amount">£168.00</span> <span class="count">12 items</span>
    </a>
</li>

如何解决我的问题?我假设有些js丢失了?

1 个答案:

答案 0 :(得分:0)

WooCommerce要求您在其方法中添加购物车区域。

有关它的更多信息,请参阅以下内容: https://docs.woocommerce.com/document/show-cart-contents-total/