Skip to main content
11 votes

How to add tracking url in shipment email for customer in Magento 2?

Please override this file: vendor/magento/module-sales/view/frontend/templates/email/shipment/track.phtml by creating this path: /app/design/frontend/Custom/theme/Magento_Sales/templates/email/...
Naveen Kumar's user avatar
8 votes

Magento 2: get shipment collection by order

You can get shipment collection from order object like this : $order->getShipmentsCollection();
Jonathan Ribas's user avatar
8 votes
Accepted

Magento 2: How to delete order's invoice, credit memo & shipment programmatically?

There are few steps are required for this. Load order by Order Factory Inject the factory class \Magento\Sales\Model\OrderFactory on __construct class.for getting order. Then order get by order id ...
Amit Bera's user avatar
  • 77.6k
6 votes
Accepted

Create shipment and invoice in mass action

I recently worked on this feature both (Invoice and Shipment). First you have to add Uicomponent in your module Path: app\code\Vendor\Module\view\adminhtml\ui_component\sales_order_grid.xml <?xml ...
Muhammad Hasham's user avatar
6 votes

Shipment Email Template issue Magento 2.3.1

You can create a template file in your theme this core file : vendor/magento/module-sales/view/frontend/templates/email/shipment/track.phtml and add condition before this function ...
Pradip Garchar's user avatar
5 votes
Accepted

Magento 2 order shipment tracking details

