本文整理汇总了PHP中woocommerce_cart_totals函数的典型用法代码示例。如果您正苦于以下问题:PHP woocommerce_cart_totals函数的具体用法?PHP woocommerce_cart_totals怎么用?PHP woocommerce_cart_totals使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了woocommerce_cart_totals函数的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: woocommerce_ajax_update_shipping_method
function woocommerce_ajax_update_shipping_method()
{
global $woocommerce;
check_ajax_referer('update-shipping-method', 'security');
if (isset($_POST['shipping_method'])) {
$_SESSION['_chosen_shipping_method'] = $_POST['shipping_method'];
}
$woocommerce->cart->calculate_totals();
woocommerce_cart_totals();
die;
}
示例2: woocommerce_ajax_update_shipping_method
/**
* AJAX update shipping method on cart page
*
* @access public
* @return void
*/
function woocommerce_ajax_update_shipping_method()
{
global $woocommerce;
check_ajax_referer('update-shipping-method', 'security');
if (!defined('WOOCOMMERCE_CART')) {
define('WOOCOMMERCE_CART', true);
}
if (isset($_POST['shipping_method'])) {
$woocommerce->session->chosen_shipping_method = $_POST['shipping_method'];
}
$woocommerce->cart->calculate_totals();
woocommerce_cart_totals();
die;
}
示例3: update_shipping_method
/**
* AJAX update shipping method on cart page
*/
public static function update_shipping_method()
{
check_ajax_referer('update-shipping-method', 'security');
if (!defined('WOOCOMMERCE_CART')) {
define('WOOCOMMERCE_CART', true);
}
$chosen_shipping_methods = WC()->session->get('chosen_shipping_methods');
if (isset($_POST['shipping_method']) && is_array($_POST['shipping_method'])) {
foreach ($_POST['shipping_method'] as $i => $value) {
$chosen_shipping_methods[$i] = wc_clean($value);
}
}
WC()->session->set('chosen_shipping_methods', $chosen_shipping_methods);
WC()->cart->calculate_totals();
woocommerce_cart_totals();
die;
}
示例4: do_action
<?php
do_action('woocommerce_after_cart_contents');
?>
</tbody>
</table>
<?php
do_action('woocommerce_after_cart_table');
?>
</form>
<div class="cart-collaterals">
<?php
do_action('woocommerce_cart_collaterals');
?>
<?php
woocommerce_cart_totals();
?>
<?php
woocommerce_shipping_calculator();
?>
</div>
<?php
do_action('woocommerce_after_cart');
示例5: get_cart_totals
/**
* AJAX receive updated cart_totals div.
*/
public static function get_cart_totals()
{
if (!defined('WOOCOMMERCE_CART')) {
define('WOOCOMMERCE_CART', true);
}
WC()->cart->calculate_totals();
woocommerce_cart_totals();
die;
}
示例6: get_cart_totals
/**
* AJAX receive updated cart_totals div.
*/
public static function get_cart_totals()
{
wc_maybe_define_constant('WOOCOMMERCE_CART', true);
WC()->cart->calculate_totals();
woocommerce_cart_totals();
die;
}
示例7: _e
</div>
<?php } ?>
<input type="submit" class="button btn btn-default" name="update_cart" value="<?php _e( 'Update Cart', 'woocommerce' ); ?>" />
<?php do_action( 'woocommerce_cart_actions' ); ?>
<?php wp_nonce_field( 'woocommerce-cart' ); ?>
</td>
</tr>
<?php do_action( 'woocommerce_after_cart_contents' ); ?>
</tbody>
</table>
<?php do_action( 'woocommerce_after_cart_table' ); ?>
</form>
<div class="cart-collaterals">
<?php do_action( 'woocommerce_cart_collaterals' ); ?>
<?php woocommerce_cart_totals(); ?>
</div>
<?php do_action( 'woocommerce_after_cart' ); ?>