• Based on plugin documentation:

    Ownership: Access is granted only to customers that already own any of the products added to the Product Dependencies field.

    And reading some of the support threads, I’m not 100% clear how the dependencies work.

    It sounds like if I add to two product dependencies, that the person can purchase product if they’ve purchased either one of the two product dependencies.

    Is that right?

    I was hoping to be able to set product dependencies in two ways:

    1. Must have purchased all products set in Product dependencies for some products

    2. Must have purchased any one of the products in product dependencies for other products.

    If can clarify this for me, I would really appreciate it.

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Plugin Author SomewhereWarm

    (@somewherewarm)

    Hey @pixelhappystudio,

    Thanks for reaching out!

    Apologies for taking us so long to get back to you on this! I see that we have replied to threads that were opened after this one, so it is highly possible that this thread fell through the cracks — so sorry about this!

    If you set up an Ownership dependency for a product, then customers must buy at least one of the dependent products in order to purchase the currently viewed product.

    If you’d like to prevent customers from buying the currently viewed product unless they have purchased all of the dependant products, then you can use the following snippet:

    add_filter( 'wc_pd_dependency_relationship', 'sw_pd_force_and_relationship', 10, 2 );
    
    function sw_pd_force_and_relationship( $relationship, $product ) {
    
    	if ( in_array( $product->get_id(), array( 123, 456, ) ) ) {
    		$relationship = 'and';
    	}
    	return $relationship;
    }
    

    To apply this snippet to specific products, please replace 123 and 456 with the IDs of the products to which you’d like to apply this snippet.

    If you are not certain how to use snippets like this, I’d suggest having a look at this plugin — you may find it quite useful as it allows you to manage all your snippets in one place.

    Let me know if this helps!

    Cheers,
    Jason Kytros
    Support Engineer | SomewhereWarm SMPC | https://somewherewarm.com/

Viewing 1 replies (of 1 total)
  • The topic ‘Clarification on dependency settings’ is closed to new replies.