You can get all tracking details using this code : $tracksCollection = $order->getTracksCollection(); foreach ($tracksCollection->getItems() as $track) { echo $track->getTrackNumber()...
Rohan Hapani's user avatar
  • 17.5k
4 votes
Accepted

Creating shipment programatically does not update order items shipped - order never complete

After struggling for 2 days on this, trying to understand what the problem was, studying in deep also Magento core classes for module-sales, I found someone on Magento community who had similar ...
sissy's user avatar
  • 534
4 votes

Magento 2 get shipped items in sales_order_shipment_save_after event

class ProcessShipment implements ObserverInterface { /** * @var eventManager */ protected $_eventManager; /** * @var ObjectManagerInterface */ protected $...
Chandresh P.'s user avatar
4 votes

Magento 2 : Add Custom Field To Order, Invoice, Shipment, Credit Memo

I give my answer about order email. Other emails and pdf should works with the same logic. You have to look at \vendor\magento\module-sales\view\frontend\layout\sales_email_order_items.xml where the ...
LucScu's user avatar
  • 2,342
4 votes
Accepted

How can I fix this possible race condition in Magento 1?

I don't think any of the both events can do the trick by itself. As long as you don't need that entity_id for the condition before the Magento shipping kicks in, you can use both events to make it ...
Michael Türk's user avatar
4 votes

Shipment Email Template issue Magento 2.3.1

There must be some custom email template that must be using an older syntax (in file or in database) Replace {{block class='Magento\\Framework\\View\\Element\\Template' area='frontend' template='...
Twinkal's user avatar
  • 650
4 votes

Shipment emails not being sent even though other emails are working

I figured it out. When adding a shipment through the Admin page, there is an "Email Copy of Shipment" checkbox that must be checked to send the email. When using the API, the notify parameter must ...
Ben Rubin's user avatar
  • 549
4 votes
Accepted

M2 REST API: Creating shipment with products from MSI source

The issue lies in the JSON structure. You should use arguments.extension_attributes.source_code, instead of extension_attributes.source_code as shown below: { "items": [ { "...
Toine H's user avatar
  • 171
3 votes

Magento 2: get shipment collection by order

Just to add on how to debug it by your own. The PHP function called get_class_methods() will always be your friend. <?php echo "<pre>"; print_r(get_class_methods($order)); echo "</pre>"...
Rafael's user avatar
  • 53
3 votes
Accepted

Check if order can be shipped

I think you should change to $oder->canShip() to check if $order can be shipped. Because Core Magento already do that for us, look at this method: /** * Retrieve order shipment availability * * @...
Toan Tam's user avatar
  • 1,328
3 votes
Accepted

Magento 2 Mass shipment

First Made the ui component in your module app\code\Vendor\Module\view\adminhtml\ui_component\sales_order_grid.xml <?xml version="1.0" encoding="UTF-8"?> <listing xmlns:xsi="http://www.w3....
Muhammad Hasham's user avatar
3 votes

Shipment Email Template issue Magento 2.3.1

We had the same issue in Magento 2.3.3. I have fixed it in this way. Created a template file in the custom theme: Magento_Sales/templates/email/shipment/track.phtml <?php $_shipment = $block->...
Milan Maniya's user avatar
2 votes

Programatically add tracking to shipment - Mage_Api_Model_Resource_Abstract->_fault('not_exists')

I needed to add tracking information to an existing shipment associated with an existing order. Preferring to avoid directly writing to the database, I dug a little deeper into how to achieve this. ...
ben_weller's user avatar
2 votes
Accepted

The method getTtrackOrderUrl in order history page is depricated?

In the most recent version of Magento, the tracking is handled via a popup. The relevant code can be found under app/design/frontend/base/default/template/sales/order/view.phtml : <?php if ($...
Raphael at Digital Pianism's user avatar
2 votes

How can I fix this possible race condition in Magento 1?

I didn't look really deep, but I saw this in save(): $this->_beforeSave(); if ($this->_dataSaveAllowed) { $this->_getResource()->save($this); $this-...
Aurelien's user avatar
2 votes

Why "POST /rest/V1/order/:orderID/ship" doesn't work in Magento 2.1.1 CE?

what are you searching exactly? the webapi.xml declares the service layer interface and method here https://github.com/magento/magento2/blob/2.1/app/code/Magento/Sales/etc/webapi.xml#L251 the ...
David Verholen's user avatar
2 votes

How to add tracking url in shipment email for customer in Magento 2?

I recently had to implement tracking URL's in the shipment emails as well. The template to edit is: Magento_Sales/templates/email/shipment/track.phtml This block is referenced in 2 email templates: ...
Logan's user avatar
  • 456
2 votes
Accepted

Bypass shipment steps in checkout when customer already have a default shipment address?

normally, when you click the "next" button in the shipping step, an ajax call is triggered which sets the shipping address and shipping method in the quote. If you want to skip this step you would ...
David Verholen's user avatar
2 votes

How to get shipment id in magento 2?

STEP-BY-STEP PROCESS TO GET SHIPMENT TRACKING INFORMATION PROGRAMMATICALLY IN MAGENTO 2 Please follow the below steps to learn how to get shipment tracking information in Magento 2. STEP – 1 First of ...
Kuldeep Sharma's user avatar
2 votes
Accepted

Force order status and state to processing after creating shipment using observer

When you save data from your order model, i think magento will do some kind of validation for your order state and status, to come up with your trouble run this function after you save the order: ...
Idham Choudry's user avatar
2 votes
Accepted

magento 1.9 - 'submit shipping' btn is not working on admin page!

Solution for this question: Problem resolved: Change the file: items.phtml app\design\adminhtml\default\default\template\sales\order\shipment\create\items.phtml Change the function ...
Carlos Volp's user avatar
2 votes

Auto create shipment id as soon as New order arrives in magento 1.9.2

You need to create a custom extension with the observer of the following events: sales_order_save_after checkout_submit_all_after Where you can get order increment ID and use Magento API for the ...
Amasty's user avatar
  • 6,518
2 votes

Shipment view page 404 error

It looks like a routing issue, forwarding action to the other controller doesn't work as expected. Can you try changing the below file around line 49 Magento\Sales\Controller\Adminhtml\Shipment\...
mydons's user avatar
  • 491
2 votes

Magento2 save Custom shipment field by API

Try with below request payload { "items": [ { "order_item_id": 4473, "qty": 1 } ], "notify": true, "tracks": [ { "track_number": "3456789", "title": "...
Ramkishan Suthar's user avatar
2 votes
Accepted

Magento 2 - Sales Order Shipment Event/Observer

There are lots of example of links for events lists but mostly I follow below link, it contain almost all events, and this blog has sales_order_shipment_save_after as well, so I hope it will help you. ...
Aasim Goriya's user avatar
  • 5,454

Only top scored, non community-wiki answers of a minimum length are eligible