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/...
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
...
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:...
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
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 ...
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
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
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
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/...
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....
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
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 ...
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 ...
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
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 ...
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>
<...
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
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
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 ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
shipment × 218magento2 × 96
shipment-tracking × 30
magento-1.9 × 28
orders × 27
sales-order × 22
invoice × 22
shipping × 20
api × 15
email × 15
rest-api × 14
event-observer × 12
magento-2.1 × 11
pdf × 10
magento-1.7 × 9
magento2.3 × 8
email-templates × 8
admin × 7
shipping-methods × 6
magento-1.8 × 5
grid × 5
order-status × 5
programmatically × 5
shipment-email × 5
magento2.2 × 4