Jump to content

Using custom fields to modify product pricing


robinmacharg

Recommended Posts

When ordering a product I would like to modify the price shown in the cart based on a couple of custom fields. Two fields are necessary (interval - daily, monthly etc) and a number).

 

A user orders a product and provides the two custom field values. The cost is then calculated e.g. like this:

 

 

base_cost + (interval * number * unit_multiplier)

 

 

I *think* the correct place to do this is in the PreCalculateCartTotals hook but can't see how I would modify the product price dynamically since no value is expected to be returned from this hook.

 

Does anyone have any idea how I could go about this? Does this sound like something that requires an API-based custom order page, or does WHMCS support this natively?

 

Thanks for your replies.

 

Robin

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