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

getPrice() returns a string when setting custom price in admin order #25968

Closed
ghost opened this issue Dec 10, 2019 · 12 comments
Closed

getPrice() returns a string when setting custom price in admin order #25968

ghost opened this issue Dec 10, 2019 · 12 comments
Assignees
Labels
Component: Sales Fixed in 2.4.x The issue has been fixed in 2.4-develop branch 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.4.x The issue has been reproduced on latest 2.4-develop branch

Comments

@ghost
Copy link

ghost commented Dec 10, 2019

Preconditions

M 2.3.3

Steps to reproduce

  1. The method getPrice() from /vendor/magento/module-sales/Model/Order/Item.php
    /**
     * Return price
     *
     * @return float|null
     */
    public function getPrice()
    {
        return $this->getData(OrderItemInterface::PRICE);
    }

Expected result

Clearly states it should return a float, or null.

Actual result

However, when creating a MOTO order, and you set a custom price for a product, when you call getPrice() for the order items, the returned value will be a string, not a float.

We switched to getBasePrice() (seemingly operates the same as getPrice()....) as that should also return a float, or null. It worked fine locally, but had a report that on Magento Cloud, it would return a string.

@m2-assistant
Copy link

m2-assistant bot commented Dec 10, 2019

Hi @paul-gene. 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 give me 2.4-develop instance - upcoming 2.4.x release

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

@paul-gene do you confirm that you were able to reproduce the issue on vanilla Magento instance following steps to reproduce?

  • yes
  • no

@magento-engcom-team magento-engcom-team added the Issue: Format is not valid Gate 1 Failed. Automatic verification of issue format is failed label Dec 10, 2019
@engcom-Echo engcom-Echo self-assigned this Dec 11, 2019
@m2-assistant
Copy link

m2-assistant bot commented Dec 11, 2019

Hi @engcom-Echo. 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.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-Echo engcom-Echo added good first issue Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch Component: Sales labels Dec 11, 2019
@magento-engcom-team magento-engcom-team added Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed and removed Issue: Format is not valid Gate 1 Failed. Automatic verification of issue format is failed labels Dec 11, 2019
@engcom-Echo engcom-Echo added the Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed label Dec 11, 2019
@ghost ghost unassigned engcom-Echo Dec 11, 2019
@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 Dec 11, 2019
@magento-engcom-team
Copy link
Contributor

✅ Confirmed by @engcom-Echo
Thank you for verifying the issue. Based on the provided information internal tickets MC-29645 were created

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

@AndreyChorniy AndreyChorniy reopened this Dec 11, 2019
@ghost ghost removed Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed good first issue Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch labels Dec 11, 2019
@magento-engcom-team
Copy link
Contributor

Unfortunately, we are archiving this ticket now as it did not get much attention from both Magento Community and Core developers for an extended period. This is done in an effort to create a quality, community-driven backlog which will allow us to allocate the required attention more easily.

Please feel free to comment or reopen according to the Issue reporting guidelines
the ticket if you are still facing this issue on the latest 2.x-develop branch. Thank you for collaboration.

@ghost
Copy link
Author

ghost commented Dec 11, 2019

@magento-engcom-team Are you serious?

Unfortunately, we are archiving this ticket now as it did not get much attention from both Magento Community and Core developers for an extended period

I opened this ticket yesterday....

@AndreyChorniy AndreyChorniy self-assigned this Dec 11, 2019
@m2-assistant
Copy link

m2-assistant bot commented Dec 11, 2019

Hi @AndreyChorniy. 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.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!


@AndreyChorniy
Copy link
Contributor

@paul-gene This is mistake. I am going to working on this ticket.

@AndreyChorniy AndreyChorniy added good first issue Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch labels Dec 11, 2019
@ghost ghost removed the good first issue label Dec 11, 2019
@ghost
Copy link

ghost commented Dec 11, 2019

Thank you @AndreyChorniy for proposing this as Good First Issue!
Community Maintainers team will review it and add to list.

@ghost
Copy link
Author

ghost commented Dec 11, 2019

@AndreyChorniy please just give up adding labels. If "good first issue" is in relation to me, then it's certainly not true, I've reported other issues in the past.

You're fighting a losing battle with the bots here.

@sdzhepa sdzhepa added the Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed label Dec 11, 2019
@magento-engcom-team
Copy link
Contributor

✅ Confirmed by @sdzhepa
Thank you for verifying the issue. Based on the provided information internal tickets MC-29670 were created

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

@sdzhepa
Copy link
Contributor

sdzhepa commented Dec 11, 2019

Hello @paul-gene

Thank you for contribution and collaboration!

Sorry for #25968 (comment) and #25968 (comment) bot closed this issue accidentally by mistake due to delays and queues through all integration logic between GitHub and internal Jira...

I have returned the Confirmation label.

@VladimirZaets
Copy link
Contributor

Hi @paul-gene. Thank you for your report.
The issue has been fixed in #26313 by @AndreyChorniy in 2.4-develop branch
Related commit(s):

The fix will be available with the upcoming 2.4.0 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Sales Fixed in 2.4.x The issue has been fixed in 2.4-develop branch 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.4.x The issue has been reproduced on latest 2.4-develop branch
Projects
None yet
Development

No branches or pull requests

5 participants