Giter VIP home page Giter VIP logo

williankeller / magento2-split-order Goto Github PK

View Code? Open in Web Editor NEW
65.0 11.0 26.0 96 KB

[DEPRECATED] This extension allows your Magento store to split the order into an order for each item in the cart.

Home Page: https://magestat.com/extensions/magento2-split-order

License: Open Software License 3.0

PHP 92.69% HTML 7.31%
magento2 magento2-extension magento2-order magento2-module split-order cart split magento2-installation magento2-split-order archived

magento2-split-order's Introduction

[DEPRECATED] Split Order for Magento 2

This extension allows your Magento store to split the order into an order for each item in the cart. With different order IDs, customers can view all the order ids in their Order History and track each item separately. The Magento admin generate separate invoices and shipments for each splitted order. Shipping charges and tax are also split based on items. This extension Magento 2 default offline payment methods: Check / Money Order and Cash on Delivery.

No Maintenance Intended Build Status Packagist Downloads

Installation

Install via composer (recommended)

Run the following command in Magento 2 root folder:

composer require magestat/module-split-order

Using GIT clone

Run the following command in Magento 2 root folder:

git clone [email protected]:magestat/magento2-split-order.git app/code/Magestat/SplitOrder

2. Activation

Run the following command in Magento 2 root folder:

php bin/magento module:enable Magestat_SplitOrder
php bin/magento setup:upgrade

Clear the caches:

php bin/magento cache:clean

3. Configuration

  1. Go to STORES > Configuration > MAGESTAT > Split Order.
  2. Select Enabled option to enable module.
  3. Change the options selecting the attribute to split the order just like you want.

Contribution

Want to contribute to this extension? The quickest way is to open a pull request on GitHub.

Support

If you encounter any problems or bugs, please open an issue on GitHub.

Need help setting up or want to customize this extension to meet your business needs? Please open an issue and if we like your idea we will add this feature for free.

Known issues

  1. Doesn't work with Braintree, Paypal via Braintree, Paypal Express Checkout

magento2-split-order's People

Contributors

nishant-lbb avatar viniciusfabri avatar williankeller avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

magento2-split-order's Issues

If multiple products in cart from same vendor giving wrong totals

I really loved this extension , Lets say i have 2 vendors with 200 products each. A customer selected 2 Products from one vendor and one from other vendor. The Grand Total is not showing correct for the first vendor (with 2 products). I am using a GST module to update the tax caluculations. Does this effects your total calculations?

checkout not working with COD and money order.

Magento version
Version 2.3.3

**Magento edition: Community Edition

Describe the bug

I have installed this Extention. the problem I'm facing while I place the order via money order or COD on checkout it's showing "something went wrong with your request please try again later."

Full shipping is charged to each 'split'

In my tests, using $5 flat rate shipping per item and check / money order payment method, if I check out with 4 items, then shipping is $20. The order is split successfully but $20 is charged to each order rather than $5.

Order Split not working with 'checkout with multiple address' option from cart page.

Describe the bug
This module is not working with multi shipping option.

To Reproduce
Steps to reproduce the behavior:

  1. Add 2 skus with 2-2 quantity each in cart.
  2. Checkout with multi address option from cart.
  3. Assign 1 shipping address with one product and other shipping with other one product.
  4. Update address and place order.

Expected behavior
With multi shipping address, two order id will generate. And with order split module two more will generate with based on sku. So total should be 4 orders in success page.

Screenshots
step1
step2

Additional context
So based on the above condition, order should be split into 4. But here it is generating only 2, which is generated by multi shipping functionality.

PHPDocs for most functions are incorrect/could be improved

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

Only single OrderID returned in V1/guest-carts/:cartID/order or V1/carts/:cartID/order PUT endpoints

Describe the bug
Hi, we're using the magento REST APIs to handle the orders and carts. When I use the PUT endpoints V1/guest-carts/:cartID/order or V1/carts/:cartID/order, I get a single orderID in response, but multiple split orders are created on the magento backend.

To Reproduce
Steps to reproduce the behavior:

  1. create a cart
  2. call V1/guest-carts/:cartID/order or V1/carts/:cartID/order PUT endpoint for that order.
  3. A single orderID is returned from the list of split orders.

Expected behavior
Multiple orderIDs should be returned

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS] MAC OSX
  • Browser [e.g. chrome, safari] Chrome
  • Version [e.g. 22] 70.0.3538.110

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.
Even if the split orders are connected via any foreign key in the database, I'd be happy to fetch the data from there itself. I can't see any such foreign keys in the sales order table in my magento database.

Product Quantity reducing twice

Magento version

Magento edition:

  • Community Edition

Describe the bug
When order split or not the cart is creating twice and each product's quantity in the quote is reducing twice

To Reproduce
Steps to reproduce the behavior:

  1. Two quotes are creating one with the exact quantity and another with zero quantity.
  2. Finally the sales_order table is assigned to the quote which has zero quantity but the product quantity is reduced twice.=

Splitting Order Based on Stock Status of product in cart

Hi

I am Using Magento 2.3.1 community Edition.

I am trying to split the order based on the Stock Status of the product Meaning if User is adding two products in which if 1 product is in stock and other 1 in outofstock (backorder enabled) then it should create two separate orders 1 for instock and other for outofstock.

Please let me know if this is possible in current developed plugin or help in which i can achieve this.

Right now in magento 2.3.1 the main quantity is not getting updated (deducted) once you place the order .rather it shows saleable quantity text qty in product edit

Is this works with credit card like payeezy

I know you mention in document that this will not work with PayPal etc..
but if we want to use it with a third-party payment processor like payeezy then how can we do that?
Any Suggestions?

Server error on checkout

Preconditions

  1. Magento 2.2.6
  2. php 7.0

Steps to reproduce

  1. Place an item with the category trunk with any other item category
  2. follow checkout as normal
  3. use a credit card for the purchase

Expected result

  1. order should be successful

Actual result

  1. upper right-hand corner shows An error occurred on the server. Please try to place the order again.
    image

After installing this plugin , checkout is not working

After installing this plugin , checkout is not working.. It keeps loading.

To Reproduce
Steps to reproduce the behavior:

  1. Install the plugin in live site.
  2. Set Product Attribute to Split as "SKU" in backend
  3. Add the product to cart
  4. Go to checkout page and fill the shipping and payment details..The page keeps loading only

Expected behavior
After filling the shipping and payment details..The order should be placed without an issue.

Additional context

Kindly give the solution to solve it.

Split quote item for Backorder quantity

I am trying to use your Module to separate the products that are ordered in backorders mode.
I ask you if you know the most correct method to separate the same Item Quote into two different orders, with the quantities divided by backorders.
Ex:
Product 1 -> Stock = Qty: 3, Min_Qty: -10(Out-of-Stock Threshold)
Custumer Cart: Product 1 -> Qty: 8
So 3 real Stock and 5 Backorders

i want 2 orders:
Order 1: Product 1 -> Qty: 3
Order 2: Product 1 -> Qty: 5

Now i've modified (in Magestat/SplitOrder/Model/ExtensionAttributes.php) your function quantityAndStockStatus
if ($this->helperData->getBackorder() && ($attributes->getStockItem()->getQty() - $item->getQty() < 0) ) { return 'out'; }
So i can get if Quote Item have Backorders.
Then in normalizeQuote function:

        if($attribute === 'out'){
            $qtyIn = $product->getExtensionAttributes()->getStockItem()->getQty();
            $qtyOut = $item->getQty() - $qtyIn;

            $itemCopy = clone $item;

            $groups["in"][] = $item->setQty($qtyIn);
            $this->writeLog("getQty() before > " . $item->getQty() );
            $groups[$attribute][] = $itemCopy->setQty($qtyOut);
            $this->writeLog("itemCopy() after > " . $itemCopy->getQty() );
            $item->save();
            $itemCopy->save();
        } else {
            $groups[$attribute][] = $item;
        }

Additional context
Now the order is split correctly but tax_amount for the 2 Quotes isn't changed and the Stock statud of Product 1 is set -8 quantity so the stockInventory decurted 3 more quantity than the orders placed.

I did a lot of research and found nothing about dividing the same Item into two orders.
Have you any suggestion or feature to implement?

Warning: count(): Parameter must be an array or an object that implements Countable

Preconditions

  1. Magento 2.3.1
  2. PHP 7.2

