How To Create An Add To Cart Link From A Woocommerce Product

Written By Mario Salazar

March 1, 2019

Why create an add to cart link?

Creating an add to cart link can be beneficial in many ways, especially when you have a conversion-optimized page that isn’t necessarily a product page.

By adding a product to the cart with a link, you can create a button or even a text hyperlink that adds the product to the visitor’s shopping cart without having them go to an extra product page.

A great example of why you would need to create an add to cart link to your products would be when you create a “top 5 products” blog post. You can display an add to cart button directly on that sales page to get your visitors to purchase that product right away.

Creating an add to cart link with query strings

We will be creating an add to cart link using a very simple query string method. Basically, a query string is a part of the URL that assigns values to specific parameters.

So in order to create the add to cart link, we have 2 parameters to remember: the URL to your cart page and the product ID number.

Start by copying your shopping cart page URL. This is going to be the base url for the query string.

Example: https://www.yourwebsite.com/cart/

Head over to your dashboard and go to the products > all products tab. For this example, we are using the VIP Membership product. Hover over the product to see the product ID number. In this example the product ID number is 147.

Initiate the query string by adding a question mark after the slash, then add the add-to-cart query followed by the equal sign.

So far, it should look like this: “?add-to-cart=”

To tell which product we are adding to the cart, we simply add the product ID number to the end of the query string.

This tells the cart that we are adding that specific product to the shopping cart.

Final Example: https://www.yourwebsite.com/cart/?add-to-cart=147

FOR HELP IN THE CREATION OF YOUR PERFECT WEBSITE...

Keep Flawless In Mind

Related Articles

3 Things You Want on Your Website’s Homepage

Your website’s homepage gives potential clients their first impression of your business and if experts are right, it’d better be a good one. Time-strapped consumers have a short attention span, and they won’t waste their time on a poorly designed website trying to figure out if you can meet their needs — they’ll just move on. How do you make your message clear? With these three things that need to be on every business website homepage.

read more

The Most Powerful Keyword Research Tool On The Market

First of all, don’t spend another penny on another keyword research tool until you’ve read this article. We have purchased and tested over a dozen keyword research tools including Moz Keyword Explorer and Longtail Pro. We’ve even experimented with a ton of freebies like the Google Keyword Planner and Wordstream. From our research and testing, we found that the keywords that these tools spit out generally do more harm for your business than good. We’re going to break down why a majority of these keyword research tools are just taking your money and we’ll also show you the most powerful keyword research tool on the market.

read more

Setting Up A WordPress Chat Plugin With Mobile App… For Free

You see the little blue chat icon in the bottom right corner? I know it doesn’t look like much, but once you click it… Boom. You see some awesome features that you don’t see with other chat software. We set up this WordPress chat plugin with mobile app for ourselves to provide our customers with a quick and easy way to communicate with us, even if we’re not in the office.

read more
0 Comments

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

Pin It on Pinterest