V
V
Vlad2017-04-17 13:50:30
WooCommerce
Vlad, 2017-04-17 13:50:30

How to create a link in Woocommerce to add a product to the cart?

Tell me please.
I have a Wordpress site with Woocommerce enabled. Only 1 item for sale.
I want to make it possible to put a button anywhere on the site, clicking on which will not open a page with a product, but immediately a shopping cart with goods added to it.
Perhaps somehow GET request can be done like /?add_cart&item=1

Answer the question

In order to leave comments, you need to log in

2 answer(s)
Y
Yakov Vylegzhanin, 2017-04-17
@Sc0undRel

/?add-to-cart=123,
where 123 is the product id.

I
izumcity, 2020-11-07
@izumcity

Here is the correct solution
http://supersait.ru/checkout/?add-to-cart=%ID% immediately to checkout
http://supersait.ru/cart/?add-to-cart=%ID% to the cart
Where %ID% = product id.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question