Steps to reproduce

  1. Create custom product attributes with dropdown option value. In my case i added two option value A and B. or Create custom product attributes with text field. In my case i added two option value A and B for two different product.
  2. Add these two product in cart with qty 1 for each or multiple.
  3. Proceed to checkout and place order.

Expected result

  1. [Screenshots, logs or description]
    expected

Note: Working with product attribute SKU.

Actual result

  1. [Screenshots, logs or description]
    error

main.CRITICAL: Warning: count(): Parameter must be an array or an object that implements Countable in app/code/Magestat/SplitOrder/Block/Checkout/Success.php on line 64 [] []

Split order based on multi vendor product

Hi Sir,

I need small clarification currently split order module working fine. But multi vendor product not receive all split order vendor based. Only last increment orderid store to vendor database. how to split foreach vendor order set.

Illegal offset type - QuoteHandler

Magento Version:
"magento/product-community-edition": "2.3.1"

main.CRITICAL: Warning: Illegal offset type in app/code/Magestat/SplitOrder/Model/QuoteHandler.php on line 77 {"exception":"[object]

Function : -

    public function normalizeQuotes($quote)
    {
        // if module is active.
        if (!$this->helperData->isActive()) {
            return false;
        }
        $attributes = $this->helperData->getAttributes();
        if (empty($attributes)) {
            return false;
        }

        $groups = [];
        foreach ($quote->getAllVisibleItems() as $item) {
            $product = $item->getProduct();

            $attribute = $this->getProductAttributes($product, $attributes);
            if (empty($attribute)) {
                // Kill function if attribute is null.
                return false;
            }
            $groups[$attribute][] = $item;  ///this is the where the error is thrown - line 77
        }
        // If order have more than one item.
        if (count($groups) > 1) {
            return $groups;
        }
        return false;
    }

I have selected product attribute as Quantity in config to split the order even though the products are instock and even though i have added only one product i am getting this error and order doesn't get placed.

any help will be great.

Second order is not instantly approved

Magento version

Magento edition:

  • Community Edition

Describing the bug

When I order from 2 different vendor to have the order split, the second one is instantly disapproved.

Steps to reproduce the behavior:

  1. Buy 2 item from 2 different sellers
  2. Checkout
  3. Check the invoice on the admin panel
  4. See error, second one is disapproved without any things done

Expected behavior
Second one not te be disapproved immediatly

Thanks in advance !

About Support PHP 7.2

Hello good afternoon

I am using Magento 2.3 and PHP 7.2, I tried to install your module and the warning was returned, can you help me

"Package magestat / module-split-order at version has a PHP requirement incompatible with your PHP version (7.2.14)"

I tries adding custom product attribute.

Version 2.3.3
Community Edition

I have created a attribute seller_id and assigned this attribute in admin. But the order is not splitting. No errors thrown. But when I use default attribute SKU it shows issue in console log that customer is not authenticated issue in payment-information rest api.

problem is shipping calculation

I have set weight & destination method. while calculating combine weight from the different seller, it shows less amount.
For ex : Seller 1 Items weight 0.1 kg
Seller 2 Weight 0.2 KG
Seller 3 Weight 0.3 KG
It takes combine of 0.5 kg and gives Rs.65
It should calculate 65+65+65

Preconditions

magento 2.3.0

Steps to reproduce

just enabled Seller ID attribute from admin 

Set Different Shipping Method for Each Order

I am able to split the order based on the Stock Status but the problem i am facing is when i am trying to set shipping method to the order.

Actually i want to set different Shipping Method to both the order.
e.g. first Order i want to set Shipping as free shipping and 2nd as Flat rate.

Below is the code used to set the shipping method for 2nd order but i am getting The shipping method is missing. Select the shipping method and try again.

$quote->getShippingAddress()->setShippingAmount($total)
            ->setShippingMethod('freeshipping_freeshipping'); 

Also Tried Below Code Same Issue. The shipping method is missing. Select the shipping method and try again.

use Magento\Quote\Model\Quote\Address\Rate

          $this->shippingRate
            ->setCode('freeshipping_freeshipping')
            ->setCarrierTitle($carrierTitle)
            ->setPrice($total);

        $shippingAddress = $quote->getShippingAddress();

        $shippingAddress->setCollectShippingRates(true)
                        ->collectShippingRates()
                        ->setShippingMethod('freeshipping_freeshipping');

        $quote->getShippingAddress()->addShippingRate($this->shippingRate);

Please Help

Order total is not separate

When the orders are being separated, the total value of each individual order is equal to the total of the order. I suppose that we have something wrong here $quoteSplit->collectTotals()->save();

support for adding multiple products for each quote

I really loved this extension, this is very simple and written beautifully but I am scared if it fulfils cart price rules and other discounts.
Moreover can you please add multi product support in this? I tried to do so but I am unable to work on collect totals method. In my case I have products with specific attributes which has to be added in separate order and remaining should be in other order.

Split order does not work

Magento v2.2.3

  1. Place more than 1 product to shopping cart.
  2. Proceed to checkout and complete.
  3. Error occurs: order confirmation email sent even if shipping address error was showed on checkout page and success page never showed up.

Expected split order by any single product with success page shown.

Can`t use in M2 2.1.6 EE

Can`r work in magento2 2.1.6 EE. Without any error, the shopping cart has two different merchandise orders to generate an order directly.

Currency Conversion Issue

if multi currency is enabled on your website and you are placing order then price which is getting updated in order doesn't get converted into the base currency price.

e.g. I placed an order where currency was selected as Rupees(india) and my base currency was Dollar but the price which is shown is same for both currencies.

Screenshot Before activating the plugin.

image

After Activating the plugin
image

Doesn't work with Braintree, Paypal via Braintree, Paypal Express Checkout

Thanks for the module first.

We tested with Magento EE 2.1.4 and 2.2.5 CE with the below payment methods. Not working as expected below.

  • Braintree,
  • Braintree Vault
  • Paypal via Braintree (Sandbox)
  • Paypal Express Checkout

Expected output

  • One order should have been split into 3 orders based on the cart item product attribute value (configured)
  • If a user has authorized a payment of $100 for the entire order, based on the cart items, 3 orders are expected to generated as below.
    • Order 1 - $30
    • Order 2 - $30
    • Order 3 - $40
  • The parent payment transaction should be attached to all other 2 orders.
  • Admin user should be able to create separate invoice the for each order and capture.
  • Admin user should be able to create creditmemo from each of the above generated invoices

.

Thanks,
Srini

Not working as expected

Magento version
Version 2.3.3-p1

Magento edition:

  • Enterprise Edition

I have installed this extension and enabled this in configuration. Added some products in cart and proceed checkout but its not splits the order.

Note: I didn't choose any attribute in configuration.

Getting error when I click Split Order on admin config page

Magento version
Version 2.3.0
Magento edition:
Community Edition

Describe the bug
Installation was successful after loading the files to the directory
After enabling, setup-upgrade and cache clear. When I go to admin page and click on split order I get an error.

1 exception(s):
Exception #0 (ReflectionException): Class Magestat\SplitOrder\Model\Config\Source\Attributes does not exist

Exception #0 (ReflectionException): Class Magestat\SplitOrder\Model\Config\Source\Attributes does not exist
#0 /home/synergo/public_html/staging/magento2/vendor/magento/framework/Code/Reader/ClassReader.php(19): ReflectionClass->__construct('Magestat\SplitO...')
#1 /home/synergo/public_html/staging/magento2/vendor/magento/framework/ObjectManager/Definition/Runtime.php(49): Magento\Framework\Code\Reader\ClassReader->getConstructor('Magestat\SplitO...')
#2 /home/synergo/public_html/staging/magento2/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php(48): Magento\Framework\ObjectManager\Definition\Runtime->getParameters('Magestat\SplitO...')
#3 /home/synergo/public_html/staging/magento2/vendor/magento/framework/ObjectManager/ObjectManager.php(70): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create('Magestat\SplitO...')
.......

To Reproduce
Steps to reproduce the behavior:

  1. Go to 'Admin'
  2. Click on 'Configuration'
  3. Scroll down to 'Magestat -> Split Order'
  4. See error

Expected behavior
Suppose it should show the Page for configuration

Screenshots
Screenshot 2020-03-20 at 12 23 38 PM

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.