Closed jeremygpeterson closed 6 years ago
Could you copy over order_contents_decorator.rb from solidus_flexi_variants and remove line 12 currency: order.currency
and test to see if that fixes the issue?
Same issue, now on line 15.
I got this working by adding new options to Spree::PermittedAttributes.
locally I added them in config/initializers/spree.rb:
Spree::PermittedAttributes.line_item_attributes << :product_customizations```
And in order_contents_decorator.rb I added the following:
options2 = {} options2['ad_hoc_option_values'] = options['ad_hoc_option_values'] options2['product_customizations'] = options['product_customizations'] options2['customization_price'] = options['customization_price'] if options['customization_price']
line_item.options = ActionController::Parameters.new(options2).permit(Spree::PermittedAttributes.line_item_attributes).to_h
At least I got a small fix in place: I've tried building the tests in the gem, see https://github.com/boomerdigital/solidus_flexi_variants/issues/5. What would be our next steps?
I noticed that as well. This really needs a whole refactor and I'd rather not hack it. The parameters should be named and inputted in the form properly. We need to add both product_customizations and ad_hoc_option_value_ids to permitted_attributes. For now if you need a fix you can do that to your project locally but we need a proper fix done on the gem.
I'm definitely up for working on the refactor. I think my pull request earlier today might help us get there. Totally up for direction/redirection on it.
Agreed, I'm happy to help out if needed. I'll use my hack for now, but will certainly update when we fix it.
All, I'm still up for working on a refactor. As ACReilly said, seems like the first step would be handling parameters in a more reliable way. I'll take a crack at it if there are no objections.
Issued a small pull request to get this started.
@acreilly The open pull request resolves the "with_indifferent_access" error. Could you take a look and let me know what you think?
This issue was fixed with https://github.com/boomerdigital/solidus_flexi_variants/pull/10
Creating a new app with solidus and solidus_flexi_variants, I'm unable to a product to cart with an Ad Hoc Option Type.
Steps to Reproduce:
Error Message: undefined method `with_indifferent_access' for #