Skip to content

ConfigurableProduct show prices in select options #17695

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 5 commits into from
Oct 3, 2018
Merged

ConfigurableProduct show prices in select options #17695

merged 5 commits into from
Oct 3, 2018

Conversation

arendarenko
Copy link
Contributor

@arendarenko arendarenko commented Aug 20, 2018

Description

In Magento2 by default we can't show configurable product prices in select options, as it was done in custom options. There only labels with product name there. My improvement fixes that problem.

Manual testing scenarios

  1. Add some configurable products to product in backend. Some options should have different price than another.
  2. Open product page and click on the select which contains allowed products

Expected result:
You can see labels with prices

Actual result:
You can see labels without prices, but when you choose some of label, product price is updating

Contribution checklist

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • All automated tests passed successfully (all builds on Travis CI are green)

- Add feature to show price of customized product in select on product page
@magento-engcom-team
Copy link
Contributor

Hi @alexeya-ven. Thank you for your contribution
Here is some useful tips how you can test your changes using Magento test environment.
Add the comment under your pull request to deploy test or vanilla Magento instance:

  • @magento-engcom-team give me test instance - deploy test instance based on PR changes
  • @magento-engcom-team give me {$VERSION} instance - deploy vanilla Magento instance

For more details, please, review the Magento Contributor Assistant documentation

@VladimirZaets VladimirZaets self-assigned this Aug 20, 2018
@VladimirZaets VladimirZaets self-requested a review August 20, 2018 09:05
@magento-engcom-team
Copy link
Contributor

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

this.options.priceFormat,
1);
}
}
}

if (allowedProducts.length > 0) {
options[i].allowedProducts = allowedProducts;
element.options[index] = new Option(this._getOptionLabel(options[i]), options[i].id);

if (typeof options[i].price !== 'undefined') {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this functionality is never used. Also it has a bug with attribute name (uses prices instead price)

arendarenko and others added 4 commits August 20, 2018 12:33
- Fix isShowSign parameter passing that adds "+" or "-" to the option. Previously there was a bug because this parameter should be boolean.
- Remove unused variable
- Fix code style errors
@magento-engcom-team
Copy link
Contributor

Hi @ihor-sviziev, thank you for the review.
ENGCOM-2832 has been created to process this Pull Request

@VladimirZaets
Copy link
Contributor

Hi @alexeya-ven, thanks for collaboration.
After manual testing we found the next problem:
Notice: Not all labels are with prices.
Steps to reproduce:
Create configurable product with color attribute.
Options should have different price:
red with Price=40
blue with Price=39
green with Price=41
black with Price=42
Open product page and click on the select which contains allowed products.
Actual result: Option that has lowest price is without Price.

@arendarenko
Copy link
Contributor Author

arendarenko commented Aug 31, 2018

Hi @VladimirZaets
I've tried to reproduce this error and found that price is not appearing because by default Magento shows minimal price of product (which is $39), so near this option value it didn't shows any extra-price. In my case it looks like this:
screenshot from 2018-08-31 14-38-08 (two gold-filled spinner has price $39).

@magento-engcom-team
Copy link
Contributor

Hi @alexeya-ven. Thank you for your contribution.
We will aim to release these changes as part of 2.2.8.
Please check the release notes for final confirmation.

Please, consider to port this solution to 2.3 release line.
You may use Porting tool to port commits automatically.

ihor-sviziev added a commit to ihor-sviziev/magento2 that referenced this pull request Oct 4, 2018
danielpfarmer added a commit to danielpfarmer/magento2-1 that referenced this pull request Apr 23, 2019
… decreases on the configurable attribute dropdown. This fixes a bug introduced in PR magento#17695 as detailed on issue magento#22270
amol2jcommerce pushed a commit to amol2jcommerce/magento2 that referenced this pull request Apr 29, 2019
… decreases on the configurable attribute dropdown. This fixes a bug introduced in PR magento#17695 as detailed on issue magento#22270
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