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

Adding item to cart via API does not apply custom price set #38985

Open
1 of 5 tasks
Lex-Weeks opened this issue Jul 29, 2024 · 9 comments
Open
1 of 5 tasks

Adding item to cart via API does not apply custom price set #38985

Lex-Weeks opened this issue Jul 29, 2024 · 9 comments
Assignees

Comments

@Lex-Weeks
Copy link

Summary

When you add an item to a cart via the API, if you specify a price with the item, the cart does not honor the price you supplied.

Examples

Steps to reproduce:

  1. Have a logged in user
  2. Get their cart id
  3. Add an item to their cart via the API
  4. When adding the item specify a price that is different than the catalog price
  5. Go to the users cart, the price will not be the specified price.

Proposed solution

No response

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.
  • 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”.
@Lex-Weeks Lex-Weeks added the Triage: Dev.Experience Issue related to Developer Experience and needs help with Triage to Confirm or Reject it label Jul 29, 2024
Copy link

m2-assistant bot commented Jul 29, 2024

Hi @Lex-Weeks. 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:


Join Magento Community Engineering Slack and ask your questions in #github channel.
⚠️ According to the Magento Contribution requirements, all issues must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting.
🕙 You can find the schedule on the Magento Community Calendar page.
📞 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.

@engcom-Hotel engcom-Hotel added Reported on 2.4.x Indicates original Magento version for the Issue report. and removed Triage: Dev.Experience Issue related to Developer Experience and needs help with Triage to Confirm or Reject it labels Jul 30, 2024
@engcom-Bravo engcom-Bravo self-assigned this Jul 30, 2024
Copy link

m2-assistant bot commented Jul 30, 2024

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: 👇

  • 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: XXXXX label to the ticket, indicating the functional areas it may be related to.
  • 4. Verify that the issue is reproducible on 2.4-develop branch
    Details- Add the comment @magento give me 2.4-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.4-develop branch, please, add the label Reproduced 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: Confirmed once verification is complete.
  • 6. Make sure that automatic system confirms that report has been added to the backlog.

@engcom-Bravo
Copy link
Contributor

@magento give me 2.4-develop instance

Copy link

Hi @engcom-Bravo. Thank you for your request. I'm working on Magento instance for you.

Copy link

@engcom-Bravo
Copy link
Contributor

Hi @Lex-Weeks,

Thanks for your reporting and collaboration.

AS per the Magento devdocs https://developer.adobe.com/commerce/webapi/rest/tutorials/orders/order-add-items/ the payload will be without price field if we are adding the price field we are getting Decoding Error.

Screenshot 2024-07-30 at 12 23 14

It seems to be an expected behaviour of Magento.

Hence we are considering this as a improvement and marking this as feature request.

Thanks.

@Lex-Weeks
Copy link
Author

Lex-Weeks commented Jul 30, 2024

It seems there may be a comma missing after price, which would be causing the decoding error.
As per the documentation PUT carts/{cartId}/items/{itemId} does accept price as a parameter.

add_item

@ignaciomnzz
Copy link

ignaciomnzz commented Sep 27, 2024

@engcom-Bravo You have an error in the payload.

issue

I confirm the issue occurs also in version 2.4.6. I am having the same problem, the price is not updated.

@Lex-Weeks
Copy link
Author

Lex-Weeks commented Sep 27, 2024

@ignaciomnzz I have talked to adobe commercial support and they effectively said that they are not going to fix this. Took a different path in writing our own endpoint that leverages the built in item functions to do this.

$item->setCustomPrice($YourPriceHere);
$item->setOriginalCustomPrice($YourPriceHere);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: In Progress
Development

No branches or pull requests

4 participants