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
The reason is quite obvious: The partial expects a default_price to always be present. The default_price is being determined in solidus/core/app/models/concerns/spree/default_price.rb using, amongst others, the scope with_default_attributes. This in turn uses the configured currency. So if no price exists for the configured currency, no default_price can be found.
I guess a possible solution would be to fix the view partial to not raise an exception (and I would be happy to prepare a PR for that), but I wonder if it should even be possible for a variant to not have a default_price. If no, the actual fix would be quite different.
System configuration
Solidus Version: 2.7.0
Extensions in use:
'solidus_product_assembly'
'solidus_print_invoice'
'solidus_reviews'
The text was updated successfully, but these errors were encountered:
I think not raising an exception is a good idea. I'm not too familiar with doing international stores, so anyone can correct me, but I think people should be able to edit prices for different currencies in this way.
Steps to reproduce
Configure a default currency in
config/initializers/spree.rb
:Log into the admin backend, select a product and on the tab "Variants" add a new variant.
Go to the tab "Prices" and under "Variant Pricing" edit the price of the newly created variant.
Set the Currency to "USD" and save the price.
Go back to the "Variants" tab and edit the variant.
Expected behavior
At the very least, no exception should be raised
Actual behavior
The following exception is raised:
The reason is quite obvious: The partial expects a
default_price
to always be present. Thedefault_price
is being determined insolidus/core/app/models/concerns/spree/default_price.rb
using, amongst others, the scopewith_default_attributes
. This in turn uses the configured currency. So if no price exists for the configured currency, nodefault_price
can be found.I guess a possible solution would be to fix the view partial to not raise an exception (and I would be happy to prepare a PR for that), but I wonder if it should even be possible for a variant to not have a
default_price
. If no, the actual fix would be quite different.System configuration
Solidus Version: 2.7.0
Extensions in use:
The text was updated successfully, but these errors were encountered: