Jump to content

One-off Products/Services & Domain purchase requires Product/Service


Kian

Recommended Posts

If you have a bit of experience with WHMCS, you know that offering promotions just via coupon codes isn't so flexible.

Many prefer to have products/services created specifically for special deals. Similarly others want to restrict domain purchase to customers with at least a product/service in their accounts. The hook lets you achieve both goals. Simply configure the following variables:

  • $onetimeProducts array of product IDs to treat as "one-off" (customer is not allowed to order the same product multiple times)
  • $onetimeProductGroups same as above but for product group IDs. Producs inside such groups are treated as one-off
  • $firstTimerTollerance product-based restrictions are disabled for new customers placing their first order with you
  • $notRepeatable if a customer already has a one-off product, he can't purchase further one-offs ($firstTimerTollerance is ignored)
  • $domainRequiresProduct domain purchase is allowed only if any of the following conditions is met:
    • Customer has an existing product/service (Pending and Terminated don't count)
    • Customer is purchasing a domain and a product/service
  • $promptRemoval notify customer about restrictions via (previews are below):
    • bootstrap-alert right below Review & Checkout
    • modal on screen
    • js-alert on scren
  • $textDisallowed message displayed for product-based restriction
  • $textRequireProduct message displayed for domain-based resrticion

When the hook detects that the customer is not allowed to order specific products/services and/or domains, it removes them from WHMCS cart showing alerts.

whmcs-domain-require-product-one-off-products-2.png.7daeb3e1bf024cb49d8ca55d38bd2f3d.png

Get the Code »

 

Edited by Kian
Link to comment
Share on other sites

×
×
  • 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