spree_flexi_variants icon indicating copy to clipboard operation
spree_flexi_variants copied to clipboard

amount_times_constant calculations

Open Ruekompa opened this issue 11 years ago • 7 comments

Instead of using the entire field as the obj to calculate an amount, it adds each letter and acts like the 'engraving' calculator.

Ruekompa avatar Jun 27 '13 13:06 Ruekompa

Hello @Ruekompa,

Please provide the information requested in the Contributing Guide for Spree, under the heading "Filing an Issue".

Thank you.

radar avatar Jun 28 '13 05:06 radar

I solved this particular issue by removing .val() from the file _amount_times_constant.html.erb from: return <%= calculator.preferred_multiplier %> * $(obj).val().length; to: return <%= calculator.preferred_multiplier %> * $(obj).length;

Ruekompa avatar Jun 28 '13 18:06 Ruekompa

@Ruekompa I'd like to request the information from the Contributing Guide again. Please provide this information so that we know exactly what is going wrong so that we can accurately fix this problem.

Thank you.

radar avatar Jun 30 '13 23:06 radar

Alright @radar, I will do so when I get a little extra time. I was on the road a week for work and back now. So I'll try and get this done by the end of the night. Thanks for all the work you and the others have done.

Ruekompa avatar Jul 01 '13 15:07 Ruekompa

Alrighty, excellent. Thanks for letting us know @Ruekompa :)

radar avatar Jul 03 '13 06:07 radar

Spree Stable-1-3 Rails 3.2.13

Extensions: spree_gateway spree_auth_devise spree_static_content spree_fancy spree_flexi_variants

Using the extension "Flexi Variants" creates a page in the /admin console called "Customization Types".

Clicking on "New Product Customization Type" button takes you to the form fields: Name, Presentation, Description and Calculator.

The "Amount Times Constant Calculator" is where you set your value. In application it behaves like the "Engraving Calculator", which sums each letter. While instead it should give a value to the entire field.

You apply the "Customization Types" with a new or Existing Product. Within your 'edit product' section On the right hand column there is a section that is again titled, "Customization Types." This section will allow you to add your previously created customization types by clicking "Add Product Customization Type."

the view is at "/product/name_of_product"

When filling in the fields each letter is summed in the total, which is calculated above.

in the file

"_amount_times_constant.html.erb"

When removing .val() and changing the line from:

'''return <%= calculator.preferred_multiplier %> * $(obj).val().length;'''

to:

'''return <%= calculator.preferred_multiplier %> * $(obj).length;'''

This above line change calculates the entire field; however, I don't know if that is a legitimate fix.

Another issue which I will file separate is that the fields do not maintain the amount you assign in the 'Customization Types" options. After you restart the rails app the first option inherits the 2nd options amount.

Ruekompa avatar Jul 03 '13 13:07 Ruekompa

I'm hoping to take a look at this soon

jsqu99 avatar Nov 08 '13 17:11 jsqu99