Devil089 Posted March 14, 2016 Share Posted March 14, 2016 Hi prestashop community , I need the following scenario: I want to split each article from my shopping chart after payment into his own order_reference code and oder number. Prestashop has no option for order splitting. So I try the following: I know that if i add to each product different shipping-service, prestashop split the order automatically after payment. Cause of different shipping-services This works quite good. The only thing is, that these splitted orders have the same order_reference code. . How can i change the core that each splitted order have his own order_reference_code Can anyone help me how i can archive this? This would be nice. Thank you Devil Link to comment Share on other sites More sharing options...
Tung at RockPOS.com Posted March 16, 2016 Share Posted March 16, 2016 Look at class PaymentModule.php. You'll see: do { $reference = Order::generateReference(); } while (Order::getByReference($reference)->count()); $this->currentOrderReference = $reference; And this: foreach ($package_list as $id_address => $packageByAddress) { foreach ($packageByAddress as $id_package => $package) { /** @var Order $order */ $order = new Order(); $order->product_list = $package['product_list']; Now, move the first block into the second block. The final code looks like this: foreach ($package_list as $id_address => $packageByAddress) { foreach ($packageByAddress as $id_package => $package) { do { $reference = Order::generateReference(); } while (Order::getByReference($reference)->count()); $this->currentOrderReference = $reference; /** @var Order $order */ $order = new Order(); $order->product_list = $package['product_list']; Hope that helps! Tung Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now