我有一个小的代码来计算购物车总数(不含税),并输出一个免费送货向上销售,如果购物车总数小于50美元。
// Shipping Upsell
/**
* Checks the cart for the Total excluding taxes
* @param $total_required
* @return bool
*/
function qualifies_basedon_cart_total( $total_required ) {
/*
* We only want to run this on the cart or checkout page