我正在尝试将产品价格移到旁边以添加到购物车按钮。我尝试了以下方法,它将价格移动到按钮下方,而不是添加到购物车按钮旁边。有什么想法吗?
remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_price', 10 );
add_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_price', 30 );
答案 0 :(得分:0)
通常,您将复制woocommerce模板并进行调整。
但是,如果那不可能,您可以尝试其他方法。
在此示例中,我使用的是StoreFront WooCommerce theme
找到woocommerce价格类别名称-这里有woocommerce-Price-amount
并通过在style.css
中添加CSS来重新定位-在这种情况下,我们需要
position: absolute;
transform: translate(281px, 147px);