我有一辆购物车,里面有零售和批发产品。最初,它只是批发,我们删除了付款网关,而购物车只需发送一封电子邮件,而不需要付款。
现在我们只需要为零售产品启用支付网关。我尝试了下面,它显示了零售和批发类别的支付网关。
帮助感激。
原始代码
Disable all payment gateways on the checkout page and replace the "Pay" button by "Place order"
add_filter( 'woocommerce_cart_needs_payment', '__return_fals
我安装了一个WooCommerce WordPress主题。
我得到了一个公共用户可以看到的错误,所以我需要尽快修复它。
错误显示在所有产品页面上,以下是错误:
Warning: sizeof (): Parameter must be an array or an object that implements Countable
以下是相关代码:
global $product, $post, $smof_data;
$cat_count = sizeof(get_the_terms($post->ID, 'product_cat'));
$tag_count = si
我试图在WooCommerce中获取或列出当前产品的所有类别名称或in。
使用以下代码:我获得了指向类别的整个链接,但我需要它们的名称或ID。
<?php
// Get list of ALL categories for current product
$cats = wc_get_product_category_list( $id );
var_dump($cats);
?>
我想要类别的名称、或I,这样我就可以使用它们来迭代。