我们需要有两个审查表-order.php来显示表1中的发票项目和表2中的信用卡采购。
在这里,我有一个基本的概念概述。
<?php if($gateways == 'bacs') { ?>
<div id="order_review">
<table class="shop_table">
<thead>
<tr>
<th class="product-name"><?php _e('Invoice Products', 'yit'); ?></th>
<th class="product-quantity"><?php _e('Qty', 'yit'); ?></th>
<th class="product-total"><?php _e('Totals', 'yit'); ?></th>
</tr>
</thead>表2
<?php if($gateways == 'paypal') { ?>
<div id="order_review">
<table class="shop_table">
<thead>
<tr>
<th class="product-name"><?php _e('Credit Card Products', 'yit'); ?></th>
<th class="product-quantity"><?php _e('Qty', 'yit'); ?></th>
<th class="product-total"><?php _e('Totals', 'yit'); ?></th>
</tr>
</thead>问题是,当将表包装在IF中时,这些表就会完全消失。
如果有人能帮助至少一些更好的想法,这将是非常感谢的。谢谢!
发布于 2013-08-14 14:38:21
您从哪里获得$gateways变量?在不知道的情况下,很难理解为什么您的代码不能工作。但这是获取网关的代码。
$woocommerce->payment_gateways->get_available_payment_gateways();= $available_gateways
foreach ( $available_gateways as $gateway ) {
if ( $gateway->chosen === 'paypal' ) {
// do something
}
// alternative you can try id if that matches
if ( $gateway->id === 'paypal' ) {
// do something
}
}https://stackoverflow.com/questions/18234216
复制相似问题