Multiple hyphens in sku when adding to cart
Preconditions and environment
- 2.4.6-2.4.7
Steps to reproduce
- Create a simple product
- add custom options either multiselect or checkbox with multiple values (3+)
- Go to the product page and add to cart by selecting 3 or more option values of multiselect / checkbox type.
- Check quote_item table sku column
Expected result
Product sku only
Actual result
Product sku with hyphens on end
Additional information
The problem can be solved by adding a check for null or empty value in the \Magento\Catalog\Model\Product\Option\Type\Select::getOptionSku method.
line 302
eg.
instead of it
$skus[] = $optionSku->getSku();
use
if(!empty($optionSku->getSku())) {
$skus[] = $optionSku->getSku();
}
Release note
No response
Triage and priority
- [ ] Severity: S0 - Affects critical data or functionality and leaves users without workaround.
- [ ] Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
- [ ] Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
- [X] Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
- [ ] Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.
Hi @RetroProgrammist. Thank you for your report. To speed up processing of this issue, make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, Add a comment to the issue:
-
@magento give me 2.4-develop instance- upcoming 2.4.x release - For more details, review the Magento Contributor Assistant documentation.
- Add a comment to assign the issue:
@magento I am working on this - To learn more about issue processing workflow, refer to the Code Contributions.
Join Magento Community Engineering Slack and ask your questions in #github channel. :warning: According to the Magento Contribution requirements, all issues must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting. :clock10: You can find the schedule on the Magento Community Calendar page. :telephone_receiver: The triage of issues happens in the queue order. If you want to speed up the delivery of your contribution, join the Community Contributions Triage session to discuss the appropriate ticket.
Hi @engcom-Bravo. Thank you for working on this issue. In order to make sure that issue has enough information and ready for development, please read and check the following instruction: :point_down:
- [ ] 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).
- [ ] 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue.
- [ ] 3. Add
Area: XXXXXlabel to the ticket, indicating the functional areas it may be related to. - [ ] 4. Verify that the issue is reproducible on
2.4-developbranchDetails
- Add the comment@magento give me 2.4-develop instanceto deploy test instance on Magento infrastructure.
- If the issue is reproducible on2.4-developbranch, please, add the labelReproduced on 2.4.x.
- If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here! - [ ] 5. Add label
Issue: Confirmedonce verification is complete. - [ ] 6. Make sure that automatic system confirms that report has been added to the backlog.
@magento give me 2.4-develop instance
Hi @engcom-Bravo. Thank you for your request. I'm working on Magento instance for you.
Hi @engcom-Bravo, here is your Magento Instance: https://3594027baadf33d34996d5dc446e7612.instances-prod.magento-community.engineering Admin access: https://3594027baadf33d34996d5dc446e7612.instances-prod.magento-community.engineering/admin_f6a8 Login: 043a586a Password: b510db3a2a6a
Hi @RetroProgrammist,
Thank you for reporting and collaboration.
Verified the issue on Magento 2.4-develop instance and the issue is reproducible.Kindly refer the screenshots.
Steps to reproduce
- Create a simple product
- add custom options either multiselect or checkbox with multiple values (3+)
- Go to the product page and add to cart by selecting 3 or more option values of multiselect / checkbox type.
- Check quote_item table sku column
Product sku with hyphens on end
Hence Confirming the issue.
Thanks.
:white_check_mark: Jira issue https://jira.corp.adobe.com/browse/AC-11598 is successfully created for this GitHub issue.
:white_check_mark: Confirmed by @engcom-Bravo. Thank you for verifying the issue.
Issue Available: @engcom-Bravo, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.
I have been chasing this same problem for months as we thought it was caused by a 3rd party module. Only recently have we tied it down to that Select.php file. We are yet to fix this.
From experience, I would argue that the Triage and priority should be S1.
Reason being, when a customer checks out, that SKU is transferred into the sales_order_item table with the extraneous hyphens. Our mailer puts the ordered product details into the email, but as the SKUs have extra hyphens, it cannot find any matching info in the catalog, causing the mailer to balk and the checkout process to stop. Customers do not know the order has been logged and monies taken, so either try again creating duplicate orders, or leave the site annoyed. Either way, it is a poor customer experience. We have had to refund orders after customers have gone elsewhere, and our customer service department got regular hell over the phone until we discovered the workaround.
The workaround we have been using is direct in the DB:
SELECT * from quote_item WHERE sku LIKE '%--';
And remove the extra hyphens.
If the order has already completed, we use:
SELECT * from sales_order_item WHERE sku like '%--';
Remove the extra hyphens and manually send the email using the "Send Email" button in admin > orders
@magento I am working on this
Hi @RetroProgrammist ,
Thank you for reporting and collaboration. Reverified the issue on Magento 2.4-develop instance and the issue is reproducible. Kindly refer the screenshots.
Steps to reproduce :
- Create a simple product
- add custom options either multiselect or checkbox with multiple values (3+)
- Go to the product page and add to cart by selecting 3 or more option values of multiselect / checkbox type.
- Check quote_item table sku column Observe sku value is displaying as expected along with custom options
Can you please reverify in latest 2.4-develop instance and confirm. Thanks.