The Foxy forums are on the move!

We're in the process of moving our forums over to a new system, and so these forums are now read-only.
If you have a question about your store in the meantime, please don't hesitate to reach out to us via email.

Adding price changes to size selection

basically I just want a selection box with sizes that changes the price of the product relevant to the size when an item is placed in the cart. I cant seem to find a simple way to do this .
Tagged:
Comments
  • fc_romanfc_roman Member, FoxyCart Team
    edited June 2016
    Hi @darthvapor,

    Looks like our email response got spammed.

    Here's the copy:

    What you are looking for is Product option modifiers: https://wiki.foxycart.com/v/2.0/cheat_sheet#product_option_modifiers.

    You can modify your Add to cart form to make the product price change depending on the selected options:

    <form action="https://YOURSTORE.foxycart.com/cart" method="post" accept-charset="utf-8">
    <input name="name" value="HLO" type="hidden">
    <input name="price" value="14.99" type="hidden">
    <input name="code" value="0004" type="hidden">
    <label>CONTENT</label>
    <select name="Level">
    <option value="0MG">0MG</option>
    <option value="3MG">3MG</option>
    <option value="6MG">6MG</option>
    <option value="12MG">12MG</option>
    <option value="18MG">18MG</option>
    </select>
    <label>SIZE</label>
    <select name="MLSize">
    <option value="30ML">30ML</option>
    <option value="60ML{p:24.99|c+_60}">60ML</option> // a change here
    <option value="120ML{p:44.99|c+_120}">120ML</option> // a change here
    </select>
    <input value="Add To Cart" type="submit">
    </form>
    For the details of what we did here and how it works, please refer to https://wiki.foxycart.com/v/2.0/cheat_sheet#product_option_modifiers.

    Please note that the product code above is modified along with the price — eg, a 120ML option will appear in the cart with the code 0004_120.

    To prevent this and keep the same code for 30, 60 and 120ML size options, just remove the |c+_xx parts above.

    Please let us know if you have any other questions.
Sign In or Register to comment.