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

BUG - values of 0 fail to hash properly due to being considered 'open' fields #87

Closed
mak001 opened this issue Mar 5, 2020 · 3 comments · Fixed by #88
Closed

BUG - values of 0 fail to hash properly due to being considered 'open' fields #87

mak001 opened this issue Mar 5, 2020 · 3 comments · Fixed by #88
Labels
bug Something isn't working

Comments

@mak001
Copy link
Contributor

mak001 commented Mar 5, 2020

Describe the bug
When trying to create a product with the price of 0 instead of the validation returning 0||hash it returns price||hash. This is due to the foxycart validation assuming it is an open (user editable) value.

To Reproduce
Steps to reproduce the behavior:

  1. Create a new product
  2. Enter anything for the SKU
  3. Enter 0 for the Price
  4. Save
  5. Go to the page in the front end
  6. Inspect the form and find the Price input

Expected behavior
Values of 0 that should not be editable by the user should return 0||hash instead of field_name||hash.

Additional Context
Was creating a free product for a promotion that was to be added to the cart with the foxycart js.

Possible solutions
add an open flag to the fc_hash_value function in the thirdparty/foxycart/foxycart.cart_validation.php file.

@mak001 mak001 added the bug Something isn't working label Mar 5, 2020
@muskie9
Copy link
Member

muskie9 commented Mar 24, 2020

I ran across this as well and did "0" for the value and it seemed to work. It might be worth raising a ticket in the FoxyCart repo

@muskie9
Copy link
Member

muskie9 commented Apr 2, 2020

@mak001 does #88 cover products in the CMS that have a price of $0.00 as well?

@mak001
Copy link
Contributor Author

mak001 commented Apr 2, 2020

it would, but i found a better way to fix the fc_hash_value method from thinking "--OPEN--" is equal to 0 or "" in FoxyCart/FoxyCart-Cart-Validation--PHP#16

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants