Jump to content

Create hook to match addon quantity to parent product


Recommended Posts

I asked support the following question

  • "I have created a product, Microsoft Office Business Standard and assigned a product addon for it, (Management). I have made it so the product is scalable, so they can order several but each is not a new instance. I want it so that, if they wish to include the addon, the addon quantity must equal that of the parent. So, if they order 7 office licenses, then they can have management on ALL of them or none of them. Is it possible to sync these two values?"

Support replied,

  • While it is possible to set multiple quantities for each addon as well as primary service, there is currently no way to match addon quantity with parent product quantity without having separate instances of each. With that said, it may be possible to set the quantity equal using a hook within the cart configuration page. As an example, the PreCalculateCartTotals hook may allow you to set this before proceeding to checkout.https://developers.whmcs.com/hooks-reference/shopping-cart/#precalculatecarttotals
    In this scenario, I would recommend reaching out to the Development community to identify if anyone else has completed this same customization and may be able to offer further guidance.

 

So, I am wondering if anyone has any idea how to do this?

Thanks

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated