You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In Dancer::Plugin::Interchange6::Routes::Cart::cart_route, there is logic for determining a variant based on the submitted form input. In my case, where the variants are being presented as individual products for purchase (a sort of flattened presentation), this results in an odd situation: since I'm submitting nothing but (sku, quantity), there is no distinguishing feature in the variant search, and no variant is found.
for my $name (keys %$attr_ref) {
$user_input{$name} = param($name);
}
The code above assembles a hash with all the attribute keys, but each of them is an undefined value.
The code above ends up looking through all the attribute values for the product, but since none of them were specified in the input, no variant is found.
My workaround:
if (!grep { defined } values %user_input) {
# No point looking for a variant; we'll just use the product we have.
$cart_product = $product;
}
else { ... ->find_variant etc. }
The text was updated successfully, but these errors were encountered:
In Dancer::Plugin::Interchange6::Routes::Cart::cart_route, there is logic for determining a variant based on the submitted form input. In my case, where the variants are being presented as individual products for purchase (a sort of flattened presentation), this results in an odd situation: since I'm submitting nothing but (sku, quantity), there is no distinguishing feature in the variant search, and no variant is found.
The code above assembles a hash with all the attribute keys, but each of them is an undefined value.
The code above ends up looking through all the attribute values for the product, but since none of them were specified in the input, no variant is found.
My workaround:
The text was updated successfully, but these errors were encountered: