Closed ghost closed 5 years ago
You're right, the current template prevents using negative price adjustments. Instead of removing the +
from the template I'll only add it if the price adjustment is positive and a +
is not already passed in. This should make it slightly more forgiving since it may seem unintuitive to require the +
symbol for positive numbers.
data-item-custom{{ loop.index }}-options="{% for option in customOption.options -%}
{{ option.name }}[{{ '+' not in option.price and option.price >= 0 ? '+' : '' }}{{ option.price }}]
{%- if not loop.last %}|{% endif %}{% endfor %}"
Thank you, Matt. 🏆
Hello Matt,
in your
buy-now.twig
template, you loop over the prices of each custom option. There I see a hard-coded "+".I wonder if it would make more sense to delete the + from the template and make it a part of the price itself? Isn't there also a chance to decrease the price?
You can see an example here in the Snipcart docs:
https://docs.snipcart.com/configuration/custom-fields#altering-item-prices
Best regards
Mike