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.

Price modifier used in a form concatenates , rather than adds price

PhilippePhilippe Member
in Help edited May 2016
For example:
The code below, when choosing both options, returns a price of 1451917; rather than 181 (145 + 19 + 17)

<form accept-charset="utf-8" action="https://ourdomain here.foxycart.com/cart" method="post"><input name="name" type="hidden" value="Replacement sail for bug, includes reef" />

<input name="price" type="hidden" value="145&window=Yes{p+19}&Leech=UV Cover{p+17}" />
<input name="category" type="hidden" value="US-DIN" />
<input name="weight" type="hidden" value="4.00" />
<input name="code" type="hidden" value="US-DIN-BUG" />
<select name="window">
<option value="No">No Window </option>
<option value="Yes">Window + $19</option>
</select>
<select name="Leech">
<option value="Standard">Standard Leech</option>
<option value="UV cover">UV Cover + $17</option>
</select>

<input class="button" type="submit" value="Add to cart" /></form>
Comments
  • fc_adamfc_adam FoxyCart Team
    @Philippe,

    Thanks for posting your code. The issue you're running into there is the option modifiers need to be actually embedded in the options rather than on the price. Your form would instead look like this:
    <form accept-charset="utf-8" action="https://ourdomain here.foxycart.com/cart" method="post"><input name="name" type="hidden" value="Replacement sail for bug, includes reef" />

    <input name="price" type="hidden" value="145" />
    <input name="category" type="hidden" value="US-DIN" />
    <input name="weight" type="hidden" value="4.00" />
    <input name="code" type="hidden" value="US-DIN-BUG" />
    <select name="window">
    <option value="No">No Window </option>
    <option value="Yes{p+19}">Window + $19</option>
    </select>
    <select name="Leech">
    <option value="Standard">Standard Leech</option>
    <option value="UV cover{p+17}">UV Cover + $17</option>
    </select>

    <input class="button" type="submit" value="Add to cart" /></form>
  • Thanks, this fixed my issue -was not immediately obvious to me where those modifiers should go!
Sign In or Register to comment.