Giter VIP home page Giter VIP logo

Comments (20)

williankeller avatar williankeller commented on September 28, 2024

Hi @saigadekar, could you please paste the full error message and describe where (which screen) the error shows up?

from magento2-split-order.

binnykumar avatar binnykumar commented on September 28, 2024

Hi @saigadekar , i faced this issue also.

Replace :

$groups[$attribute][] = $item;

With :

$attribute = 'item_'. $attribute;
$groups[$attribute][] = $item;

This will fix your issue.

from magento2-split-order.

williankeller avatar williankeller commented on September 28, 2024

Hi @binnykumar, this is not the right solution, this way you're forcing the conversion of an object to a string. This way you will always get the same attribute, response wrong response.
Please refer this commit with the real fix bd210d7.
This issue will be closed as soon as the PR is merged.

from magento2-split-order.

binnykumar avatar binnykumar commented on September 28, 2024

Hi @williankeller , thanks for the advice.

from magento2-split-order.

ninjacoder30 avatar ninjacoder30 commented on September 28, 2024

hi @williankeller

after adding the fix above error got cleared but now m getting this error on success page. I tried a single product and also multiple product (1 stock and 1 outofstock product (backorder allowed one))
1 exception(s):
Exception #0 (Exception): Warning: count(): Parameter must be an array or an object that implements Countable i app/code/Magestat/SplitOrder/Block/Checkout/Success.php on line 70

Even if there are two products (1 instock and 1 outofstock) selected Both product attribute are showing out of stock
QuoteHandler.php
$attribute = $this->getProductAttributes($product, $attributes); // this returns out of stock

which makes group count to 1 and further it fails because checkout session is not getting set.

from magento2-split-order.

williankeller avatar williankeller commented on September 28, 2024

Closing by fix released: #25

from magento2-split-order.

williankeller avatar williankeller commented on September 28, 2024

@saigadekar,

Even if there are two products (1 instock and 1 outofstock) selected Both product attribute are showing out of stock
which makes group count to 1 and further it fails because checkout session is not getting set.

Did you have executed reindex after applied the stock changes? The selection returns the product attribute value. Please make sure your product is returning In and Out of stock properly.

from magento2-split-order.

binnykumar avatar binnykumar commented on September 28, 2024

@saigadekar ,

yes you can fix this issue by updating this line :
Block/Checkout/Success.php

Look for

if (count($splittedOrders) <= 1) {
return false;
}

And replace it with

if (is_array($splittedOrders) && count($splittedOrders) <= 1) {
return false;
}

hi @williankeller

after adding the fix above error got cleared but now m getting this error on success page. I tried a single product and also multiple product (1 stock and 1 outofstock product (backorder allowed one))
1 exception(s):
Exception #0 (Exception): Warning: count(): Parameter must be an array or an object that implements Countable i app/code/Magestat/SplitOrder/Block/Checkout/Success.php on line 70

Even if there are two products (1 instock and 1 outofstock) selected Both product attribute are showing out of stock
QuoteHandler.php
$attribute = $this->getProductAttributes($product, $attributes); // this returns out of stock

which makes group count to 1 and further it fails because checkout session is not getting set.

from magento2-split-order.

ninjacoder30 avatar ninjacoder30 commented on September 28, 2024

@williankeller - I did reindex and even created a new product but still its returning outofstock as the frontend value and suppose if i try to use another attribute (country_of_manufacture ) this returns me empty value - i have update the data in product and also executed the reindex.

from magento2-split-order.

williankeller avatar williankeller commented on September 28, 2024

@binnykumar - You can't use is_array($splittedOrders) the right way is to validate if this variable is an empty and or condition.

from magento2-split-order.

williankeller avatar williankeller commented on September 28, 2024

@saigadekar, @binnykumar
Please refer the Pull Request #27, we did some improvements to make sure the stock is returning the expected value base on the Quantity attribute.
Now you're able to select some options including backorder configuration.
image
This Pull Request will be merged and a new release will be generated soon.

from magento2-split-order.

ninjacoder30 avatar ninjacoder30 commented on September 28, 2024

Hi @williankeller

Thanks for the help . i Have merged this on my local code and configured it according but now its returing "in" for both the products - product which is having less then zero saleable qty and also for product which is instock.

Please note the backorder feature which is activated is only at product level. meaning only selected products will be allowed for backorder.

from magento2-split-order.

williankeller avatar williankeller commented on September 28, 2024

@saigadekar - You have to enable the backorder option or set one of the products to out of stock

from magento2-split-order.

ninjacoder30 avatar ninjacoder30 commented on September 28, 2024

@williankeller - have set the Product to backorder in product edit section and saleable qty in listing is in negative and yet its showing in stock when returning and i even tried Type of Stock Attribute => Stock Quantity (Inventory value) even there its returning the qty but i need saleable qty . I will try to check this in production mode on n will see its giving me correct results then

from magento2-split-order.

williankeller avatar williankeller commented on September 28, 2024

@saigadekar,
Unfortunately, it's not possible by using saleable qty. You have to complete the order until the last step to have the value decreased from the inventory.

from magento2-split-order.

williankeller avatar williankeller commented on September 28, 2024

I'm not able to reproduce it by following the default flow.
Configuration:
image

One of my products is "In Stock" with zero qty:
image

Another product has more than 500 items in stock.
I got 2 orders in the end. One to the out of stock and one to in-stock items.

from magento2-split-order.

williankeller avatar williankeller commented on September 28, 2024

@saigadekar
If your product has less than 1 item and stock and you have enabled the backorder configuration under the Magestat module, you should enter in this condition: https://github.com/magestat/magento2-split-order/blob/develop/Model/ExtensionAttributes.php#L60

If you're expecting the value being loaded from the saleable quantity, unfortunately, it's not possible.

from magento2-split-order.

ninjacoder30 avatar ninjacoder30 commented on September 28, 2024

@williankeller

Problem which i am facing is my stock qty is not getting reduced when back order is enabled hence its not going in out of stock condition. but the saleable qty which is shown in listing is getting reduced.

from magento2-split-order.

ninjacoder30 avatar ninjacoder30 commented on September 28, 2024

@williankeller

i added below code in ExtensionAttributes.php - quantityAndStockStatus function.

     use Magento\InventorySalesAdminUi\Model\GetSalableQuantityDataBySku;
     $this->getSalableQuantityDataBySku = $getSalableQuantityDataBySku;
     $salable = $this->getSalableQuantityDataBySku->execute($sku);
    
    if($this->helperData->getBackorder() && $salable[0]['qty'] < 0){
        return 'out';
    }

from magento2-split-order.

ninjacoder30 avatar ninjacoder30 commented on September 28, 2024

@williankeller

Order is splitting but there is a currency conversion issue -
Please check the raised issue
#30

Thanks,

from magento2-split-order.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.