WooCommerce Product Dependencies

Description

Restrict access to any WooCommerce product, depending on the ownership and/or purchase of other, required products.

Features:

  • Conditional product access based on the ownership and/or purchase of required products.
  • Streamlined admin interface – product dependencies are entered in a dedicated Dependencies tab.
  • Support for multiple product dependencies.
  • Support for “ownership”, “purchase” and “ownership/purchase” dependency types.

Developers can checkout and contribute to the source code on the plugin’s GitHub Repository.

Important: Requires WooCommerce 2.2+. WooCommerce 3.0+ or higher recommended.

Documentation

Dependencies are evaluated when customers attempt to add a product to their cart. If validation fails, the product cannot be added to the cart and a notice is displayed. In order to evaluate “Ownership”-type dependencies, customers are prompted to log in.

Creating Dependencies

To add dependencies to a product:

  • Go to the Product Data > Dependencies tab.
  • Use the Product Dependencies field to search for and add some products and/or variations.
  • Choose a Dependency Type.
  • Update to save your changes.

The “Ownership” dependency type is evaluated by checking if the customer has purchased a required product in a previous order. The “Purchase” dependency type requires the customer to have a required product in the cart in order to purchase the dependent one.

Ownership vs Purchase

The plugin allows you to select between 3 different dependency types:

  • Ownership: Access is granted only to customers that already own any of the products added to the Product Dependencies field.
  • Purchase: The product can be purchased only in combination with any of the items added to the Product Dependencies field. Ownership is not taken into account.
  • Either: Access is granted with ownership or purchase of any item added to the Product Dependencies field.

Screenshots

  • Product dependencies can be created from the Dependencies tab, found under Product Data, and adding products/variations to the Product Dependencies field.
  • If the ownership and/or purchase conditions are not met, products with dependencies cannot be added to the cart and a notification is displayed.

Installation

  1. Download the plugin.
  2. Go to your WordPress Dashboard and then click Plugins > Add New.
  3. Click Upload Plugin at the top.
  4. Click Choose File and select the .zip file you downloaded in Step 1.
  5. Click Install Now and Activate the plugin.

FAQ

Installation Instructions
  1. Download the plugin.
  2. Go to your WordPress Dashboard and then click Plugins > Add New.
  3. Click Upload Plugin at the top.
  4. Click Choose File and select the .zip file you downloaded in Step 1.
  5. Click Install Now and Activate the plugin.

Reviews

great work

work fine and easy to use
tested with wordpress 4.8.2 and woocommerce 3.2
keep going on
thank you

Works like a charm!

This plugin worked GREAT! My client has a subscription website, and I needed a way to limit add-ons to only be added if the main subscription item had already been ordered, or was being ordered. I was looking at WooCommerces add-on feature, but it didn’t work in this way exactly. So I was going to write my own, until I found this gem of a little plugin. It saved me several hours of coding time. Thank you!
Used with: WordPress 4.8, WooCommerce 3.1.1, WooCommerce Subscriptions, and Divi Theme.

Great!

Just installed your plugin in combination with woocommerce sensei and subscriptions and so far it looks like it does exactly what I was looking for, thanks!

Works great – Quick Suggestion

This plugin is exactly what I’ve been looking for. It does what it is supposed to do quite flawlessly and has no conflict with my other plugins or theme.

A few suggestions:

(1) A simple way to customize the dependencies error message. ie. Currently it lists each product that you may add to cart to purchase a dependent product. But when there’s dozens of products that can do this, the error message is massive, listing each one off. It would be nice to be able to customize this note to one’s liking.

(2) Reverse dependencies ie. If you add product x to your cart then you CANNOT purchase product y. You must first remove product x in order to purchase product y.

(3) Quantity based dependencies ie. If you want to purchase product x, you have to purchase at least quantity 5 of product y.

Maybe you could add those features and call it a “Pro” version and sell it. I’d gladly pay money to have those features available.

You're a rock star!!!

I’d been working on developing this functionality for about 5 hours, with many more hours anticipated, and looked for a plugin to put me out of my misery. This was IT! Thank you so much.

Read all 7 reviews

Contributors & Developers

“WooCommerce Product Dependencies” is open source software. The following people have contributed to this plugin.

Contributors

“WooCommerce Product Dependencies” has been translated into 1 locale. Thank you to the translators for their contributions.

Translate “WooCommerce Product Dependencies” into your language.

Interested in development?

Browse the code, check out the SVN repository, or subscribe to the development log by RSS.

Changelog

1.2.1

  • Fix – Products with “Purchase”-type category dependencies cannot be added to the cart although a variation of a product that belongs to the required category has been added to the cart.

1.2.0

  • Feature – Introduced category-based dependencies.
  • Feature – Added custom dependency notices.
  • Feature – Added AND/OR dependency relationship. Can be activated for specific products using the ‘wc_pd_dependency_relationship’ filter.
  • Tweak – Tweaked default notices.

1.1.3

  • Tweak – Updated description.
  • Tweak – Added WooCommerce version headers.

1.1.2

  • Fix – Variable product dependencies not validated correctly in the cart.

1.1.1

  • Fix – Dependencies not working under WC < 3.0 after last update. Fixed!

1.1.0

  • Refactored and cleaned up plugin.
  • Fix – Added support for WooCommerce 3.0.
  • Tweak – Add links to dependent products in notices.

1.0.7

  • Fix – Stray “or” in dependent products list when only one dependency is present.
  • Localization – Added Brazilian Portuguese translation.

1.0.6

  • Fix – PHP array_values warning.

1.0.5

  • Fix – WC 2.3 support.

1.0.4

  • Localization – Added Brazilian translation (robertopc)

1.0.3

  • Fix – Saving bug

1.0.2

  • Fix – WC detection fix

1.0.1

  • Tweak – Styling support for WooCommerce v2 write-panels

1.0

  • Initial release