Forum
Shop: cart-property set by select field
Is it possible to set a cart-property trough a select field?
i tried it like this:
<label for="gateway">Wähle deine Zahlart:</label>
<select name="gateway" id="gateway">
<option value="paypal" cart-property="paypal">PayPal</option>
<option value="vorkasse" cart-property="vorkasse">Vorkasse</option>
</select>
//ZAHLART AUSGEBEN
if (perch_shop_cart_has_property('paypal')) {
echo 'Paypal';
}
else if (perch_shop_cart_has_property('vorkasse')) {
echo 'vorkasse';
}
else {
echo 'didnt work';
but it didnt work out.
You can't set a cart property using an unmanaged field like that - Perch won't be looking for it.
You can, should be able to, set a property using a
perch:input
field, but you'd be setting one property with a different value based on the option chosen.