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

Same product quantity not increment when added with guest user. #21375

Closed
krishprakash opened this issue Feb 21, 2019 · 16 comments
Closed

Same product quantity not increment when added with guest user. #21375

krishprakash opened this issue Feb 21, 2019 · 16 comments
Assignees
Labels
Component: Catalog Component: Sales Fixed in 2.2.x The issue has been fixed in 2.2 release line Fixed in 2.3.x The issue has been fixed in 2.3 release line Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release

Comments

@krishprakash
Copy link

krishprakash commented Feb 21, 2019

Preconditions (*)

  1. Magento 2.2.x
  2. Magento 2.3.x

Steps to reproduce (*)

  1. Login >>Add product X to the cart from Listing page
  2. Logout
  3. Add product X to the cart from product detail page as guest user
  4. Login using same account.
  5. Review the cart

Expected result (*)

Product Qty should be incremented not added separately after login if same product is already added into cart.

Actual result (*)

test

@magento-engcom-team magento-engcom-team added the Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed label Feb 21, 2019
@magento-engcom-team
Copy link
Contributor

magento-engcom-team commented Feb 21, 2019

Hi @krishprakash. Thank you for your report.
To help us process this issue please make sure that you provided the following information:

  • Summary of the issue
  • Information on your environment
  • Steps to reproduce
  • Expected and actual results

Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:

@magento-engcom-team give me 2.3-develop instance - upcoming 2.3.x release

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

@krishprakash do you confirm that you was able to reproduce the issue on vanilla Magento instance following steps to reproduce?

  • yes
  • no

@krishprakash krishprakash changed the title Same product quantity not incremented when added with guest user. Same product quantity not increment when added with guest user. Feb 21, 2019
@Jitheesh
Copy link
Contributor

Jitheesh commented Feb 21, 2019

Hi @krishprakash

I can replicate this issue on Magento 2.3 develop instance on following scenario.

  1. Login, Add product X to basket from Listing page
  2. Logout
  3. Add product X to basket from product view page as guest user
  4. Login using same account.
  5. Review basket, Basket will contains same product as two item

This issue is because of additional buy request parameters while we adding product from product view page.

After customer login Magento will load customer quote and merge this into current quote, while merging quotes, it will compare quote items.

public function compare(Item $target, Item $compared)
{
if ($target->getProductId() != $compared->getProductId()) {
return false;
}
$targetOptions = $this->getOptions($target);
$comparedOptions = $this->getOptions($compared);
if (array_diff_key($targetOptions, $comparedOptions) != array_diff_key($comparedOptions, $targetOptions)
) {
return false;
}
foreach ($targetOptions as $name => $value) {
if ($comparedOptions[$name] != $value) {
return false;
}
}
return true;
}

quoteOptionFromViewPage

array ( 'info_buyRequest' => array ( 'product' => '1', 'item' => '1', ), )

quoteOptionFromListingPage
array ( 'info_buyRequest' => array ( 'product' => '1', ), )

Item comparison failed because of 'item' parameter in the buy request.

<input type="hidden" name="item" value="<?= /* @noEscape */ $block->getRequest()->getParam('id') ?>" />

same issue will happen if you add related products along with main product.

@dipti2jcommerce
Copy link

@magento-engcom-team give me 2.3-develop instance

@magento-engcom-team
Copy link
Contributor

Hi @dipti2jcommerce. Thank you for your request. I'm working on Magento 2.3-develop instance for you

@magento-engcom-team
Copy link
Contributor

Hi @dipti2jcommerce, here is your Magento instance.
Admin access: https://i-21375-2-3-develop.instances.magento-community.engineering/admin
Login: admin Password: 123123q
Instance will be terminated in up to 3 hours.

@shikhamis11
Copy link
Member

@magento-engcom-team give me 2.2-develop instance

@magento-engcom-team
Copy link
Contributor

Hi @shikhamis11. Thank you for your request. I'm working on Magento 2.2-develop instance for you

@magento-engcom-team
Copy link
Contributor

Hi @shikhamis11, here is your Magento instance.
Admin access: https://i-21375-2-2-develop.instances.magento-community.engineering/admin
Login: admin Password: 123123q
Instance will be terminated in up to 3 hours.

@magento-engcom-team
Copy link
Contributor

magento-engcom-team commented Feb 21, 2019

Hi @shikhamis11. 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: 👇

  • 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).

    DetailsIf the issue has a valid description, the label Issue: Format is valid will be added to the issue automatically. Please, edit issue description if needed, until label Issue: Format is valid appears.

  • 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add Issue: Clear Description label to the issue by yourself.

  • 3. Add Component: XXXXX label(s) to the ticket, indicating the components it may be related to.

  • 4. Verify that the issue is reproducible on 2.3-develop branch

    Details- Add the comment @magento-engcom-team give me 2.3-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.3-develop branch, please, add the label Reproduced on 2.3.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. Verify that the issue is reproducible on 2.2-develop branch.

    Details- Add the comment @magento-engcom-team give me 2.2-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.2-develop branch, please add the label Reproduced on 2.2.x

  • Next steps are available in case you are a member of Community Maintainers.

  • 6. Add label Issue: Confirmed once verification is complete.

  • 7. Make sure that automatic system confirms that report has been added to the backlog.

@shikhamis11 shikhamis11 self-assigned this Feb 21, 2019
@shikhamis11
Copy link
Member

@Jitheesh yes you are right I am able to reproduce the issue with your provided step
@krishprakash it will be better if you update Steps to reproduce (*) as it is not reproducable in all scenarios

@shikhamis11 shikhamis11 added Component: Catalog Component: Sales Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release labels Feb 21, 2019
@magento-engcom-team
Copy link
Contributor

✅ Confirmed by @shikhamis11
Thank you for verifying the issue. Based on the provided information internal tickets MAGETWO-98355, MAGETWO-98356 were created

Issue Available: @shikhamis11, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.

@magento-engcom-team magento-engcom-team added the Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development label Feb 21, 2019
@shikhamis11 shikhamis11 self-assigned this Feb 25, 2019
@magento-engcom-team
Copy link
Contributor

Hi @shikhamis11. Thank you for working on this issue.
Looks like this issue is already verified and confirmed. But if you want to validate it one more time, please, go though the following instruction:

  • 1. Add/Edit Component: XXXXX label(s) to the ticket, indicating the components it may be related to.

  • 2. Verify that the issue is reproducible on 2.3-develop branch

    Details- Add the comment @magento-engcom-team give me 2.3-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.3-develop branch, please, add the label Reproduced on 2.3.x.
    - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!

  • 3. Verify that the issue is reproducible on 2.2-develop branch.

    Details- Add the comment @magento-engcom-team give me 2.2-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.2-develop branch, please add the label Reproduced on 2.2.x

  • 4. If the issue is not relevant or is not reproducible any more, feel free to close it.

Jitheesh added a commit to Jitheesh/magento2 that referenced this issue Feb 28, 2019
…to#21375

- removed non required item options while comparing with merge items
@Jitheesh Jitheesh self-assigned this Feb 28, 2019
@magento-engcom-team
Copy link
Contributor

Hi @Jitheesh. Thank you for working on this issue.
Looks like this issue is already verified and confirmed. But if you want to validate it one more time, please, go though the following instruction:

  • 1. Add/Edit Component: XXXXX label(s) to the ticket, indicating the components it may be related to.

  • 2. Verify that the issue is reproducible on 2.3-develop branch

    Details- Add the comment @magento-engcom-team give me 2.3-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.3-develop branch, please, add the label Reproduced on 2.3.x.
    - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!

  • 3. Verify that the issue is reproducible on 2.2-develop branch.

    Details- Add the comment @magento-engcom-team give me 2.2-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.2-develop branch, please add the label Reproduced on 2.2.x

  • 4. If the issue is not relevant or is not reproducible any more, feel free to close it.

@magento-engcom-team
Copy link
Contributor

Hi @krishprakash. Thank you for your report.
The issue has been fixed in #21501 by @Jitheesh in 2.3-develop branch
Related commit(s):

The fix will be available with the upcoming 2.3.2 release.

@magento-engcom-team magento-engcom-team added the Fixed in 2.3.x The issue has been fixed in 2.3 release line label Apr 16, 2019
magento-engcom-team added a commit that referenced this issue Apr 16, 2019
…t user. #21375 #21501

 - Merge Pull Request #21501 from Jitheesh/magento2:feature/cart-merge-21375
 - Merged commits:
   1. 30dbc79
amol2jcommerce pushed a commit to amol2jcommerce/magento2 that referenced this issue Apr 16, 2019
…to#21375 - removed non required item options while comparing with merge items
@magento-engcom-team magento-engcom-team added the Fixed in 2.2.x The issue has been fixed in 2.2 release line label Apr 25, 2019
@magento-engcom-team
Copy link
Contributor

Hi @krishprakash. Thank you for your report.
The issue has been fixed in #22378 by @amol2jcommerce in 2.2-develop branch
Related commit(s):

The fix will be available with the upcoming 2.2.9 release.

magento-engcom-team added a commit that referenced this issue Apr 25, 2019
…d with guest user. #21375 #22378

 - Merge Pull Request #22378 from amol2jcommerce/magento2:2.2-develop-PR-port-21501
 - Merged commits:
   1. 57af527
@niravkrish niravkrish removed their assignment May 1, 2019
@cgsoratto
Copy link

cgsoratto commented Oct 17, 2019

I found! The problem is in the 'StripeIntegration_Payments' module. There is an observer for 'checkout_cart_product_add_after' that always changes the "code" to "additional_options".

app/code/StripeIntegration/Payments/Observer/AddInitialFeeObserver.php

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Catalog Component: Sales Fixed in 2.2.x The issue has been fixed in 2.2 release line Fixed in 2.3.x The issue has been fixed in 2.3 release line Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release
Projects
None yet
Development

No branches or pull requests

7 participants