What are the Slack Archives?

It’s a history of our time together in the Slack Community! There’s a ton of knowledge in here, so feel free to search through the archives for a possible answer to your question.

Because this space is not active, you won’t be able to create a new post or comment here. If you have a question or want to start a discussion about something, head over to our categories and pick one to post in! You can always refer back to a post from Slack Archives if needed; just copy the link to use it as a reference..

Hi, has anyone had the behaviour, that items in an orderEntity have a wrong price when the quantity

ULL0N440J
ULL0N440J Posts: 184 πŸ§‘πŸ»β€πŸš€ - Cadet

Hi,
has anyone had the behaviour, that items in an orderEntity have a wrong price when the quantity is >= 10?
It seems like the quantity is involved while calculating the NetPrice πŸ€”. Didn't find the spot yet.

Example: I have an item which costs 194.90€.
Quantity 11:

$orderItem[1]->getNetPrice(); // returns 214390 -> 2143,90€ per item

Quantity 9:

$orderItem[1]->getNetPrice(); // returns 19490 -> 194,90€ per item

Comments

  • UKTEVG9L4
    UKTEVG9L4 Posts: 38 πŸ§‘πŸ»β€πŸš€ - Cadet

    Any discount activated?

  • UKTEVG9L4
    UKTEVG9L4 Posts: 38 πŸ§‘πŸ»β€πŸš€ - Cadet

    Is visible in the order details. Down at the bottom.

  • ULL0N440J
    ULL0N440J Posts: 184 πŸ§‘πŸ»β€πŸš€ - Cadet

    No active discounts besides free shipping from 29€

  • UKTEVG9L4
    UKTEVG9L4 Posts: 38 πŸ§‘πŸ»β€πŸš€ - Cadet

    Hmm ok.

  • UKTEVG9L4
    UKTEVG9L4 Posts: 38 πŸ§‘πŸ»β€πŸš€ - Cadet

    B2C or B2B?

  • ULL0N440J
    ULL0N440J Posts: 184 πŸ§‘πŸ»β€πŸš€ - Cadet
    edited February 2020

    B2B Suite

  • UKTEVG9L4
    UKTEVG9L4 Posts: 38 πŸ§‘πŸ»β€πŸš€ - Cadet

    Got my Test B2C running and can not recreate the issue.

    10 * 406,51

  • ULL0N440J
    ULL0N440J Posts: 184 πŸ§‘πŸ»β€πŸš€ - Cadet
    edited February 2020

    Just found out that the Quantity seems to be wrong, too.

    I just placed an order with
    4x Product A
    13x Product B

    There's an array $orderItems passed to our payCommand.
    For this 17 products I get this:

    count($orderItems) // returns 5 
    

    As soon as I get down to below 10 products
    4x Product A
    9x Product B

    count($orderItems) // returns 13
    
  • UKTEVG9L4
    UKTEVG9L4 Posts: 38 πŸ§‘πŸ»β€πŸš€ - Cadet

    Holy - did you try to use "xdebug". Or have you any clue where the "count" is implemented?

  • ULL0N440J
    ULL0N440J Posts: 184 πŸ§‘πŸ»β€πŸš€ - Cadet
    edited February 2020

    I am using xdebug, but unfortunately it doesn't apply on this file. Breakpoints aren't pausing.. It is executed, I am logging the results instead of sending an order over and over while testing..

    I am writing an xml upon receiving an order, there I take use of count(..)

  • UKTEVG9L4
    UKTEVG9L4 Posts: 38 πŸ§‘πŸ»β€πŸš€ - Cadet

    Hmm - Sorry can't help you with this.

    Maybe one from spryker dev-team?

  • Stanislav Matveyev
    Stanislav Matveyev Sprykee Posts: 211 πŸ§‘πŸ»β€πŸš€ - Cadet

    is volume prices feature enabled and used?

  • ULL0N440J
    ULL0N440J Posts: 184 πŸ§‘πŸ»β€πŸš€ - Cadet

    Can't find volume at all in src/Pyz/Zed/Calculation/CalculationDependencyProvider.php, so I think it isn't used.

  • Stanislav Matveyev
    Stanislav Matveyev Sprykee Posts: 211 πŸ§‘πŸ»β€πŸš€ - Cadet

    it’s related to Prices.

    PriceProductVolumeExtractorPlugin
    

    in

    \Pyz\Zed\PriceProduct\PriceProductDependencyProvider
    
  • ULL0N440J
    ULL0N440J Posts: 184 πŸ§‘πŸ»β€πŸš€ - Cadet

    Thanks! It's in use.

  • Stanislav Matveyev
    Stanislav Matveyev Sprykee Posts: 211 πŸ§‘πŸ»β€πŸš€ - Cadet
    edited February 2020

    but still you need to have volumes in price data import

  • ULL0N440J
    ULL0N440J Posts: 184 πŸ§‘πŸ»β€πŸš€ - Cadet
    edited February 2020

    We aren't taking use of this module at all πŸ™„ I'll remove it asap.

    Do you think that this module could cause this? I'd expect the prices to go down instead of up if there's a default mode with volume pricesπŸ˜…

  • We have functionality that splits items. By default all items in order split if quantity less than 10

  • ULL0N440J
    ULL0N440J Posts: 184 πŸ§‘πŸ»β€πŸš€ - Cadet

    Thanks for this information @UR1QYK8MC πŸ™‚

  • In your case:
    β€’ qty=11 meant I’ll have 1 item with qty=11
    β€’ qty=9 means I’ll have 9 items with qty=1

  • ULL0N440J
    ULL0N440J Posts: 184 πŸ§‘πŸ»β€πŸš€ - Cadet

    Got it, this is what I experienced and I wondered where it comes from.

    So, is this applyable on the NetPrice, too? So I have

    qty=11, which results in 1 item with price*=11?

  • ULL0N440J
    ULL0N440J Posts: 184 πŸ§‘πŸ»β€πŸš€ - Cadet

    Why did you invent this functionality? Don't really get the usecase behind it πŸ€”

  • In case if you have some item with qty=100 it’s hard to display in back office all those items. And all those items will be processed separately by OMS.

  • ULL0N440J
    ULL0N440J Posts: 184 πŸ§‘πŸ»β€πŸš€ - Cadet

    Alright, actually expected something like this. In our usecase we're summarizing products with the same sku after checkout anyway.

    Thank you for your help πŸ™‚

    To bring this to an end: I'll refactor our checkout XML writer and check if($item>getQuantity() >= 10) before I separate the wrapped up products again.

  • Unknown
    edited February 2020

    This functionality managed by this plugin stack:
    \Spryker\Zed\SalesExtension\Dependency\Plugin\ItemTransformerStrategyPluginInterface if it might help you to understand how it works

  • ULL0N440J
    ULL0N440J Posts: 184 πŸ§‘πŸ»β€πŸš€ - Cadet

    I just had a look at the ItemTransformerStrategyPluginInterface and where it's implemented/ used.

    What I couldn't find was the line, where the quantity is checked to summarize items of same amount (would've expected an easy if statement πŸ˜…). Can you tell me where I can find it?
    I want to summarize every item in an orderEntity.

  • Hey Daniel! There is constant that represents quantity threshold
    \Pyz\Zed\SalesQuantity\SalesQuantityConfig::ITEM_NONSPLIT_QUANTITY_THRESHOLD