admin管理员组文章数量:1026664
I would like to have "add to cart" button nearby the price like in the picture.
By default, the button is placed after the price in the code, and I would like to move the button in the same tag of the price.
But I don't know which template of Woocommerce I have to edit to make this.
Thank's !
I would like to have "add to cart" button nearby the price like in the picture.
By default, the button is placed after the price in the code, and I would like to move the button in the same tag of the price.
But I don't know which template of Woocommerce I have to edit to make this.
Thank's !
Share Improve this question asked Mar 28, 2019 at 10:06 user10533272user10533272 334 bronze badges1 Answer
Reset to default 2You can change the priority/order by removing and re-adding the parts you want the position changed - like this:
remove_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart', 10 );
add_action( 'woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_add_to_cart', 10 );
Drop this piece of code into your functions.php to take effect.
I would like to have "add to cart" button nearby the price like in the picture.
By default, the button is placed after the price in the code, and I would like to move the button in the same tag of the price.
But I don't know which template of Woocommerce I have to edit to make this.
Thank's !
I would like to have "add to cart" button nearby the price like in the picture.
By default, the button is placed after the price in the code, and I would like to move the button in the same tag of the price.
But I don't know which template of Woocommerce I have to edit to make this.
Thank's !
Share Improve this question asked Mar 28, 2019 at 10:06 user10533272user10533272 334 bronze badges1 Answer
Reset to default 2You can change the priority/order by removing and re-adding the parts you want the position changed - like this:
remove_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart', 10 );
add_action( 'woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_add_to_cart', 10 );
Drop this piece of code into your functions.php to take effect.
本文标签: Move add to cart in Woocommerce
版权声明:本文标题:Move add to cart in Woocommerce 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://it.en369.cn/questions/1745650368a2161280.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论