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.

What's the best way to set one of 3 prices depending on another field value?

  1. alex.baskov
    Member

    Hi,

    I'm working on a very simple form, but a bit lost in all these conditional forms, hooks and filters. Could you tell what's the best way to do the following simple thing.

    Clients fill in a form like this http://tripstories.ru/labs/?page_id=17. They have to select how many S, M and L products they need. Then total quantity is calculated (this one works). But then based on total quantity I need to set price. 700 rubles for 30 pieces, 800 for 40 or 900 for 50.

    As far as I understood this can be done by showing 3 various conditional price fields based on total quantity. But also there's another way via hooks & filters.

    Could you tell which option is more preferrable from technical point of view and which hook / filter it's better to use if this option is better?

    Thanks!

    Alex

    Posted 11 years ago on Thursday March 28, 2013 | Permalink
  2. I would use conditional logic and show the pricing total with your calculation there. Which filter or hook were you referring to which can do the same thing?

    Posted 11 years ago on Sunday March 31, 2013 | Permalink
  3. alex.baskov
    Member

    Hi Chris,

    Thanks a lot! Re hooks & filters, I don't remember the name, but as far as I understood some of them are executed before total calculation. So I could add some script that would check total quantity and set price to certain level.

    Alex

    Posted 11 years ago on Monday April 1, 2013 | Permalink
  4. Modifying the prices with JavaScript is tricky sometimes. If modifying the prices with JavaScript were easy, anyone with a browser could do it. So there are protections built in.

    Once you start building your form, please let us take a look and let us know if you need more help with it.

    Posted 11 years ago on Monday April 1, 2013 | Permalink