Skip to content

Fix for displaying a negative price for a custom option. #14975

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

Merged
merged 1 commit into from
May 20, 2018
Merged

Fix for displaying a negative price for a custom option. #14975

merged 1 commit into from
May 20, 2018

Conversation

dverkade
Copy link
Member

@dverkade dverkade commented May 3, 2018

Fix for displaying a negative price for a custom option.

Description

Currently a negative price is displayed as +-€ 5,51 for instance. By changing the template to check of the value is actually positive, a negative value will be displayed as -€ 5,51 and a positive value will be displayed as +€ 5,51. When the value is exactly 0 nothing will be displayed after the label.

image
Screenshot displaying the current situation.

Manual testing scenarios

  1. Have a product with a negative price as a custom option
  2. Price in the dropdown will be displayed as -€ 5,51

…negative price is displayed as +- 5.00 for instance. By changing the template to check of the value is actually positive a negative value will be displayed as - 5.00 and a positive value will be displayed as + 5.00
@miguelbalparda miguelbalparda self-assigned this May 3, 2018
@miguelbalparda
Copy link
Contributor

Let's ask the UX team. @DMMundle can you help here?

@soumya-ashok
Copy link

soumya-ashok commented May 7, 2018

@dverkade I'm a UX designer at Magento. Happy to review and help here but need some more info.

  • What version of Magento is this occurring on for you? I'm on a 2.2.2 test instance and it throws an error on the Admin side when I enter a negative value under Customizable Option.
  • What type of product is this - configurable or grouped Or simple with custom options?
  • Could you share a screenshot of the whole screen instead of just the dropdown so we can see where this is happening exactly?

@miguelbalparda
Copy link
Contributor

@magento-engcom-team give me test instance

@magento-engcom-team
Copy link
Contributor

Hi @miguelbalparda. Thank you for your request. I'm working on Magento instance for you

@magento-engcom-team
Copy link
Contributor

Hi @miguelbalparda, here is your Magento instance.
Admin access: https://pr-14975.engcom.dev.magento.com/admin
Login: admin Password: 123123q
Please make sure you are PR author or assignee to access the instance.

@miguelbalparda
Copy link
Contributor

@soumya-ashok can you give it a try in our test instance?

@soumya-ashok
Copy link

soumya-ashok commented May 9, 2018

@miguelbalparda The link redirects me to a PR deployment page, and not the Admin view. Am I doing something wrong?

@dverkade
Copy link
Member Author

dverkade commented May 9, 2018

@soumya-ashok & @miguelbalparda here is some additional information you requested and sorry I couldn't respond sooner.

What version of Magento is this occurring on for you? I'm on a 2.2.2 test instance and it throws an error on the Admin side when I enter a negative value under Customizable Option.

This customer is currently on Magento 2.1.9 (production) upgrade to 2.2.3 is in progress and has the same result.

In Magento 1 custom options could be set to a negative value. This is no longer possible in Magento 2 to enter a negative amount in the admin, although Magento itself works fine by doing so. Only the validation in the admin is limiting this behaviour. There is already an issue for this: #7333

Since this behaviour is not fixed at the moment. The price change for the custom option has been changed in the database to the negative amount. I will create another PR for fixing this issue in de backend of Magento.

What type of product is this - configurable or grouped Or simple with custom options?

It's a simple product with custom options.

Could you share a screenshot of the whole screen instead of just the dropdown so we can see where this is happening exactly?

Here is the link to the production environment for a product with a negative amount as a custom option.
https://www.safedeliveries.nl/m-c-condor-skg3-4-cilinders-met-7-sleutels

Screenshot of how the dropdown looks now:
image

Screenshot of how this currently shows up in the admin:
image

@soumya-ashok
Copy link

@dverkade Thanks for the additional information. I am able to see the +- in the link you shared. Just so I understand - it is currently only negative price values that show up with the +- , correct?

@dverkade
Copy link
Member Author

Hi @soumya-ashok

Correct, only the negative price values show up with the "+-". This PR changes that behaviour. I have included a complete list of scenario's of a positive value, a negative value and no value with the current and the new situation with this PR.

Custom price option of: 5,51
Current situation: + € 5,51
New situation: + € 5,51

Custom price option of: 0,00
Current situation: + € 0,00
New situation: Empty, will not display any amount.

Custom price option of: -5,51
Current situation: +- € 5,51
New situation: - € 5,51

@soumya-ashok
Copy link

@dverkade Thanks for the explanation. Will review and get back to you!

@soumya-ashok
Copy link

@dverkade @miguelbalparda The fix seems fine from a UX perspective. Please do collect any feedback from the merchant once the fix is implemented. Thanks!

@magento-engcom-team
Copy link
Contributor

Hi @miguelbalparda, thank you for the review.
ENGCOM-1552 has been created to process this Pull Request

@magento-engcom-team
Copy link
Contributor

Hi @dverkade. Thank you for your contribution.
Changes from your Pull Request will be available with the upcoming 2.3.0 release.

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

Successfully merging this pull request may close these issues.

4 participants