• Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Register
  • Login
Bagisto Forum

Bagisto

  • Register
  • Login
  • Search
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups

OrderItemRepository.php / product_ordered_inventories on configurable products.

Bug Report
2
3
1.6k
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N
    nessuno last edited by nessuno 23 Jan 2021, 15:30 23 Jan 2021, 15:22

    Hi Bagisto Team !
    in packages/Webkul/Sales/src/Repositories/OrderItemRepository.php
    at line 127
    where
    if (isset($item->qty_ordered)

    shouldn't it be:

    if (isset($item->qty_ordered) && ($item->qty_ordered>0)) instead ?

    Because for configurable products, the qty ends up as zero in product_ordered_inventories and as such it will never prevent anyone from adding to the cart even though the reserve has surpassed the inventory qty.
    Try checking out a configurable product using both versions of the if statement.
    The reserve works for single products but not for configurable ones unless I set this additional condition.

    Please feel free to correct me if I am wrong ?
    Thanks in advance for your time,
    cab5941d-8da6-41ca-9bc0-05caecbf9d9a-image.png

    1 Reply Last reply Reply Quote 0
    • devansh-webkul
      devansh-webkul last edited by 25 Jan 2021, 05:20

      Hi @nessuno,

      If this causing exception, then you can raise issue here with exception screenshot and steps.

      https://github.com/bagisto/bagisto

      N 1 Reply Last reply 25 Jan 2021, 22:35 Reply Quote 0
      • N
        nessuno @devansh-webkul last edited by nessuno 25 Jan 2021, 22:48 25 Jan 2021, 22:35

        @devansh-webkul Thanks ! It is not causing an exception but unless this is set the inventory of configurable products will not work properly. We don't need a resolution as we have resolved as per the screenshot but we thought it would be a good idea to share it.
        thanks!
        ps: configurable products need to reach the bloc of which takes the quantity from the parent and this does just that (otherwise the quantity of configurable products will always be zero within the original logic which nullifies the ordered inventories for configurable products).

        1 Reply Last reply Reply Quote 1
        2 out of 3
        • First post
          2/3
          Last post