最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Move add to cart in Woocommerce

programmeradmin2浏览0评论

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 badges
Add a comment  | 

1 Answer 1

Reset to default 2

You 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.

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论