9 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.2k
7 votes

Magento 2 - sales_order_shipment_save_after

--Sales Order Shipment Save After event: app/code/Company/Module/etc/adminhtml/events.xml <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:...
Khoa TruongDinh's user avatar
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.3k
4 votes
Accepted

Magento 1.9.x: Tax rates and prices including tax

To have everything working review your settings, specially: Create the tax rates for every country for every rate Set the prices display as Taxes Included Ensure that the customer has a default ...
Enzo Perrotta's user avatar
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,323
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
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
  • 514
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
  • 620
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
  • 71
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

How to get the products associated with shipment Id?

First you need to load the shipment: $shipment = Mage::getModel('sales/order_shipment')->load($shipid); If you're using the increment id, you'll have to use: $shipment = Mage::getModel('sales/...
Raphael at Digital Pianism's user avatar
3 votes

How can I properly trigger shipment emails via the SOAP API?

I had exactly the same problem and it seems that there is solution without extending the API! The shipment API has an undocumented function called sendInfo. Thanks to cameronhimself for pointing this....
karpa's user avatar
  • 396
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,308
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

Send tracking number programmatically with SOAP

I had exactly the same problem and it seems that there is solution without extending the API! The shipment API has an undocumented function called sendInfo. Thanks to [cameronhimself][1] for pointing ...
karpa's user avatar
  • 396
2 votes

Magento event to observe shipment creation, not invoice

With sales_order_shipment_save_commit_after you will run into the same issue. The other mentioned events do not tell if the shipment was/will be created successfully. Probably the ...
mam08ixo's user avatar
  • 2,953
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

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

I've been trying to solve this via models with so many variation and none of them are working. I am quite tired with this approach, so I have solved it using direct SQL like this: // Add Shipment ...
Latheesan's user avatar
  • 1,038
2 votes

automatically email invoice and shipment after creating

you need to look at this magento event sales_order_shipment_save_after. So in app/code/local/Namespace/Module/etc/config.xml: ... <events> <sales_order_shipment_save_after> <...
Charlie's user avatar
  • 3,126
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

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

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

We came across an excellent solution from Scommerce which allows you to not only add tracking link to one shipping system but any number of shipping methods. The tracking URL can be added to the ...
Prashant Singh's user avatar

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