• Resolved fanpakkin

    (@fanpakkin)


    I am using Woocommerce Memberships plugin on my website.
    I have 2 types of memberships: Compulsory and Selective.
    User cannot purchase Selective unless they already add Compulsory to cart or already bought Compulsory before.

    I’ve try to use Woocommerce dependencies to achieve it but half-failed.

    Say user have not purchased any membership before.

    From the Selective product panel, if I set the dependencies type to “Purchase”, when user try add Selective to cart, an error msg popup and not allow it, which is what I want.

    But if I set the dependencies type to “Ownership” or “Either”, the Selective product could be added to cart, which means it is fail to be restricted.

    Question: How to restrict user to buy Selective if they have not purchased Compulsory before?

    P.S. user must register as free member and login to purchase any type of membership.

    Thanks for your supporting.

    • This topic was modified 4 years, 9 months ago by fanpakkin.
    • This topic was modified 4 years, 9 months ago by fanpakkin.
    • This topic was modified 4 years, 9 months ago by fanpakkin.
Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Jason Kytros

    (@jasonkytros)

    Hey @fanpakkin,

    Thanks for reaching out!

    On our side we do not maintain any compatibility code with WooCommerce Memberships. However, I’d be happy to explain how the Ownership Dependency type works for WooCommerce core Simple Products.

    Let’s assume that there are two products in your store, Hoodie and Beanie and you’d like to allow only customers who have previously purchased the Beanie to purchase the Hoodie. In that case, it is necessary to set up an Ownership dependency.

    When logged in customers click to add the Hoodie to the cart, then Product Recommendations goes through all the previous orders made by this customer and checks if one of them includes the Beanie. If the Beanie has not been purchased before, then a notice will show up and Hoodie will not be added to the cart.

    In your site, are Compulsory and Selective Simple Products? If so, were there any previous orders associated with the customer account you used in your tests?

    Looking forward to your reply!

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

    Thread Starter fanpakkin

    (@fanpakkin)

    Compulsory and Selective are variable products.
    I used a fresh account to test so it has no order history before.

    Plugin Author Jason Kytros

    (@jasonkytros)

    Hey @fanpakkin,

    Thanks for the follow-up!

    To confirm, you have set a Variable Product (let’s call this A) as an Ownership Dependency to another Variable Product (let’s call this B). If you log in as a customer with no previous orders, then you are able to purchase Variable Product B even though you haven’t previously purchased Variable Product A. Is that right?

    If so, then I tried to replicate this issue locally by following these steps and as you can see in this video: https://cl.ly/f7ccc4d1ae6d a notice showed up preventing me from purchasing the Variable Product with the Ownership dependency.

    If this is not what you see, then could you please check that this issue shows up even when only WooCommerce and Product Dependencies are active in your store?

    To avoid causing any problems to your live site, the best way to do this would be to try setting up a staging site, for example using a plugin such as WP Staging or Duplicator — and then troubleshoot the issue on the staging site.

    Note that some hosts provide a Control Panel option for creating development/staging sites easily — if you are not sure about this, it might be worth asking your host as this is definitely the easiest and fastest way to do it.

    Let us know what you find out!

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

    Thread Starter fanpakkin

    (@fanpakkin)

    Dear Jason,

    When I set “Dependency type” to “Purchase”, it works fine, user cannot add the product B to cart unless product A is added to cart.

    But if “Dependency type” set to “Either”, product B could be added to cart even product A has not been added.

    Correct me if wrong, if “Dependency type” set to “Either”, user could not buy Product B unless Product A is purchased before OR already added to cart, right?

    Thread Starter fanpakkin

    (@fanpakkin)

    Dear Jason,

    I found that if the main product name contain special characters like (),:
    the dependency type “Either” will not work.

    I recreate the variable products with the name contain letters only and problem solved!

    Thank you for your great work, the plugin is doing exactly what I want, it works fine with Woocommerce Memberships.

    Hope that in the future update the plugin will allow product name contains special characters.

    • This reply was modified 4 years, 8 months ago by fanpakkin.
    • This reply was modified 4 years, 8 months ago by fanpakkin.
    • This reply was modified 4 years, 8 months ago by fanpakkin.
    • This reply was modified 4 years, 8 months ago by fanpakkin.
    Plugin Author Jason Kytros

    (@jasonkytros)

    Hey @fanpakkin,

    Thanks for the additional details!

    I tried to replicate this issue by following these steps:

    • I created two products: Beanie and Polo (with special characters !.,).
    • In Polo (with special characters !.,) I created an Either product dependency and selected the Beanie: https://cl.ly/ab4d10b66aad.
    • I logged in as a customer without any previous orders.
    • I clicked to add the Polo (with special characters !.,) to the cart and this notice showed up as expected: https://cl.ly/97218e17eb11.

    Could you please provide some more details to help us replicate this issue? Did you notice this issue only with Variable Products? Were these special characters in the Variable Product’s title or in variation titles? Is there a live/staging site where we can view such a Variable Product? If not, could you please share some screenshots in this thread?

    Looking forward to your reply!

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

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Use with Woocommerce Memberships’ is closed to new replies.