New answers tagged

0

You have to override the getPdf method in \Magento\Sales\Model\Order\Pdf\Invoice and in the foreach that prints the items you can create a new page: foreach ($invoice->getAllItems() as $item) { if ($item->getOrderItem()->getParentItem()) { continue; } //CREATE NEW PAGE ...


1

I got solution for this issue. Vendor/Module/etc/di.xml <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> <preference for="Magento\Sales\Model\OrderRepository" type="Vendor\Module\Model\...


0

By default result will be ASC order i.e oldest order first If you need the latest order, You need to set DESC order in search Criteria You can try below code: index.php/rest/V1/orders?searchCriteria=all&searchCriteria[sortOrders][0][field]=entity_id&searchCriteria[sortOrders][0][direction]=DESC Hope above will help!


3

In mageto2, you can not cancel an order which is at Hold status. If you want then you first need to changes order status to UnHold then you can cancel.


0

I think there is already a table sales_order_status_history and you can access through vendor/magento/module-sales/Model/Order/Status/HistoryRepository It does not log status change unless a comment is attached with it. At least it will save your time in creating custom table and its files.


0

you can use the sales_order_save_after event and observer the status and log your data in a custom table


0

You can get Order data after save using following way: /app/code/vendor/Module/etc/adminhtml/di.xml <?xml version="1.0" ?> <!-- /** * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:...


0

SELECT * FROM sales_sequence_meta All sequence_table row are used on same increment table Example 'sequence_order_1' example: UPDATE sales_sequence_meta SET sequence_table = 'sequence_order_1'. where meta_id =?? () Note: Empty all previous Quote and invoice related row OR Use on highest sequence_value table on this tables (sequence_order_1, ...


1

You can using plugin for update stock after placing order: /app/code/Vendor/Module/etc/di.xml <?xml version="1.0" ?> <!-- /** * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:...


2

I cannot tell you the reason why the order was canceled. There could be a lot of reasons payment processor sent a message back for canceling the order someone actually canceled it from admin ,,, But I can tell you how to make it invoice-able again. Take the order id. The entity_id field in the sales_order table, not the increment id. Let's say it's 110. ...


0

I would advise to disable all the custom extensions and third-party extensions. Then place a test order. If issue fixed, then enable the third-party extension one by one and check which extension causes this issue.


0

Found the solution :) print_r helped a lot main.DEBUG: Magento\Framework\Api\SearchCriteria Object ( [_data:protected] => Array ( [filter_groups] => Array ( [0] => Magento\Framework\Api\Search\FilterGroup Object ( [_data:protected] => Array ( [filters] => Array ( ...


0

You can use Plugin to do the same. public function afterPlace(OrderObject $subject, $result) { $result->setHoldBeforeState($result->getState()); $result->setHoldBeforeStatus($result->getStatus()); $result->setState(OrderObject::STATE_HOLDED) ->setStatus($subject->getConfig() ->...


0

app\code\Vendor\Extension\etc\events.xml <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd"> <event name="sales_order_place_after"> <observer name="vendor_sales_order_place_after" instance="Vendor\Extensoin\Observer\...


1

The data you are looking for 'QTY' on Checkout page. That comes by knockoutJS in Magento 2. Knockout basically bind data to HTML template and serves dynamic content. If you can check "Application" Tab (F12), In Local Storage > Mage-Cache-Storage > Cart (Section Data) driven from Knockout. You can see QTY, Options and all other parameters there. If ...


0

I had this same issue in Magento 2 and solved it as per details in my Gist. Adding here as it was one of the top links from relevant Google searches.


0

It was due to deadlock. due to deadlock it rollback first transaction of order insertion and continues to insert in other reference tables so it throw Integrity constraint error


3

I don't think it's related to customer being logged in or not, but I think order items are not persisted yet, as you're retrieving new order object. Also you should never use objectManager directly. Try updating your code to this: public function execute(\Magento\Framework\Event\Observer $observer){ $order = $observer->getEvent()->getOrder(); $...


Top 50 recent answers are included