Jump to content

Price override on config options


dEbo

Recommended Posts

Hi,

i hope somebody from community or WHMCS staff could help with following question.

 

I am trying to override price of the product in cart if some config options is selected (or other definitions).

 

I am able to detect variables with for example:

if productgroup==$somegroupid and configoption.id==$someconfigoptionid

but i could not find how to manipulate the price in ordering process and update it to Order Summary.

 

Yes, there is api to customize the invoice prices after the order is placed, but there is nothing to override price so customer can see the price while ordering.

 

Does anyone know how to approach this issue?

 

Thank you

Link to comment
Share on other sites

depending on where in the order process you're trying to do this, you may not be able using Smarty - it might need jquery.

 

with regards to overriding price, the simplest built-in solution might be a promotional code - if you can detect your conditions to be true, you should be able to add a promo code to the cart automatically.

 

http://docs.whmcs.com/Promotions

Link to comment
Share on other sites

The longer iam looking into this issue the more problems i am running into.

 

Promo code cannot be add while the product is being configured in the cart, moreover promo code cannot be add by an API.

Brian, how exactly were you suggesting to add promo code automatically?

 

Mention hook OrderProductPricingOverride could do the job, except it overrides ALL products in cart, not just the one it is meant to. It overrides SESSION var which is being transferred to other products as well :?:

Link to comment
Share on other sites

The longer I am looking into this issue the more problems I am running into.

that's WHMCS for you! :)

 

Promo code cannot be add while the product is being configured in the cart, moreover promo code cannot be add by an API.

Brian, how exactly were you suggesting to add promo code automatically?

exactly how would depend on the template being used, but I was thinking of either a template change or jquery tweak to pass the promo code in the link... but it was a Saturday afternoon, so I might not have been thinking clearly! :roll:

 

Mention hook OrderProductPricingOverride could do the job, except it overrides ALL products in cart, not just the one it is meant to. It overrides SESSION var which is being transferred to other products as well :?:

although not strictly an override, are you aware that you can price configurable options negatively ?

 

so if you had two radio options, let's call them 'Tom' and 'Jerry' - selecting 'Tom' adds nothing to the overall price as it's price at 0.00, but selecting 'Jerry' reduces the overall price by $10 because it is priced at -10.00 - is that something you can use to help solve your situation? :?:

 

there would be more complicated methods, e.g using jquery to define rules based on config option values, but it's a minefield of issues! :idea:

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