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

Notification message doesn't appear with backorder in shopping cart #717

Closed
smoskaluk opened this issue Mar 22, 2018 · 3 comments
Closed
Assignees
Labels

Comments

@smoskaluk
Copy link

smoskaluk commented Mar 22, 2018

Preconditions

  1. Magento MSI
  2. Simple product created with Qty=10
  3. In Advanced inventory for product enable function "Backoredrs" = Allow quantity below 0 and notify customer

Steps to reproduce

  1. On frontent add to shopping cart Simple product Qty= 20
  2. Open shopping cart

Expected result

  1. Product add with notification

Actual result

  1. Product added without notification
@smoskaluk smoskaluk added the Bug label Mar 22, 2018
@smoskaluk smoskaluk changed the title Notification message doesn't appear with backoreder in shopping cart Notification message doesn't appear with backorder in shopping cart Mar 22, 2018
@smoskaluk
Copy link
Author

image

@AlexandrVolkov AlexandrVolkov self-assigned this Mar 23, 2018
@AlexandrVolkov AlexandrVolkov removed their assignment Mar 24, 2018
@rogyar rogyar self-assigned this Mar 24, 2018
@vrann vrann added this to the MSI Part I milestone Apr 4, 2018
@larsroettig larsroettig self-assigned this Apr 5, 2018
@larsroettig
Copy link
Member

larsroettig commented Apr 5, 2018

Hi i found the Problem we have a around Plugin for:
\Magento\CatalogInventory\Model\StockStateProvider::checkQuoteItemQty
In checkQuoteItemQtyis the check for is the BackOrder Flag

We must implement the following and write tests for it.

if ($stockItem->getBackorders() == \Magento\CatalogInventory\Model\Stock::BACKORDERS_YES_NOTIFY) {
    if (!$stockItem->getIsChildItem()) {
        $result->setMessage(
            __(
                'We don\'t have as many "%1" as you requested, '
                . 'but we\'ll back order the remaining %2.',
                $stockItem->getProductName(),
                $backOrderQty * 1
            )
        );
    } else {
        $result->setMessage(
            __(
                'We don\'t have "%1" in the requested quantity, '
                . 'so we\'ll back order the remaining %2.',
                $stockItem->getProductName(),
                $backOrderQty * 1
            )
        );
    }
} elseif ($stockItem->getShowDefaultNotificationMessage()) {
    $result->setMessage(
        __('We don\'t have as many "%1" as you requested.', $stockItem->getProductName())
    );
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

8 participants