WooCommerce 商店页面:添加到购物车按钮上的数量输入 [英] WooCommerce Shop page: Quantity input on add to cart button

查看:58
本文介绍了WooCommerce 商店页面:添加到购物车按钮上的数量输入的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用带有 WooCommerce 插件的 Divi 主题.在商店页面中,我想直接在 添加到购物车 按钮上进行数量调整.

I'm using the Divi theme with WooCommerce plugin. In shop page, I would like to have the quantities adjustments directly on add to cart button .

我的网站

目前您必须点击产品才能进入单个产品页面,然后才能添加到购物车.

Presently you have to click on the product to go in to single product page and only then is it possible to add to cart.

我试图弄清楚是什么产生了产品列表,以便我可以修改它,但正如您可能猜到的那样,我对此很陌生.

I have tried to figure out what produces the list of products so that I can modify it, but as you probably guessed I'm very new to this.

如何在购物页面产品中添加该功能?

How can I add that functionality the to shop page products?

推荐答案

所以我最终做的是将单页添加到购物车操作添加到商店页面循环的钩子中,如下所示:

So what I ended up doing was adding the single page add to cart action to a hook for the shop page loop as follows:

add_action('woocommerce_after_shop_loop_item',
           'woocommerce_template_single_add_to_cart', 30);

谢谢.

这篇关于WooCommerce 商店页面:添加到购物车按钮上的数量输入的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