本文整理匯總了PHP中wc_cart_totals_coupon_html函數的典型用法代碼示例。如果您正苦於以下問題:PHP wc_cart_totals_coupon_html函數的具體用法?PHP wc_cart_totals_coupon_html怎麽用?PHP wc_cart_totals_coupon_html使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了wc_cart_totals_coupon_html函數的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: foreach
</td>
</tr>
<?php
foreach (WC()->cart->get_coupons() as $code => $coupon) {
?>
<tr class="cart-discount coupon-<?php
echo esc_attr(sanitize_title($code));
?>
">
<th><?php
wc_cart_totals_coupon_label($coupon);
?>
</th>
<td><?php
wc_cart_totals_coupon_html($coupon);
?>
</td>
</tr>
<?php
}
?>
<?php
if (WC()->cart->needs_shipping() && WC()->cart->show_shipping()) {
?>
<?php
do_action('woocommerce_review_order_before_shipping');
?>
示例2: esc_html
<th><?php echo esc_html( $tax->label ); ?></th>
<td><?php echo wp_kses_post( $tax->formatted_amount ); ?></td>
</tr>
<?php endforeach; ?>
<?php else : ?>
<tr class="tax-total">
<th><?php echo esc_html( WC()->countries->tax_or_vat() ); ?></th>
<td><?php echo wc_price( WC()->cart->get_taxes_total() ); ?></td>
</tr>
<?php endif; ?>
<?php endif; ?>
<?php foreach ( WC()->cart->get_coupons( 'order' ) as $code => $coupon ) : ?>
<tr class="order-discount coupon-<?php echo esc_attr( $code ); ?>">
<th><?php echo $fix_coupon; ?> <?php echo esc_html( $code ); ?></th>
<td><?php wc_cart_totals_coupon_html( $coupon ); ?></td>
</tr>
<?php endforeach; ?>
<?php do_action( 'woocommerce_cart_totals_before_order_total' ); ?>
<tr class="total">
<th><strong><?php echo $order_total_fix; ?></strong></th>
<td><strong><?php wc_cart_totals_order_total_html() ?></strong></td>
</tr>
<?php do_action( 'woocommerce_cart_totals_after_order_total' ); ?>
</tbody>
</table>
<?php if ( WC()->cart->get_cart_tax() ) : ?>
示例3: esc_html
<th><?php echo esc_html( $tax->label ); ?></th>
<td><?php echo wp_kses_post( $tax->formatted_amount ); ?></td>
</tr>
<?php endforeach; ?>
<?php else : ?>
<tr class="tax-total">
<th><?php echo esc_html( WC()->countries->tax_or_vat() ); ?></th>
<td colspan="2"><?php echo wc_price( WC()->cart->get_taxes_total() ); ?></td>
</tr>
<?php endif; ?>
<?php endif; ?>
<?php foreach ( WC()->cart->get_coupons( 'order' ) as $code => $coupon ) : ?>
<tr class="order-discount coupon-<?php echo esc_attr( $code ); ?>">
<th><?php $fix_coupon; ?> <?php echo esc_html( $code ); ?></th>
<td colspan="2"><?php wc_cart_totals_coupon_html( $coupon ); ?></td>
</tr>
<?php endforeach; ?>
<?php do_action( 'woocommerce_review_order_before_order_total' ); ?>
<tr class="total">
<th><?php echo $order_total_fix; ?></th>
<td colspan="2"><strong><?php wc_cart_totals_order_total_html(); ?></strong></td>
</tr>
<?php do_action( 'woocommerce_review_order_after_order_total' ); ?>
</tfoot>
<tbody>
<?php
示例4: woocommerce_cart_totals_coupon_html
/**
* @deprecated
*/
function woocommerce_cart_totals_coupon_html($coupon)
{
wc_cart_totals_coupon_html($coupon);
}
示例5: foreach
</span></li>
<?php
foreach (WC()->cart->get_coupons() as $code => $coupon) {
?>
<ul class="cart-discount coupon-<?php
echo esc_attr(sanitize_title($code));
?>
">
<li><?php
wc_cart_totals_coupon_label(true);
?>
</li>
<li><?php
wc_cart_totals_coupon_html(true);
?>
</li>
</ul>
<?php
}
?>
<li class="cartGrandT"><?php
_e('Total', 'woocommerce');
?>
: <span><?php
wc_cart_totals_order_total_html();
?>
</span></li>
</ul>