WooCommerce: See If Product ID Belongs To a Grouped Product

Grouped Products are part of WooCommerce core and let you “add similar (think materials, design, etc.) products to a single grouped product. This allows the customer to add products […] to their cart on one page instead of navigating to several different pages to do so” (WooCommerce docs).

It may happen during your coding career that you need to know whether a given Product ID is part of a Grouped Product (so, it’s a “child” of a Grouped Product) – the snippet below will help with that. Enjoy!

Continue reading WooCommerce: See If Product ID Belongs To a Grouped Product

WooCommerce: Custom Add to Cart URLs – The Ultimate Guide

In WooCommerce you can add a product to the cart via a custom link. You just need to use the “add-to-cart” URL parameter followed by the product ID.

This tutorial will show you how to create custom URLs to add simple, variable and grouped products to the cart – as well as defining the add to cart quantity and an optional redirect.

You will be able to see each possible scenario, and also copy/paste the custom URLs so that you only need to replace product IDs and quantities.

I strongly recommend you read through all the post comments in case you’re not sure about something – many people have asked the same questions over and over again e.g. “Is it possible to add more than 1 product to the cart?” (to which the answer is “no”, unless you install a custom plugin) or “Why does my product get added twice?

With this guide it’s much easier to place WooCommerce add to cart buttons on custom landing pages, pricing tables, blog posts, external websites, and so on. Enjoy!

Continue reading WooCommerce: Custom Add to Cart URLs – The Ultimate Guide