Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

amount_times_constant calculations #78

Open
Ruekompa opened this issue Jun 27, 2013 · 7 comments
Open

amount_times_constant calculations #78

Ruekompa opened this issue Jun 27, 2013 · 7 comments

Comments

@Ruekompa
Copy link

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

@radar
Copy link
Collaborator

radar commented Jun 28, 2013

Hello @Ruekompa,

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

Thank you.

@Ruekompa
Copy link
Author

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;

@radar
Copy link
Collaborator

radar commented Jun 30, 2013

@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.

@Ruekompa
Copy link
Author

Ruekompa commented Jul 1, 2013

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.

@radar
Copy link
Collaborator

radar commented Jul 3, 2013

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

@Ruekompa
Copy link
Author

Ruekompa commented Jul 3, 2013

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.

@jsqu99
Copy link
Owner

jsqu99 commented Nov 8, 2013

I'm hoping to take a look at this soon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants