4
我目前遇到问题,必须在购物车中添加选项(对于购物车中的每件商品),这将从一个自定义属性中更改商品的价格。通过自定义字段更改购物车中的产品价格,Woocommerce
这是它的一个例证(我已经创建自定义字段,只需要价格更新功能按钮“更新购物车”被点击时)
代码为每个项目显示复选框(/ woocommerce /模板/车/ cart.php):
<td class="product-url">
<?php
$html = sprintf('<div class="lorem"><input type="checkbox" name="cart[%s][lorem]" value="%s" size="4" class="input-text url text" /> Lorem price</div>', $cart_item_key, esc_attr($values['url']));
echo $html;
?>
</td>
代码在等待答案我的解决方案类同这个,反正感谢,我把你的一些代码。 – harisdev