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/...
8
votes
Magento 2: get shipment collection by order
You can get shipment collection from order object like this : $order->getShipmentsCollection();
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
...
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 ...
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
...
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()...
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 ...
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 $...
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 ...
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 ...
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='...
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 ...
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": [
{
"...
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>"...
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
*
* @...
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....
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->...
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.
...
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 ($...
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-...
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 ...
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:
...
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 ...
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 ...
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:
...
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 ...
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 ...
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\...
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": "...
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.
...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
shipment × 220magento2 × 97
shipment-tracking × 30
magento-1.9 × 28
orders × 27
invoice × 22
sales-order × 20
shipping × 20
email × 15
rest-api × 15
api × 14
magento-2.1 × 11
event-observer × 11
pdf × 10
magento2.3 × 9
magento-1.7 × 9
email-templates × 8
admin × 7
shipping-methods × 6
shipment-email × 6
magento-1.8 × 5
grid × 5
order-status × 5
programmatically × 5
magento2.2 × 4