简体   繁体   English

如何在woocommerce的购物车中添加总计?

[英]How can I add a grand total in a shopping cart in woocommerce?

This is the code of my shopping cart subtotals (item x qty): 这是我的购物车小计(项目x数量)的代码:

<?php
      echo apply_filters( 'yith_ywraq_hide_price_template' ,
WC()->cart->get_product_subtotal( $_product, $raq['quantity'] ));
?>

How can I add a grand total? 如何添加总计? (sum of all subtotals) (所有小计的总和)

Thank you! 谢谢!

You can post more ( relevant ) code to have more possibilities of answers, but if you create a method in WC()->cart Maybe can calculate the total amount. 您可以发布更多( 相关的 )代码来获得更多的答案,但是,如果在WC()->cart创建方法,也许可以计算总数。 WC()->cart->get_total_amout()

I think because WC()->cart can handle with your basket. 我认为是因为WC()->cart可以处理您的购物篮。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在woocommerce中为购物车总额添加折扣? - How can I add a discount to the cart total in woocommerce? 在Woocommerce的总数中增加一个百分比 - Add a percentage to the grand total in Woocommerce Magento | 我如何在自定义模块中的购物车中添加产品? - Magento | How i can add a product in shopping cart in a custom module? 无法获得购物车的总计PHP / MySQL - cant get grand total of a shopping cart PHP/MySQL 如何在 WooCommerce 中的“查看购物车”按钮旁边添加“继续购物”按钮? - How to add "Continue Shopping" button next to "View Cart" button in WooCommerce? 我如何编写一个算法来使用 php $_SESSION 乘以购物车中的总*数量? - how can i write an algorithm to multiply the total * quantity in a shopping cart using php $_SESSION? $ _session的购物车并发送产品名称和数量我如何同时发送总成本 - shopping cart using $_session and send product name and quantity how can I send total cost at same time 我如何通过电子邮件发送此购物车数组? - How can I email this shopping cart array? 根据费用有条件地自定义WooCommerce购物车的总计输出 - Conditionally customize WooCommerce cart grand total output based on a fee 将数量选择添加到 woocommerce 购物车小部件 - add quantity select to woocommerce shopping cart widget
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM