PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Hook / Javascript to calculate discount

  1. I've spent hours messing with the conditional logic and applying a negative number to formulate a discount but I'm giving up and asking for help. I could not find a hook for PHP and not at all competent in Javascript.

    Here's what I have already:

    Page to display a form where there are 6 different drop down product boxes. These are all products for sale. They vary in number of product items but all have a " please select" and " none $ 0.00" option plus the different products and pricing. The user must and can only select one product per drop down. I want to be able to calculate a 5% discount on the total order if (and only if) at least two of the products are selected from the 6 different drop downs.

    I have a total field displayed on the form and a discount displayed. Unfortunately the way I'm doing it now since we cannot have "IF" conditionals is creating an additional discount products for every combination of product selection and that's worthless. I'll have 30 different discount products before I'm done. I currently only display the discount product if the conditionals are met.

    There's got to be some Javascript and a hook where we can calculate and pass the negative variable back to the discount product but by basing and calculating off selection. Like populating the field dynamically. That's what I really want.

    I don't want to just update the screen total and discount. When it's submitted as an entry I need the calculated fields.

    Step 2: This is not going to PayPal as I use S2Member. I want to be able to direct the user to my appropriate order page based on what they have selected after submission. I have an order page for every combination of products selected to order. My thinking was that based on the values in the products selected we could direct them.

    Step 3: Instead of having a separate order form page for every combination of product purchase I'd like to have one order page and pass the values and shortcode to the page so S2Member can display the PayPal pro form correctly.

    Name: Mike Whitney
    email: dividedsocial@gmail.com

    Please let me know how much and how long.

    Thanks.
    Mike

    Posted 11 years ago on Sunday November 11, 2012 | Permalink

This topic has been resolved and has been closed to new replies.