Shipping email ignored when API sends tracking number only if custom php present Planned...

Most bit efficient text communication method?

AppleTVs create a chatty alternate WiFi network

What is "gratricide"?

How do I use the new nonlinear finite element in Mathematica 12 for this equation?

How does Python know the values already stored in its memory?

Can the Great Weapon Master feat's damage bonus and accuracy penalty apply to attacks from the Spiritual Weapon spell?

Morning, Afternoon, Night Kanji

Project Euler #1 in C++

Disembodied hand growing fangs

Why does it sometimes sound good to play a grace note as a lead in to a note in a melody?

Using audio cues to encourage good posture

How much damage would a cupful of neutron star matter do to the Earth?

How does light 'choose' between wave and particle behaviour?

Why do we bend a book to keep it straight?

Chinese Seal on silk painting - what does it mean?

Is there hard evidence that the grant peer review system performs significantly better than random?

How to tell that you are a giant?

Why does the remaining Rebel fleet at the end of Rogue One seem dramatically larger than the one in A New Hope?

What does it mean that physics no longer uses mechanical models to describe phenomena?

Why is Nikon 1.4g better when Nikon 1.8g is sharper?

How do you solve the twins Paradox?

Maximum summed subsequences with non-adjacent items

How could we fake a moon landing now?

How come Sam didn't become Lord of Horn Hill?



Shipping email ignored when API sends tracking number only if custom php present



Planned maintenance scheduled April 23, 2019 at 00:00UTC (8:00pm US/Eastern)
Announcing the arrival of Valued Associate #679: Cesar Manara
Unicorn Meta Zoo #1: Why another podcast?API not returning proper shipping methods when calling shoppingCartShippingListCustom Shipping Method only for logged usersCustom Shipping Method - Execute some code when the admin submit a shipmentvariable for shipping tracking no in emailGetting Customer Tracking number via SOAP APIHow to pass data to update Order tracking number in magento 2 using REST API?Fetching last tracking number from another magento usin APIAdding a tracking number and shipping label to shipmentT-Hub Shipping tracking number not pairing with orderSend Tracking information email to customer when tracking number saved to Magento





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}







0















I have played with this even further and found the issue to be even more simple that what was previously presented. Please read all to get the gist of the issue. I wish to mention here that only the inclusion of a simple "href" is even causing the same error. Here is an example of the code causing the same problem described below.



This is the entire custom email/order/shipment/track.phtml file as modified with the added usps link.



<?php $_shipment=$this->getShipment() ?>
<?php $_order=$this->getOrder() ?>
<?php if ($_shipment && $_order && $_shipment->getAllTracks()): ?>
<table cellspacing="0" cellpadding="0" border="0" width="100%" style="border:1px solid #bebcb7; background:#f8f7f5;">
<thead>
<tr>
<th align="left" style="padding:3px 9px; background:rgb(242,248,228); border-bottom:1px solid #bebcb7;"><?php echo $this->__('Shipped By') ?></th>
<th align="center" style="padding:3px 9px; background:rgb(242,248,228); border-bottom:1px solid #bebcb7;"><?php echo $this->__('Tracking Number') ?></th>
</tr>
</thead>
<tbody>
<?php $i=0; foreach ($_shipment->getAllTracks() as $_item): $i++ ?>
<tr <?php echo $i%2?'bgcolor="#eeeded"':'' ?>>
<td align="left" valign="top" style="padding:3px 9px">United States Postal Service</td>
<td align="center" valign="top" style="padding:3px 9px"><a href="https://tools.usps.com/go/TrackConfirmAction_input?origTrackNum=<?php echo $_item->getNumber() ?>"><?php echo $_item->getNumber() ?></a></td>
</tr>
<?php endforeach ?>
</tbody>
</table>
<?php endif; ?>


This is the original track.phtml file found in base/default.



<?php $_shipment=$this->getShipment() ?>
<?php $_order=$this->getOrder() ?>
<?php if ($_shipment && $_order && $_shipment->getAllTracks()): ?>
<table cellspacing="0" cellpadding="0" border="0" width="100%" style="border:1px solid #bebcb7; background:#f8f7f5;">
<thead>
<tr>
<th align="left" bgcolor="#d9e5ee" style="padding:3px 9px"><?php echo $this->__('Shipped By') ?></th>
<th align="center" bgcolor="#d9e5ee" style="padding:3px 9px"><?php echo $this->__('Tracking Number') ?></th>
</tr>
</thead>
<tbody>
<?php $i=0; foreach ($_shipment->getAllTracks() as $_item): $i++ ?>
<tr <?php echo $i%2?'bgcolor="#eeeded"':'' ?>>
<td align="left" valign="top" style="padding:3px 9px"><?php echo $_item->getTitle() ?></td>
<td align="center" valign="top" style="padding:3px 9px"><?php echo $_item->getNumber() ?></td>
</tr>
<?php endforeach ?>
</tbody>
</table>
<?php endif; ?>


ORIGINAL MESSAGE:



We use a transactional email template for shipping notifications sent to customers when their order has shipped. The template contains the code below to insert the track/phtml block to add the tracking number with URL in the message.



{{block type='core/template' area='frontend' template='email/order/shipment/track.phtml' shipment=$shipment order=$order}}


Inside track.phtml, we added custom php code to wrap the tracking number is a hyperlink. When entering the tracking number manually and selecting the carrier, we have no problem. The t/n arrives as an active hyperlink. The title is, of course, automatically selected when the carrier is chosen from the drop-down box.



<?php $_shipment=$this->getShipment() ?>
<?php $_order=$this->getOrder() ?>
<?php if ($_shipment && $_order && $_shipment->getAllTracks()): ?>
<table cellspacing="0" cellpadding="0" border="0" width="100%" style="border:1px solid #bebcb7; background:#f8f7f5;">
<thead>
<tr>
<th align="left" style="padding:3px 9px; background:rgb(242,248,228); border-bottom:1px solid #bebcb7;"><?php echo $this->__('Shipped By') ?></th>
<th align="center" style="padding:3px 9px; background:rgb(242,248,228); border-bottom:1px solid #bebcb7;"><?php echo $this->__('Tracking Number') ?></th>
</tr>
</thead>
<tbody>
<?php $i=0; foreach ($_shipment->getAllTracks() as $_item): $i++ ?>
<tr <?php echo $i%2?'bgcolor="#eeeded"':'' ?>>
<td align="left" valign="top" style="padding:3px 9px"><?php echo $_item->getTitle() ?></td>
<?php if ($_item->getCarrierCode()=='usps'): ?>
<td align="center" valign="top" style="padding:3px 9px"><a href="https://tools.usps.com/go/TrackConfirmAction_input?origTrackNum=<?php echo $_item->getNumber() ?>"><?php echo $_item->getNumber() ?></a></td>
<?php else: ?>
<?php if ($_item->getCarrierCode()=='fedex'): ?>
<td align="center" valign="top" style="padding:3px 9px"><a href="http://www.fedex.com/fedextrack/index.html?tracknumbers=<?php echo $_item->getNumber() ?>"><?php echo $_item->getNumber() ?></a></td>
<?php else: ?>
<?php if ($_item->getCarrierCode()=='ups'): ?>
<td align="center" valign="top" style="padding:3px 9px"><a href="http://wwwapps.ups.com/WebTracking/track?HTMLVersion=5.0&loc=en_US&trackNums=<?php echo $_item->getNumber() ?>&track.x=Track"><?php echo $_item->getNumber() ?></a></td>
<?php else: ?>
<?php if ($_item->getCarrierCode()=='dhl'): ?>
<td align="center" valign="top" style="padding:3px 9px"><?php echo $_item->getNumber() ?></td>
<?php else: ?>
<td align="center" valign="top" style="padding:3px 9px"><?php echo $_item->getNumber() ?></td>
<?php endif; ?>
<?php endif; ?>
<?php endif; ?>
<?php endif; ?>
</tr>
<?php endforeach ?>
</tbody>
</table>
<?php endif; ?>


We started using a third-party shipping service called ShippingEasy. They automatically return the tracking number to Magento through an API. They also change the title, not the carrier, to contain the name ShippingEasy and a unique transaction number.



Here is the problem. For some reason, the track.phtml block is completely ignored when ShippingEasy delivers the t/n through the API. Their system properly selects the carrier as "usps." The transactional email is sent just fine, but with no tracking number and no table. So, we altered the code in track.phtml to getTitle and look for "ShippingEasy." See below.



<?php $_shipment=$this->getShipment() ?>
<?php $_order=$this->getOrder() ?>
<?php if ($_shipment && $_order && $_shipment->getAllTracks()): ?>
<table cellspacing="0" cellpadding="0" border="0" width="100%" style="border:1px solid #bebcb7; background:#f8f7f5;">
<thead>
<tr>
<th align="left" style="padding:3px 9px; background:rgb(242,248,228); border-bottom:1px solid #bebcb7;"><?php echo $this->__('Shipped By') ?></th>
<th align="center" style="padding:3px 9px; background:rgb(242,248,228); border-bottom:1px solid #bebcb7;"><?php echo $this->__('Tracking Number') ?></th>
</tr>
</thead>
<tbody>
<?php $i=0; foreach ($_shipment->getAllTracks() as $_item): $i++ ?>
<tr <?php echo $i%2?'bgcolor="#eeeded"':'' ?>>
<td align="left" valign="top" style="padding:3px 9px"><?php echo $_item->getTitle() ?></td>
<?php if (strpos($_item->getTitle(), 'ShippingEasy') !== false): ?>
<td align="center" valign="top" style="padding:3px 9px"><a href="https://tools.usps.com/go/TrackConfirmAction_input?origTrackNum=<?php echo $_item->getNumber() ?>"><?php echo $_item->getNumber() ?></a></td>
<?php else: ?>
<?php if ($_item->getTitle()=='Federal Express'): ?>
<td align="center" valign="top" style="padding:3px 9px"><a href="http://www.fedex.com/fedextrack/index.html?tracknumbers=<?php echo $_item->getNumber() ?>"><?php echo $_item->getNumber() ?></a></td>
<?php else: ?>
<?php if ($_item->getTitle()=='United Parcel Service'): ?>
<td align="center" valign="top" style="padding:3px 9px"><a href="http://wwwapps.ups.com/WebTracking/track?HTMLVersion=5.0&loc=en_US&trackNums=<?php echo $_item->getNumber() ?>&track.x=Track"><?php echo $_item->getNumber() ?></a></td>
<?php else: ?>
<?php if ($_item->getTitle()=='DHL'): ?>
<td align="center" valign="top" style="padding:3px 9px"><?php echo $_item->getNumber() ?></td>
<?php else: ?>
<td align="center" valign="top" style="padding:3px 9px"><?php echo $_item->getNumber() ?></td>
<?php endif; ?>
<?php endif; ?>
<?php endif; ?>
<?php endif; ?>
</tr>
<?php endforeach ?>
</tbody>
</table>
<?php endif; ?>


However, this still resulted in the API transfer of data from ShippingEasy to Magento to completely ignore inserting the block track.phtml in the transactional email.



Here is the odd part. If we revert to the track.phtml in base/default, the block is recognized and the t/n is transmitted. Furthermore, if we use our custom track.phtml file, we can resend the e-mail by manually clicking the button in Shipments in Order View to "Send Tracking Information" again.



One other thing. The reason the code looks for "ShippingEasy" in the title rather than an exact match is because:




  1. getCarrierCode worked manually when looking for "usps," but did not work with ShippingEasy. <?php if ($_item->getCarrierCode()=='usps'): ?>

  2. Each shipment contains the name ShippingEasy with a unique transaction number. So, we cannot look for an exact match. We were hoping that detecting the "ShippingEasy" string in the title would work.


Before you suggest it, ShippingEasy was of no help in fixing this.



To add to it, we have tested this in both 1.4.1.1 and 1.9.2.1, and the results are the same.



So, what would cause the transfer via API to completely ignore the block only when the custom php or merely the HTML href hyperlink is included in the track.phtml file? Any suggestions?










share|improve this question
















bumped to the homepage by Community 8 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
















  • Are you able to log one of the ShippingEasy API calls back to Magento and show it here?

    – kab8609
    Jan 9 '16 at 23:26











  • Honestly, I don't know. Where would that log likely reside?

    – Scot
    Jan 10 '16 at 0:24











  • I used this on a 1.7 install and it worked fine. Not sure what 1x version you are on right now. github.com/netz98/N98_ApiLogger. Install this extension and capture a response.

    – kab8609
    Jan 10 '16 at 18:54











  • Well, this is really not cool. I installed it and got nothing. Really weird. The bigger problem is that when I log out of admin, it shows a logout box and then immediately logs me back in. I then have to log out again, but it's only good for that one tab. All other tabs remain logged in. We've never had this happen before. Also, I'm not sure what I should find for evidence of the install in core_resource. So, I restored the DB and disengaged the etc/modules file, and it still keeps a persistent login. Magento is such a pain in the ass!

    – Scot
    Jan 11 '16 at 16:10











  • This doesn't sound normal at all. Magento does have a learning curve, however everything happens for a reason. Did you do everything on your own or did you have developers develop the site for you?

    – kab8609
    Jan 13 '16 at 2:23


















0















I have played with this even further and found the issue to be even more simple that what was previously presented. Please read all to get the gist of the issue. I wish to mention here that only the inclusion of a simple "href" is even causing the same error. Here is an example of the code causing the same problem described below.



This is the entire custom email/order/shipment/track.phtml file as modified with the added usps link.



<?php $_shipment=$this->getShipment() ?>
<?php $_order=$this->getOrder() ?>
<?php if ($_shipment && $_order && $_shipment->getAllTracks()): ?>
<table cellspacing="0" cellpadding="0" border="0" width="100%" style="border:1px solid #bebcb7; background:#f8f7f5;">
<thead>
<tr>
<th align="left" style="padding:3px 9px; background:rgb(242,248,228); border-bottom:1px solid #bebcb7;"><?php echo $this->__('Shipped By') ?></th>
<th align="center" style="padding:3px 9px; background:rgb(242,248,228); border-bottom:1px solid #bebcb7;"><?php echo $this->__('Tracking Number') ?></th>
</tr>
</thead>
<tbody>
<?php $i=0; foreach ($_shipment->getAllTracks() as $_item): $i++ ?>
<tr <?php echo $i%2?'bgcolor="#eeeded"':'' ?>>
<td align="left" valign="top" style="padding:3px 9px">United States Postal Service</td>
<td align="center" valign="top" style="padding:3px 9px"><a href="https://tools.usps.com/go/TrackConfirmAction_input?origTrackNum=<?php echo $_item->getNumber() ?>"><?php echo $_item->getNumber() ?></a></td>
</tr>
<?php endforeach ?>
</tbody>
</table>
<?php endif; ?>


This is the original track.phtml file found in base/default.



<?php $_shipment=$this->getShipment() ?>
<?php $_order=$this->getOrder() ?>
<?php if ($_shipment && $_order && $_shipment->getAllTracks()): ?>
<table cellspacing="0" cellpadding="0" border="0" width="100%" style="border:1px solid #bebcb7; background:#f8f7f5;">
<thead>
<tr>
<th align="left" bgcolor="#d9e5ee" style="padding:3px 9px"><?php echo $this->__('Shipped By') ?></th>
<th align="center" bgcolor="#d9e5ee" style="padding:3px 9px"><?php echo $this->__('Tracking Number') ?></th>
</tr>
</thead>
<tbody>
<?php $i=0; foreach ($_shipment->getAllTracks() as $_item): $i++ ?>
<tr <?php echo $i%2?'bgcolor="#eeeded"':'' ?>>
<td align="left" valign="top" style="padding:3px 9px"><?php echo $_item->getTitle() ?></td>
<td align="center" valign="top" style="padding:3px 9px"><?php echo $_item->getNumber() ?></td>
</tr>
<?php endforeach ?>
</tbody>
</table>
<?php endif; ?>


ORIGINAL MESSAGE:



We use a transactional email template for shipping notifications sent to customers when their order has shipped. The template contains the code below to insert the track/phtml block to add the tracking number with URL in the message.



{{block type='core/template' area='frontend' template='email/order/shipment/track.phtml' shipment=$shipment order=$order}}


Inside track.phtml, we added custom php code to wrap the tracking number is a hyperlink. When entering the tracking number manually and selecting the carrier, we have no problem. The t/n arrives as an active hyperlink. The title is, of course, automatically selected when the carrier is chosen from the drop-down box.



<?php $_shipment=$this->getShipment() ?>
<?php $_order=$this->getOrder() ?>
<?php if ($_shipment && $_order && $_shipment->getAllTracks()): ?>
<table cellspacing="0" cellpadding="0" border="0" width="100%" style="border:1px solid #bebcb7; background:#f8f7f5;">
<thead>
<tr>
<th align="left" style="padding:3px 9px; background:rgb(242,248,228); border-bottom:1px solid #bebcb7;"><?php echo $this->__('Shipped By') ?></th>
<th align="center" style="padding:3px 9px; background:rgb(242,248,228); border-bottom:1px solid #bebcb7;"><?php echo $this->__('Tracking Number') ?></th>
</tr>
</thead>
<tbody>
<?php $i=0; foreach ($_shipment->getAllTracks() as $_item): $i++ ?>
<tr <?php echo $i%2?'bgcolor="#eeeded"':'' ?>>
<td align="left" valign="top" style="padding:3px 9px"><?php echo $_item->getTitle() ?></td>
<?php if ($_item->getCarrierCode()=='usps'): ?>
<td align="center" valign="top" style="padding:3px 9px"><a href="https://tools.usps.com/go/TrackConfirmAction_input?origTrackNum=<?php echo $_item->getNumber() ?>"><?php echo $_item->getNumber() ?></a></td>
<?php else: ?>
<?php if ($_item->getCarrierCode()=='fedex'): ?>
<td align="center" valign="top" style="padding:3px 9px"><a href="http://www.fedex.com/fedextrack/index.html?tracknumbers=<?php echo $_item->getNumber() ?>"><?php echo $_item->getNumber() ?></a></td>
<?php else: ?>
<?php if ($_item->getCarrierCode()=='ups'): ?>
<td align="center" valign="top" style="padding:3px 9px"><a href="http://wwwapps.ups.com/WebTracking/track?HTMLVersion=5.0&loc=en_US&trackNums=<?php echo $_item->getNumber() ?>&track.x=Track"><?php echo $_item->getNumber() ?></a></td>
<?php else: ?>
<?php if ($_item->getCarrierCode()=='dhl'): ?>
<td align="center" valign="top" style="padding:3px 9px"><?php echo $_item->getNumber() ?></td>
<?php else: ?>
<td align="center" valign="top" style="padding:3px 9px"><?php echo $_item->getNumber() ?></td>
<?php endif; ?>
<?php endif; ?>
<?php endif; ?>
<?php endif; ?>
</tr>
<?php endforeach ?>
</tbody>
</table>
<?php endif; ?>


We started using a third-party shipping service called ShippingEasy. They automatically return the tracking number to Magento through an API. They also change the title, not the carrier, to contain the name ShippingEasy and a unique transaction number.



Here is the problem. For some reason, the track.phtml block is completely ignored when ShippingEasy delivers the t/n through the API. Their system properly selects the carrier as "usps." The transactional email is sent just fine, but with no tracking number and no table. So, we altered the code in track.phtml to getTitle and look for "ShippingEasy." See below.



<?php $_shipment=$this->getShipment() ?>
<?php $_order=$this->getOrder() ?>
<?php if ($_shipment && $_order && $_shipment->getAllTracks()): ?>
<table cellspacing="0" cellpadding="0" border="0" width="100%" style="border:1px solid #bebcb7; background:#f8f7f5;">
<thead>
<tr>
<th align="left" style="padding:3px 9px; background:rgb(242,248,228); border-bottom:1px solid #bebcb7;"><?php echo $this->__('Shipped By') ?></th>
<th align="center" style="padding:3px 9px; background:rgb(242,248,228); border-bottom:1px solid #bebcb7;"><?php echo $this->__('Tracking Number') ?></th>
</tr>
</thead>
<tbody>
<?php $i=0; foreach ($_shipment->getAllTracks() as $_item): $i++ ?>
<tr <?php echo $i%2?'bgcolor="#eeeded"':'' ?>>
<td align="left" valign="top" style="padding:3px 9px"><?php echo $_item->getTitle() ?></td>
<?php if (strpos($_item->getTitle(), 'ShippingEasy') !== false): ?>
<td align="center" valign="top" style="padding:3px 9px"><a href="https://tools.usps.com/go/TrackConfirmAction_input?origTrackNum=<?php echo $_item->getNumber() ?>"><?php echo $_item->getNumber() ?></a></td>
<?php else: ?>
<?php if ($_item->getTitle()=='Federal Express'): ?>
<td align="center" valign="top" style="padding:3px 9px"><a href="http://www.fedex.com/fedextrack/index.html?tracknumbers=<?php echo $_item->getNumber() ?>"><?php echo $_item->getNumber() ?></a></td>
<?php else: ?>
<?php if ($_item->getTitle()=='United Parcel Service'): ?>
<td align="center" valign="top" style="padding:3px 9px"><a href="http://wwwapps.ups.com/WebTracking/track?HTMLVersion=5.0&loc=en_US&trackNums=<?php echo $_item->getNumber() ?>&track.x=Track"><?php echo $_item->getNumber() ?></a></td>
<?php else: ?>
<?php if ($_item->getTitle()=='DHL'): ?>
<td align="center" valign="top" style="padding:3px 9px"><?php echo $_item->getNumber() ?></td>
<?php else: ?>
<td align="center" valign="top" style="padding:3px 9px"><?php echo $_item->getNumber() ?></td>
<?php endif; ?>
<?php endif; ?>
<?php endif; ?>
<?php endif; ?>
</tr>
<?php endforeach ?>
</tbody>
</table>
<?php endif; ?>


However, this still resulted in the API transfer of data from ShippingEasy to Magento to completely ignore inserting the block track.phtml in the transactional email.



Here is the odd part. If we revert to the track.phtml in base/default, the block is recognized and the t/n is transmitted. Furthermore, if we use our custom track.phtml file, we can resend the e-mail by manually clicking the button in Shipments in Order View to "Send Tracking Information" again.



One other thing. The reason the code looks for "ShippingEasy" in the title rather than an exact match is because:




  1. getCarrierCode worked manually when looking for "usps," but did not work with ShippingEasy. <?php if ($_item->getCarrierCode()=='usps'): ?>

  2. Each shipment contains the name ShippingEasy with a unique transaction number. So, we cannot look for an exact match. We were hoping that detecting the "ShippingEasy" string in the title would work.


Before you suggest it, ShippingEasy was of no help in fixing this.



To add to it, we have tested this in both 1.4.1.1 and 1.9.2.1, and the results are the same.



So, what would cause the transfer via API to completely ignore the block only when the custom php or merely the HTML href hyperlink is included in the track.phtml file? Any suggestions?










share|improve this question
















bumped to the homepage by Community 8 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
















  • Are you able to log one of the ShippingEasy API calls back to Magento and show it here?

    – kab8609
    Jan 9 '16 at 23:26











  • Honestly, I don't know. Where would that log likely reside?

    – Scot
    Jan 10 '16 at 0:24











  • I used this on a 1.7 install and it worked fine. Not sure what 1x version you are on right now. github.com/netz98/N98_ApiLogger. Install this extension and capture a response.

    – kab8609
    Jan 10 '16 at 18:54











  • Well, this is really not cool. I installed it and got nothing. Really weird. The bigger problem is that when I log out of admin, it shows a logout box and then immediately logs me back in. I then have to log out again, but it's only good for that one tab. All other tabs remain logged in. We've never had this happen before. Also, I'm not sure what I should find for evidence of the install in core_resource. So, I restored the DB and disengaged the etc/modules file, and it still keeps a persistent login. Magento is such a pain in the ass!

    – Scot
    Jan 11 '16 at 16:10











  • This doesn't sound normal at all. Magento does have a learning curve, however everything happens for a reason. Did you do everything on your own or did you have developers develop the site for you?

    – kab8609
    Jan 13 '16 at 2:23














0












0








0








I have played with this even further and found the issue to be even more simple that what was previously presented. Please read all to get the gist of the issue. I wish to mention here that only the inclusion of a simple "href" is even causing the same error. Here is an example of the code causing the same problem described below.



This is the entire custom email/order/shipment/track.phtml file as modified with the added usps link.



<?php $_shipment=$this->getShipment() ?>
<?php $_order=$this->getOrder() ?>
<?php if ($_shipment && $_order && $_shipment->getAllTracks()): ?>
<table cellspacing="0" cellpadding="0" border="0" width="100%" style="border:1px solid #bebcb7; background:#f8f7f5;">
<thead>
<tr>
<th align="left" style="padding:3px 9px; background:rgb(242,248,228); border-bottom:1px solid #bebcb7;"><?php echo $this->__('Shipped By') ?></th>
<th align="center" style="padding:3px 9px; background:rgb(242,248,228); border-bottom:1px solid #bebcb7;"><?php echo $this->__('Tracking Number') ?></th>
</tr>
</thead>
<tbody>
<?php $i=0; foreach ($_shipment->getAllTracks() as $_item): $i++ ?>
<tr <?php echo $i%2?'bgcolor="#eeeded"':'' ?>>
<td align="left" valign="top" style="padding:3px 9px">United States Postal Service</td>
<td align="center" valign="top" style="padding:3px 9px"><a href="https://tools.usps.com/go/TrackConfirmAction_input?origTrackNum=<?php echo $_item->getNumber() ?>"><?php echo $_item->getNumber() ?></a></td>
</tr>
<?php endforeach ?>
</tbody>
</table>
<?php endif; ?>


This is the original track.phtml file found in base/default.



<?php $_shipment=$this->getShipment() ?>
<?php $_order=$this->getOrder() ?>
<?php if ($_shipment && $_order && $_shipment->getAllTracks()): ?>
<table cellspacing="0" cellpadding="0" border="0" width="100%" style="border:1px solid #bebcb7; background:#f8f7f5;">
<thead>
<tr>
<th align="left" bgcolor="#d9e5ee" style="padding:3px 9px"><?php echo $this->__('Shipped By') ?></th>
<th align="center" bgcolor="#d9e5ee" style="padding:3px 9px"><?php echo $this->__('Tracking Number') ?></th>
</tr>
</thead>
<tbody>
<?php $i=0; foreach ($_shipment->getAllTracks() as $_item): $i++ ?>
<tr <?php echo $i%2?'bgcolor="#eeeded"':'' ?>>
<td align="left" valign="top" style="padding:3px 9px"><?php echo $_item->getTitle() ?></td>
<td align="center" valign="top" style="padding:3px 9px"><?php echo $_item->getNumber() ?></td>
</tr>
<?php endforeach ?>
</tbody>
</table>
<?php endif; ?>


ORIGINAL MESSAGE:



We use a transactional email template for shipping notifications sent to customers when their order has shipped. The template contains the code below to insert the track/phtml block to add the tracking number with URL in the message.



{{block type='core/template' area='frontend' template='email/order/shipment/track.phtml' shipment=$shipment order=$order}}


Inside track.phtml, we added custom php code to wrap the tracking number is a hyperlink. When entering the tracking number manually and selecting the carrier, we have no problem. The t/n arrives as an active hyperlink. The title is, of course, automatically selected when the carrier is chosen from the drop-down box.



<?php $_shipment=$this->getShipment() ?>
<?php $_order=$this->getOrder() ?>
<?php if ($_shipment && $_order && $_shipment->getAllTracks()): ?>
<table cellspacing="0" cellpadding="0" border="0" width="100%" style="border:1px solid #bebcb7; background:#f8f7f5;">
<thead>
<tr>
<th align="left" style="padding:3px 9px; background:rgb(242,248,228); border-bottom:1px solid #bebcb7;"><?php echo $this->__('Shipped By') ?></th>
<th align="center" style="padding:3px 9px; background:rgb(242,248,228); border-bottom:1px solid #bebcb7;"><?php echo $this->__('Tracking Number') ?></th>
</tr>
</thead>
<tbody>
<?php $i=0; foreach ($_shipment->getAllTracks() as $_item): $i++ ?>
<tr <?php echo $i%2?'bgcolor="#eeeded"':'' ?>>
<td align="left" valign="top" style="padding:3px 9px"><?php echo $_item->getTitle() ?></td>
<?php if ($_item->getCarrierCode()=='usps'): ?>
<td align="center" valign="top" style="padding:3px 9px"><a href="https://tools.usps.com/go/TrackConfirmAction_input?origTrackNum=<?php echo $_item->getNumber() ?>"><?php echo $_item->getNumber() ?></a></td>
<?php else: ?>
<?php if ($_item->getCarrierCode()=='fedex'): ?>
<td align="center" valign="top" style="padding:3px 9px"><a href="http://www.fedex.com/fedextrack/index.html?tracknumbers=<?php echo $_item->getNumber() ?>"><?php echo $_item->getNumber() ?></a></td>
<?php else: ?>
<?php if ($_item->getCarrierCode()=='ups'): ?>
<td align="center" valign="top" style="padding:3px 9px"><a href="http://wwwapps.ups.com/WebTracking/track?HTMLVersion=5.0&loc=en_US&trackNums=<?php echo $_item->getNumber() ?>&track.x=Track"><?php echo $_item->getNumber() ?></a></td>
<?php else: ?>
<?php if ($_item->getCarrierCode()=='dhl'): ?>
<td align="center" valign="top" style="padding:3px 9px"><?php echo $_item->getNumber() ?></td>
<?php else: ?>
<td align="center" valign="top" style="padding:3px 9px"><?php echo $_item->getNumber() ?></td>
<?php endif; ?>
<?php endif; ?>
<?php endif; ?>
<?php endif; ?>
</tr>
<?php endforeach ?>
</tbody>
</table>
<?php endif; ?>


We started using a third-party shipping service called ShippingEasy. They automatically return the tracking number to Magento through an API. They also change the title, not the carrier, to contain the name ShippingEasy and a unique transaction number.



Here is the problem. For some reason, the track.phtml block is completely ignored when ShippingEasy delivers the t/n through the API. Their system properly selects the carrier as "usps." The transactional email is sent just fine, but with no tracking number and no table. So, we altered the code in track.phtml to getTitle and look for "ShippingEasy." See below.



<?php $_shipment=$this->getShipment() ?>
<?php $_order=$this->getOrder() ?>
<?php if ($_shipment && $_order && $_shipment->getAllTracks()): ?>
<table cellspacing="0" cellpadding="0" border="0" width="100%" style="border:1px solid #bebcb7; background:#f8f7f5;">
<thead>
<tr>
<th align="left" style="padding:3px 9px; background:rgb(242,248,228); border-bottom:1px solid #bebcb7;"><?php echo $this->__('Shipped By') ?></th>
<th align="center" style="padding:3px 9px; background:rgb(242,248,228); border-bottom:1px solid #bebcb7;"><?php echo $this->__('Tracking Number') ?></th>
</tr>
</thead>
<tbody>
<?php $i=0; foreach ($_shipment->getAllTracks() as $_item): $i++ ?>
<tr <?php echo $i%2?'bgcolor="#eeeded"':'' ?>>
<td align="left" valign="top" style="padding:3px 9px"><?php echo $_item->getTitle() ?></td>
<?php if (strpos($_item->getTitle(), 'ShippingEasy') !== false): ?>
<td align="center" valign="top" style="padding:3px 9px"><a href="https://tools.usps.com/go/TrackConfirmAction_input?origTrackNum=<?php echo $_item->getNumber() ?>"><?php echo $_item->getNumber() ?></a></td>
<?php else: ?>
<?php if ($_item->getTitle()=='Federal Express'): ?>
<td align="center" valign="top" style="padding:3px 9px"><a href="http://www.fedex.com/fedextrack/index.html?tracknumbers=<?php echo $_item->getNumber() ?>"><?php echo $_item->getNumber() ?></a></td>
<?php else: ?>
<?php if ($_item->getTitle()=='United Parcel Service'): ?>
<td align="center" valign="top" style="padding:3px 9px"><a href="http://wwwapps.ups.com/WebTracking/track?HTMLVersion=5.0&loc=en_US&trackNums=<?php echo $_item->getNumber() ?>&track.x=Track"><?php echo $_item->getNumber() ?></a></td>
<?php else: ?>
<?php if ($_item->getTitle()=='DHL'): ?>
<td align="center" valign="top" style="padding:3px 9px"><?php echo $_item->getNumber() ?></td>
<?php else: ?>
<td align="center" valign="top" style="padding:3px 9px"><?php echo $_item->getNumber() ?></td>
<?php endif; ?>
<?php endif; ?>
<?php endif; ?>
<?php endif; ?>
</tr>
<?php endforeach ?>
</tbody>
</table>
<?php endif; ?>


However, this still resulted in the API transfer of data from ShippingEasy to Magento to completely ignore inserting the block track.phtml in the transactional email.



Here is the odd part. If we revert to the track.phtml in base/default, the block is recognized and the t/n is transmitted. Furthermore, if we use our custom track.phtml file, we can resend the e-mail by manually clicking the button in Shipments in Order View to "Send Tracking Information" again.



One other thing. The reason the code looks for "ShippingEasy" in the title rather than an exact match is because:




  1. getCarrierCode worked manually when looking for "usps," but did not work with ShippingEasy. <?php if ($_item->getCarrierCode()=='usps'): ?>

  2. Each shipment contains the name ShippingEasy with a unique transaction number. So, we cannot look for an exact match. We were hoping that detecting the "ShippingEasy" string in the title would work.


Before you suggest it, ShippingEasy was of no help in fixing this.



To add to it, we have tested this in both 1.4.1.1 and 1.9.2.1, and the results are the same.



So, what would cause the transfer via API to completely ignore the block only when the custom php or merely the HTML href hyperlink is included in the track.phtml file? Any suggestions?










share|improve this question
















I have played with this even further and found the issue to be even more simple that what was previously presented. Please read all to get the gist of the issue. I wish to mention here that only the inclusion of a simple "href" is even causing the same error. Here is an example of the code causing the same problem described below.



This is the entire custom email/order/shipment/track.phtml file as modified with the added usps link.



<?php $_shipment=$this->getShipment() ?>
<?php $_order=$this->getOrder() ?>
<?php if ($_shipment && $_order && $_shipment->getAllTracks()): ?>
<table cellspacing="0" cellpadding="0" border="0" width="100%" style="border:1px solid #bebcb7; background:#f8f7f5;">
<thead>
<tr>
<th align="left" style="padding:3px 9px; background:rgb(242,248,228); border-bottom:1px solid #bebcb7;"><?php echo $this->__('Shipped By') ?></th>
<th align="center" style="padding:3px 9px; background:rgb(242,248,228); border-bottom:1px solid #bebcb7;"><?php echo $this->__('Tracking Number') ?></th>
</tr>
</thead>
<tbody>
<?php $i=0; foreach ($_shipment->getAllTracks() as $_item): $i++ ?>
<tr <?php echo $i%2?'bgcolor="#eeeded"':'' ?>>
<td align="left" valign="top" style="padding:3px 9px">United States Postal Service</td>
<td align="center" valign="top" style="padding:3px 9px"><a href="https://tools.usps.com/go/TrackConfirmAction_input?origTrackNum=<?php echo $_item->getNumber() ?>"><?php echo $_item->getNumber() ?></a></td>
</tr>
<?php endforeach ?>
</tbody>
</table>
<?php endif; ?>


This is the original track.phtml file found in base/default.



<?php $_shipment=$this->getShipment() ?>
<?php $_order=$this->getOrder() ?>
<?php if ($_shipment && $_order && $_shipment->getAllTracks()): ?>
<table cellspacing="0" cellpadding="0" border="0" width="100%" style="border:1px solid #bebcb7; background:#f8f7f5;">
<thead>
<tr>
<th align="left" bgcolor="#d9e5ee" style="padding:3px 9px"><?php echo $this->__('Shipped By') ?></th>
<th align="center" bgcolor="#d9e5ee" style="padding:3px 9px"><?php echo $this->__('Tracking Number') ?></th>
</tr>
</thead>
<tbody>
<?php $i=0; foreach ($_shipment->getAllTracks() as $_item): $i++ ?>
<tr <?php echo $i%2?'bgcolor="#eeeded"':'' ?>>
<td align="left" valign="top" style="padding:3px 9px"><?php echo $_item->getTitle() ?></td>
<td align="center" valign="top" style="padding:3px 9px"><?php echo $_item->getNumber() ?></td>
</tr>
<?php endforeach ?>
</tbody>
</table>
<?php endif; ?>


ORIGINAL MESSAGE:



We use a transactional email template for shipping notifications sent to customers when their order has shipped. The template contains the code below to insert the track/phtml block to add the tracking number with URL in the message.



{{block type='core/template' area='frontend' template='email/order/shipment/track.phtml' shipment=$shipment order=$order}}


Inside track.phtml, we added custom php code to wrap the tracking number is a hyperlink. When entering the tracking number manually and selecting the carrier, we have no problem. The t/n arrives as an active hyperlink. The title is, of course, automatically selected when the carrier is chosen from the drop-down box.



<?php $_shipment=$this->getShipment() ?>
<?php $_order=$this->getOrder() ?>
<?php if ($_shipment && $_order && $_shipment->getAllTracks()): ?>
<table cellspacing="0" cellpadding="0" border="0" width="100%" style="border:1px solid #bebcb7; background:#f8f7f5;">
<thead>
<tr>
<th align="left" style="padding:3px 9px; background:rgb(242,248,228); border-bottom:1px solid #bebcb7;"><?php echo $this->__('Shipped By') ?></th>
<th align="center" style="padding:3px 9px; background:rgb(242,248,228); border-bottom:1px solid #bebcb7;"><?php echo $this->__('Tracking Number') ?></th>
</tr>
</thead>
<tbody>
<?php $i=0; foreach ($_shipment->getAllTracks() as $_item): $i++ ?>
<tr <?php echo $i%2?'bgcolor="#eeeded"':'' ?>>
<td align="left" valign="top" style="padding:3px 9px"><?php echo $_item->getTitle() ?></td>
<?php if ($_item->getCarrierCode()=='usps'): ?>
<td align="center" valign="top" style="padding:3px 9px"><a href="https://tools.usps.com/go/TrackConfirmAction_input?origTrackNum=<?php echo $_item->getNumber() ?>"><?php echo $_item->getNumber() ?></a></td>
<?php else: ?>
<?php if ($_item->getCarrierCode()=='fedex'): ?>
<td align="center" valign="top" style="padding:3px 9px"><a href="http://www.fedex.com/fedextrack/index.html?tracknumbers=<?php echo $_item->getNumber() ?>"><?php echo $_item->getNumber() ?></a></td>
<?php else: ?>
<?php if ($_item->getCarrierCode()=='ups'): ?>
<td align="center" valign="top" style="padding:3px 9px"><a href="http://wwwapps.ups.com/WebTracking/track?HTMLVersion=5.0&loc=en_US&trackNums=<?php echo $_item->getNumber() ?>&track.x=Track"><?php echo $_item->getNumber() ?></a></td>
<?php else: ?>
<?php if ($_item->getCarrierCode()=='dhl'): ?>
<td align="center" valign="top" style="padding:3px 9px"><?php echo $_item->getNumber() ?></td>
<?php else: ?>
<td align="center" valign="top" style="padding:3px 9px"><?php echo $_item->getNumber() ?></td>
<?php endif; ?>
<?php endif; ?>
<?php endif; ?>
<?php endif; ?>
</tr>
<?php endforeach ?>
</tbody>
</table>
<?php endif; ?>


We started using a third-party shipping service called ShippingEasy. They automatically return the tracking number to Magento through an API. They also change the title, not the carrier, to contain the name ShippingEasy and a unique transaction number.



Here is the problem. For some reason, the track.phtml block is completely ignored when ShippingEasy delivers the t/n through the API. Their system properly selects the carrier as "usps." The transactional email is sent just fine, but with no tracking number and no table. So, we altered the code in track.phtml to getTitle and look for "ShippingEasy." See below.



<?php $_shipment=$this->getShipment() ?>
<?php $_order=$this->getOrder() ?>
<?php if ($_shipment && $_order && $_shipment->getAllTracks()): ?>
<table cellspacing="0" cellpadding="0" border="0" width="100%" style="border:1px solid #bebcb7; background:#f8f7f5;">
<thead>
<tr>
<th align="left" style="padding:3px 9px; background:rgb(242,248,228); border-bottom:1px solid #bebcb7;"><?php echo $this->__('Shipped By') ?></th>
<th align="center" style="padding:3px 9px; background:rgb(242,248,228); border-bottom:1px solid #bebcb7;"><?php echo $this->__('Tracking Number') ?></th>
</tr>
</thead>
<tbody>
<?php $i=0; foreach ($_shipment->getAllTracks() as $_item): $i++ ?>
<tr <?php echo $i%2?'bgcolor="#eeeded"':'' ?>>
<td align="left" valign="top" style="padding:3px 9px"><?php echo $_item->getTitle() ?></td>
<?php if (strpos($_item->getTitle(), 'ShippingEasy') !== false): ?>
<td align="center" valign="top" style="padding:3px 9px"><a href="https://tools.usps.com/go/TrackConfirmAction_input?origTrackNum=<?php echo $_item->getNumber() ?>"><?php echo $_item->getNumber() ?></a></td>
<?php else: ?>
<?php if ($_item->getTitle()=='Federal Express'): ?>
<td align="center" valign="top" style="padding:3px 9px"><a href="http://www.fedex.com/fedextrack/index.html?tracknumbers=<?php echo $_item->getNumber() ?>"><?php echo $_item->getNumber() ?></a></td>
<?php else: ?>
<?php if ($_item->getTitle()=='United Parcel Service'): ?>
<td align="center" valign="top" style="padding:3px 9px"><a href="http://wwwapps.ups.com/WebTracking/track?HTMLVersion=5.0&loc=en_US&trackNums=<?php echo $_item->getNumber() ?>&track.x=Track"><?php echo $_item->getNumber() ?></a></td>
<?php else: ?>
<?php if ($_item->getTitle()=='DHL'): ?>
<td align="center" valign="top" style="padding:3px 9px"><?php echo $_item->getNumber() ?></td>
<?php else: ?>
<td align="center" valign="top" style="padding:3px 9px"><?php echo $_item->getNumber() ?></td>
<?php endif; ?>
<?php endif; ?>
<?php endif; ?>
<?php endif; ?>
</tr>
<?php endforeach ?>
</tbody>
</table>
<?php endif; ?>


However, this still resulted in the API transfer of data from ShippingEasy to Magento to completely ignore inserting the block track.phtml in the transactional email.



Here is the odd part. If we revert to the track.phtml in base/default, the block is recognized and the t/n is transmitted. Furthermore, if we use our custom track.phtml file, we can resend the e-mail by manually clicking the button in Shipments in Order View to "Send Tracking Information" again.



One other thing. The reason the code looks for "ShippingEasy" in the title rather than an exact match is because:




  1. getCarrierCode worked manually when looking for "usps," but did not work with ShippingEasy. <?php if ($_item->getCarrierCode()=='usps'): ?>

  2. Each shipment contains the name ShippingEasy with a unique transaction number. So, we cannot look for an exact match. We were hoping that detecting the "ShippingEasy" string in the title would work.


Before you suggest it, ShippingEasy was of no help in fixing this.



To add to it, we have tested this in both 1.4.1.1 and 1.9.2.1, and the results are the same.



So, what would cause the transfer via API to completely ignore the block only when the custom php or merely the HTML href hyperlink is included in the track.phtml file? Any suggestions?







magento-1.9 api shipping-methods transactional-mail shipment-tracking






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jan 20 '16 at 1:07







Scot

















asked Jan 9 '16 at 23:23









ScotScot

10811




10811





bumped to the homepage by Community 8 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.







bumped to the homepage by Community 8 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.















  • Are you able to log one of the ShippingEasy API calls back to Magento and show it here?

    – kab8609
    Jan 9 '16 at 23:26











  • Honestly, I don't know. Where would that log likely reside?

    – Scot
    Jan 10 '16 at 0:24











  • I used this on a 1.7 install and it worked fine. Not sure what 1x version you are on right now. github.com/netz98/N98_ApiLogger. Install this extension and capture a response.

    – kab8609
    Jan 10 '16 at 18:54











  • Well, this is really not cool. I installed it and got nothing. Really weird. The bigger problem is that when I log out of admin, it shows a logout box and then immediately logs me back in. I then have to log out again, but it's only good for that one tab. All other tabs remain logged in. We've never had this happen before. Also, I'm not sure what I should find for evidence of the install in core_resource. So, I restored the DB and disengaged the etc/modules file, and it still keeps a persistent login. Magento is such a pain in the ass!

    – Scot
    Jan 11 '16 at 16:10











  • This doesn't sound normal at all. Magento does have a learning curve, however everything happens for a reason. Did you do everything on your own or did you have developers develop the site for you?

    – kab8609
    Jan 13 '16 at 2:23



















  • Are you able to log one of the ShippingEasy API calls back to Magento and show it here?

    – kab8609
    Jan 9 '16 at 23:26











  • Honestly, I don't know. Where would that log likely reside?

    – Scot
    Jan 10 '16 at 0:24











  • I used this on a 1.7 install and it worked fine. Not sure what 1x version you are on right now. github.com/netz98/N98_ApiLogger. Install this extension and capture a response.

    – kab8609
    Jan 10 '16 at 18:54











  • Well, this is really not cool. I installed it and got nothing. Really weird. The bigger problem is that when I log out of admin, it shows a logout box and then immediately logs me back in. I then have to log out again, but it's only good for that one tab. All other tabs remain logged in. We've never had this happen before. Also, I'm not sure what I should find for evidence of the install in core_resource. So, I restored the DB and disengaged the etc/modules file, and it still keeps a persistent login. Magento is such a pain in the ass!

    – Scot
    Jan 11 '16 at 16:10











  • This doesn't sound normal at all. Magento does have a learning curve, however everything happens for a reason. Did you do everything on your own or did you have developers develop the site for you?

    – kab8609
    Jan 13 '16 at 2:23

















Are you able to log one of the ShippingEasy API calls back to Magento and show it here?

– kab8609
Jan 9 '16 at 23:26





Are you able to log one of the ShippingEasy API calls back to Magento and show it here?

– kab8609
Jan 9 '16 at 23:26













Honestly, I don't know. Where would that log likely reside?

– Scot
Jan 10 '16 at 0:24





Honestly, I don't know. Where would that log likely reside?

– Scot
Jan 10 '16 at 0:24













I used this on a 1.7 install and it worked fine. Not sure what 1x version you are on right now. github.com/netz98/N98_ApiLogger. Install this extension and capture a response.

– kab8609
Jan 10 '16 at 18:54





I used this on a 1.7 install and it worked fine. Not sure what 1x version you are on right now. github.com/netz98/N98_ApiLogger. Install this extension and capture a response.

– kab8609
Jan 10 '16 at 18:54













Well, this is really not cool. I installed it and got nothing. Really weird. The bigger problem is that when I log out of admin, it shows a logout box and then immediately logs me back in. I then have to log out again, but it's only good for that one tab. All other tabs remain logged in. We've never had this happen before. Also, I'm not sure what I should find for evidence of the install in core_resource. So, I restored the DB and disengaged the etc/modules file, and it still keeps a persistent login. Magento is such a pain in the ass!

– Scot
Jan 11 '16 at 16:10





Well, this is really not cool. I installed it and got nothing. Really weird. The bigger problem is that when I log out of admin, it shows a logout box and then immediately logs me back in. I then have to log out again, but it's only good for that one tab. All other tabs remain logged in. We've never had this happen before. Also, I'm not sure what I should find for evidence of the install in core_resource. So, I restored the DB and disengaged the etc/modules file, and it still keeps a persistent login. Magento is such a pain in the ass!

– Scot
Jan 11 '16 at 16:10













This doesn't sound normal at all. Magento does have a learning curve, however everything happens for a reason. Did you do everything on your own or did you have developers develop the site for you?

– kab8609
Jan 13 '16 at 2:23





This doesn't sound normal at all. Magento does have a learning curve, however everything happens for a reason. Did you do everything on your own or did you have developers develop the site for you?

– kab8609
Jan 13 '16 at 2:23










1 Answer
1






active

oldest

votes


















0














Maybe you run into the same issue i had. I got emails, not containing the correct updated informations.



i figured out (Magento 1.7.2) that the Email for tracking is generated even before the tracking information was saved. Normally all works fine in default, but sometimes it happened, that the email sending is generated before the tracking is generated or updated.



What i were doing is to add an additional $this->save() in app/code/core/Mage/Sales/Model/Order/Shipment.php at the function addTrack right before the return statement.



For sure i didn't do this in the core file itself, i've cloned it into app/code/local/Mage/Sales/Model/Order/Shipment.php



My addTrack looks like this now:



public function addTrack(Mage_Sales_Model_Order_Shipment_Track $track)
{
$track->setShipment($this)
->setParentId($this->getId())
->setOrderId($this->getOrderId())
->setStoreId($this->getStoreId());
if (!$track->getId()) {
$this->getTracksCollection()->addItem($track);
}

/**
* Track saving is implemented in _afterSave()
* This enforces Mage_Core_Model_Abstract::save() not to skip _afterSave()
*/
$this->_hasDataChanges = true;
/**
* Added additional $this->save(); to have the new data for shippment
* tracking already in the Mage_Sales_Model_Order_Shipment object.
* If this would not happen, the tracking mails generated may have old
* or wrong data regarding carrier title.
*/
$this->save();

return $this;
}


EDIT 3nd May 2016:
Hi Scot,



in app/code/local/Mage/Sales/Model/Order/Shipment/Api/V2.php and app/code/local/Mage/Sales/Model/Order/Shipment/Api.php i've REMOVED $shipment->sendEmail($email, ($includeComment ? $comment : '')); in the create() function at the try/catch block right after the ->save();



public function create($orderIncrementId, $itemsQty = array(), $comment = null, $email = false,
$includeComment = false
) {
$order = Mage::getModel('sales/order')->loadByIncrementId($orderIncrementId);

/**
* Check order existing
*/
if (!$order->getId()) {
$this->_fault('order_not_exists');
}

/**
* Check shipment create availability
*/
if (!$order->canShip()) {
$this->_fault('data_invalid', Mage::helper('sales')->__('Cannot do shipment for order.'));
}

/* @var $shipment Mage_Sales_Model_Order_Shipment */
$shipment = $order->prepareShipment($itemsQty);
if ($shipment) {
$shipment->register();
$shipment->addComment($comment, $email && $includeComment);
if ($email) {
$shipment->setEmailSent(true);
}
$shipment->getOrder()->setIsInProcess(true);
try {
$transactionSave = Mage::getModel('core/resource_transaction')
->addObject($shipment)
->addObject($shipment->getOrder())
->save();
} catch (Mage_Core_Exception $e) {
$this->_fault('data_invalid', $e->getMessage());
}
return $shipment->getIncrementId();
}
return null;
}


But i've added the email send in addTrack()



public function addTrack($shipmentIncrementId, $carrier, $title, $trackNumber)
{
$shipment = Mage::getModel('sales/order_shipment')->loadByIncrementId($shipmentIncrementId);

/* @var $shipment Mage_Sales_Model_Order_Shipment */

if (!$shipment->getId()) {
$this->_fault('not_exists');
}

$carriers = $this->_getCarriers($shipment);

if (!isset($carriers[$carrier])) {
$this->_fault('data_invalid', Mage::helper('sales')->__('Invalid carrier specified.'));
}

$track = Mage::getModel('sales/order_shipment_track')
->setNumber($trackNumber)
->setCarrierCode($carrier)
->setTitle($title);

$shipment->addTrack($track);

try {
$shipment->save();
$track->save();
if(!$shipment->getEmailSent()) {
$shipment->sendEmail(true, $shipment->getCommentsCollection());
$shipment->setEmailSent(true);
$shipment->save();
}
} catch (Mage_Core_Exception $e) {
$this->_fault('data_invalid', $e->getMessage());
}

return $track->getId();
}


Hope i didn't mix up something again.






share|improve this answer


























  • Michael, Thank you for responding. For some reason I did not get an email that you responded. I normally do. I tried your suggestion and nothing changed. Any other suggestions you may have are greatly welcomed.

    – Scot
    May 2 '16 at 5:34











  • Hi Scot, see my edit please, as it doesnt fit into the comment.

    – Michael
    May 2 '16 at 7:19











  • Thank you for the quick response. Did you keep your save() added to app/code/local/Mage/Sales/Model/Order/Shipment.php in addition to these two changes?

    – Scot
    May 2 '16 at 18:43











  • yes, because under some circumstances i can't remember now i needed it...

    – Michael
    May 2 '16 at 19:30











  • Michael, I'm confused. Both of your edited boxes are the same and I don't see the added $shipment nor sendEmail(). The code you added is the same that I have in both Api.php and V2.php in 1.9.2.2.

    – Scot
    May 2 '16 at 20:32












Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "479"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f96582%2fshipping-email-ignored-when-api-sends-tracking-number-only-if-custom-php-present%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









0














Maybe you run into the same issue i had. I got emails, not containing the correct updated informations.



i figured out (Magento 1.7.2) that the Email for tracking is generated even before the tracking information was saved. Normally all works fine in default, but sometimes it happened, that the email sending is generated before the tracking is generated or updated.



What i were doing is to add an additional $this->save() in app/code/core/Mage/Sales/Model/Order/Shipment.php at the function addTrack right before the return statement.



For sure i didn't do this in the core file itself, i've cloned it into app/code/local/Mage/Sales/Model/Order/Shipment.php



My addTrack looks like this now:



public function addTrack(Mage_Sales_Model_Order_Shipment_Track $track)
{
$track->setShipment($this)
->setParentId($this->getId())
->setOrderId($this->getOrderId())
->setStoreId($this->getStoreId());
if (!$track->getId()) {
$this->getTracksCollection()->addItem($track);
}

/**
* Track saving is implemented in _afterSave()
* This enforces Mage_Core_Model_Abstract::save() not to skip _afterSave()
*/
$this->_hasDataChanges = true;
/**
* Added additional $this->save(); to have the new data for shippment
* tracking already in the Mage_Sales_Model_Order_Shipment object.
* If this would not happen, the tracking mails generated may have old
* or wrong data regarding carrier title.
*/
$this->save();

return $this;
}


EDIT 3nd May 2016:
Hi Scot,



in app/code/local/Mage/Sales/Model/Order/Shipment/Api/V2.php and app/code/local/Mage/Sales/Model/Order/Shipment/Api.php i've REMOVED $shipment->sendEmail($email, ($includeComment ? $comment : '')); in the create() function at the try/catch block right after the ->save();



public function create($orderIncrementId, $itemsQty = array(), $comment = null, $email = false,
$includeComment = false
) {
$order = Mage::getModel('sales/order')->loadByIncrementId($orderIncrementId);

/**
* Check order existing
*/
if (!$order->getId()) {
$this->_fault('order_not_exists');
}

/**
* Check shipment create availability
*/
if (!$order->canShip()) {
$this->_fault('data_invalid', Mage::helper('sales')->__('Cannot do shipment for order.'));
}

/* @var $shipment Mage_Sales_Model_Order_Shipment */
$shipment = $order->prepareShipment($itemsQty);
if ($shipment) {
$shipment->register();
$shipment->addComment($comment, $email && $includeComment);
if ($email) {
$shipment->setEmailSent(true);
}
$shipment->getOrder()->setIsInProcess(true);
try {
$transactionSave = Mage::getModel('core/resource_transaction')
->addObject($shipment)
->addObject($shipment->getOrder())
->save();
} catch (Mage_Core_Exception $e) {
$this->_fault('data_invalid', $e->getMessage());
}
return $shipment->getIncrementId();
}
return null;
}


But i've added the email send in addTrack()



public function addTrack($shipmentIncrementId, $carrier, $title, $trackNumber)
{
$shipment = Mage::getModel('sales/order_shipment')->loadByIncrementId($shipmentIncrementId);

/* @var $shipment Mage_Sales_Model_Order_Shipment */

if (!$shipment->getId()) {
$this->_fault('not_exists');
}

$carriers = $this->_getCarriers($shipment);

if (!isset($carriers[$carrier])) {
$this->_fault('data_invalid', Mage::helper('sales')->__('Invalid carrier specified.'));
}

$track = Mage::getModel('sales/order_shipment_track')
->setNumber($trackNumber)
->setCarrierCode($carrier)
->setTitle($title);

$shipment->addTrack($track);

try {
$shipment->save();
$track->save();
if(!$shipment->getEmailSent()) {
$shipment->sendEmail(true, $shipment->getCommentsCollection());
$shipment->setEmailSent(true);
$shipment->save();
}
} catch (Mage_Core_Exception $e) {
$this->_fault('data_invalid', $e->getMessage());
}

return $track->getId();
}


Hope i didn't mix up something again.






share|improve this answer


























  • Michael, Thank you for responding. For some reason I did not get an email that you responded. I normally do. I tried your suggestion and nothing changed. Any other suggestions you may have are greatly welcomed.

    – Scot
    May 2 '16 at 5:34











  • Hi Scot, see my edit please, as it doesnt fit into the comment.

    – Michael
    May 2 '16 at 7:19











  • Thank you for the quick response. Did you keep your save() added to app/code/local/Mage/Sales/Model/Order/Shipment.php in addition to these two changes?

    – Scot
    May 2 '16 at 18:43











  • yes, because under some circumstances i can't remember now i needed it...

    – Michael
    May 2 '16 at 19:30











  • Michael, I'm confused. Both of your edited boxes are the same and I don't see the added $shipment nor sendEmail(). The code you added is the same that I have in both Api.php and V2.php in 1.9.2.2.

    – Scot
    May 2 '16 at 20:32
















0














Maybe you run into the same issue i had. I got emails, not containing the correct updated informations.



i figured out (Magento 1.7.2) that the Email for tracking is generated even before the tracking information was saved. Normally all works fine in default, but sometimes it happened, that the email sending is generated before the tracking is generated or updated.



What i were doing is to add an additional $this->save() in app/code/core/Mage/Sales/Model/Order/Shipment.php at the function addTrack right before the return statement.



For sure i didn't do this in the core file itself, i've cloned it into app/code/local/Mage/Sales/Model/Order/Shipment.php



My addTrack looks like this now:



public function addTrack(Mage_Sales_Model_Order_Shipment_Track $track)
{
$track->setShipment($this)
->setParentId($this->getId())
->setOrderId($this->getOrderId())
->setStoreId($this->getStoreId());
if (!$track->getId()) {
$this->getTracksCollection()->addItem($track);
}

/**
* Track saving is implemented in _afterSave()
* This enforces Mage_Core_Model_Abstract::save() not to skip _afterSave()
*/
$this->_hasDataChanges = true;
/**
* Added additional $this->save(); to have the new data for shippment
* tracking already in the Mage_Sales_Model_Order_Shipment object.
* If this would not happen, the tracking mails generated may have old
* or wrong data regarding carrier title.
*/
$this->save();

return $this;
}


EDIT 3nd May 2016:
Hi Scot,



in app/code/local/Mage/Sales/Model/Order/Shipment/Api/V2.php and app/code/local/Mage/Sales/Model/Order/Shipment/Api.php i've REMOVED $shipment->sendEmail($email, ($includeComment ? $comment : '')); in the create() function at the try/catch block right after the ->save();



public function create($orderIncrementId, $itemsQty = array(), $comment = null, $email = false,
$includeComment = false
) {
$order = Mage::getModel('sales/order')->loadByIncrementId($orderIncrementId);

/**
* Check order existing
*/
if (!$order->getId()) {
$this->_fault('order_not_exists');
}

/**
* Check shipment create availability
*/
if (!$order->canShip()) {
$this->_fault('data_invalid', Mage::helper('sales')->__('Cannot do shipment for order.'));
}

/* @var $shipment Mage_Sales_Model_Order_Shipment */
$shipment = $order->prepareShipment($itemsQty);
if ($shipment) {
$shipment->register();
$shipment->addComment($comment, $email && $includeComment);
if ($email) {
$shipment->setEmailSent(true);
}
$shipment->getOrder()->setIsInProcess(true);
try {
$transactionSave = Mage::getModel('core/resource_transaction')
->addObject($shipment)
->addObject($shipment->getOrder())
->save();
} catch (Mage_Core_Exception $e) {
$this->_fault('data_invalid', $e->getMessage());
}
return $shipment->getIncrementId();
}
return null;
}


But i've added the email send in addTrack()



public function addTrack($shipmentIncrementId, $carrier, $title, $trackNumber)
{
$shipment = Mage::getModel('sales/order_shipment')->loadByIncrementId($shipmentIncrementId);

/* @var $shipment Mage_Sales_Model_Order_Shipment */

if (!$shipment->getId()) {
$this->_fault('not_exists');
}

$carriers = $this->_getCarriers($shipment);

if (!isset($carriers[$carrier])) {
$this->_fault('data_invalid', Mage::helper('sales')->__('Invalid carrier specified.'));
}

$track = Mage::getModel('sales/order_shipment_track')
->setNumber($trackNumber)
->setCarrierCode($carrier)
->setTitle($title);

$shipment->addTrack($track);

try {
$shipment->save();
$track->save();
if(!$shipment->getEmailSent()) {
$shipment->sendEmail(true, $shipment->getCommentsCollection());
$shipment->setEmailSent(true);
$shipment->save();
}
} catch (Mage_Core_Exception $e) {
$this->_fault('data_invalid', $e->getMessage());
}

return $track->getId();
}


Hope i didn't mix up something again.






share|improve this answer


























  • Michael, Thank you for responding. For some reason I did not get an email that you responded. I normally do. I tried your suggestion and nothing changed. Any other suggestions you may have are greatly welcomed.

    – Scot
    May 2 '16 at 5:34











  • Hi Scot, see my edit please, as it doesnt fit into the comment.

    – Michael
    May 2 '16 at 7:19











  • Thank you for the quick response. Did you keep your save() added to app/code/local/Mage/Sales/Model/Order/Shipment.php in addition to these two changes?

    – Scot
    May 2 '16 at 18:43











  • yes, because under some circumstances i can't remember now i needed it...

    – Michael
    May 2 '16 at 19:30











  • Michael, I'm confused. Both of your edited boxes are the same and I don't see the added $shipment nor sendEmail(). The code you added is the same that I have in both Api.php and V2.php in 1.9.2.2.

    – Scot
    May 2 '16 at 20:32














0












0








0







Maybe you run into the same issue i had. I got emails, not containing the correct updated informations.



i figured out (Magento 1.7.2) that the Email for tracking is generated even before the tracking information was saved. Normally all works fine in default, but sometimes it happened, that the email sending is generated before the tracking is generated or updated.



What i were doing is to add an additional $this->save() in app/code/core/Mage/Sales/Model/Order/Shipment.php at the function addTrack right before the return statement.



For sure i didn't do this in the core file itself, i've cloned it into app/code/local/Mage/Sales/Model/Order/Shipment.php



My addTrack looks like this now:



public function addTrack(Mage_Sales_Model_Order_Shipment_Track $track)
{
$track->setShipment($this)
->setParentId($this->getId())
->setOrderId($this->getOrderId())
->setStoreId($this->getStoreId());
if (!$track->getId()) {
$this->getTracksCollection()->addItem($track);
}

/**
* Track saving is implemented in _afterSave()
* This enforces Mage_Core_Model_Abstract::save() not to skip _afterSave()
*/
$this->_hasDataChanges = true;
/**
* Added additional $this->save(); to have the new data for shippment
* tracking already in the Mage_Sales_Model_Order_Shipment object.
* If this would not happen, the tracking mails generated may have old
* or wrong data regarding carrier title.
*/
$this->save();

return $this;
}


EDIT 3nd May 2016:
Hi Scot,



in app/code/local/Mage/Sales/Model/Order/Shipment/Api/V2.php and app/code/local/Mage/Sales/Model/Order/Shipment/Api.php i've REMOVED $shipment->sendEmail($email, ($includeComment ? $comment : '')); in the create() function at the try/catch block right after the ->save();



public function create($orderIncrementId, $itemsQty = array(), $comment = null, $email = false,
$includeComment = false
) {
$order = Mage::getModel('sales/order')->loadByIncrementId($orderIncrementId);

/**
* Check order existing
*/
if (!$order->getId()) {
$this->_fault('order_not_exists');
}

/**
* Check shipment create availability
*/
if (!$order->canShip()) {
$this->_fault('data_invalid', Mage::helper('sales')->__('Cannot do shipment for order.'));
}

/* @var $shipment Mage_Sales_Model_Order_Shipment */
$shipment = $order->prepareShipment($itemsQty);
if ($shipment) {
$shipment->register();
$shipment->addComment($comment, $email && $includeComment);
if ($email) {
$shipment->setEmailSent(true);
}
$shipment->getOrder()->setIsInProcess(true);
try {
$transactionSave = Mage::getModel('core/resource_transaction')
->addObject($shipment)
->addObject($shipment->getOrder())
->save();
} catch (Mage_Core_Exception $e) {
$this->_fault('data_invalid', $e->getMessage());
}
return $shipment->getIncrementId();
}
return null;
}


But i've added the email send in addTrack()



public function addTrack($shipmentIncrementId, $carrier, $title, $trackNumber)
{
$shipment = Mage::getModel('sales/order_shipment')->loadByIncrementId($shipmentIncrementId);

/* @var $shipment Mage_Sales_Model_Order_Shipment */

if (!$shipment->getId()) {
$this->_fault('not_exists');
}

$carriers = $this->_getCarriers($shipment);

if (!isset($carriers[$carrier])) {
$this->_fault('data_invalid', Mage::helper('sales')->__('Invalid carrier specified.'));
}

$track = Mage::getModel('sales/order_shipment_track')
->setNumber($trackNumber)
->setCarrierCode($carrier)
->setTitle($title);

$shipment->addTrack($track);

try {
$shipment->save();
$track->save();
if(!$shipment->getEmailSent()) {
$shipment->sendEmail(true, $shipment->getCommentsCollection());
$shipment->setEmailSent(true);
$shipment->save();
}
} catch (Mage_Core_Exception $e) {
$this->_fault('data_invalid', $e->getMessage());
}

return $track->getId();
}


Hope i didn't mix up something again.






share|improve this answer















Maybe you run into the same issue i had. I got emails, not containing the correct updated informations.



i figured out (Magento 1.7.2) that the Email for tracking is generated even before the tracking information was saved. Normally all works fine in default, but sometimes it happened, that the email sending is generated before the tracking is generated or updated.



What i were doing is to add an additional $this->save() in app/code/core/Mage/Sales/Model/Order/Shipment.php at the function addTrack right before the return statement.



For sure i didn't do this in the core file itself, i've cloned it into app/code/local/Mage/Sales/Model/Order/Shipment.php



My addTrack looks like this now:



public function addTrack(Mage_Sales_Model_Order_Shipment_Track $track)
{
$track->setShipment($this)
->setParentId($this->getId())
->setOrderId($this->getOrderId())
->setStoreId($this->getStoreId());
if (!$track->getId()) {
$this->getTracksCollection()->addItem($track);
}

/**
* Track saving is implemented in _afterSave()
* This enforces Mage_Core_Model_Abstract::save() not to skip _afterSave()
*/
$this->_hasDataChanges = true;
/**
* Added additional $this->save(); to have the new data for shippment
* tracking already in the Mage_Sales_Model_Order_Shipment object.
* If this would not happen, the tracking mails generated may have old
* or wrong data regarding carrier title.
*/
$this->save();

return $this;
}


EDIT 3nd May 2016:
Hi Scot,



in app/code/local/Mage/Sales/Model/Order/Shipment/Api/V2.php and app/code/local/Mage/Sales/Model/Order/Shipment/Api.php i've REMOVED $shipment->sendEmail($email, ($includeComment ? $comment : '')); in the create() function at the try/catch block right after the ->save();



public function create($orderIncrementId, $itemsQty = array(), $comment = null, $email = false,
$includeComment = false
) {
$order = Mage::getModel('sales/order')->loadByIncrementId($orderIncrementId);

/**
* Check order existing
*/
if (!$order->getId()) {
$this->_fault('order_not_exists');
}

/**
* Check shipment create availability
*/
if (!$order->canShip()) {
$this->_fault('data_invalid', Mage::helper('sales')->__('Cannot do shipment for order.'));
}

/* @var $shipment Mage_Sales_Model_Order_Shipment */
$shipment = $order->prepareShipment($itemsQty);
if ($shipment) {
$shipment->register();
$shipment->addComment($comment, $email && $includeComment);
if ($email) {
$shipment->setEmailSent(true);
}
$shipment->getOrder()->setIsInProcess(true);
try {
$transactionSave = Mage::getModel('core/resource_transaction')
->addObject($shipment)
->addObject($shipment->getOrder())
->save();
} catch (Mage_Core_Exception $e) {
$this->_fault('data_invalid', $e->getMessage());
}
return $shipment->getIncrementId();
}
return null;
}


But i've added the email send in addTrack()



public function addTrack($shipmentIncrementId, $carrier, $title, $trackNumber)
{
$shipment = Mage::getModel('sales/order_shipment')->loadByIncrementId($shipmentIncrementId);

/* @var $shipment Mage_Sales_Model_Order_Shipment */

if (!$shipment->getId()) {
$this->_fault('not_exists');
}

$carriers = $this->_getCarriers($shipment);

if (!isset($carriers[$carrier])) {
$this->_fault('data_invalid', Mage::helper('sales')->__('Invalid carrier specified.'));
}

$track = Mage::getModel('sales/order_shipment_track')
->setNumber($trackNumber)
->setCarrierCode($carrier)
->setTitle($title);

$shipment->addTrack($track);

try {
$shipment->save();
$track->save();
if(!$shipment->getEmailSent()) {
$shipment->sendEmail(true, $shipment->getCommentsCollection());
$shipment->setEmailSent(true);
$shipment->save();
}
} catch (Mage_Core_Exception $e) {
$this->_fault('data_invalid', $e->getMessage());
}

return $track->getId();
}


Hope i didn't mix up something again.







share|improve this answer














share|improve this answer



share|improve this answer








edited May 3 '16 at 8:33

























answered Mar 14 '16 at 9:02









MichaelMichael

5051413




5051413













  • Michael, Thank you for responding. For some reason I did not get an email that you responded. I normally do. I tried your suggestion and nothing changed. Any other suggestions you may have are greatly welcomed.

    – Scot
    May 2 '16 at 5:34











  • Hi Scot, see my edit please, as it doesnt fit into the comment.

    – Michael
    May 2 '16 at 7:19











  • Thank you for the quick response. Did you keep your save() added to app/code/local/Mage/Sales/Model/Order/Shipment.php in addition to these two changes?

    – Scot
    May 2 '16 at 18:43











  • yes, because under some circumstances i can't remember now i needed it...

    – Michael
    May 2 '16 at 19:30











  • Michael, I'm confused. Both of your edited boxes are the same and I don't see the added $shipment nor sendEmail(). The code you added is the same that I have in both Api.php and V2.php in 1.9.2.2.

    – Scot
    May 2 '16 at 20:32



















  • Michael, Thank you for responding. For some reason I did not get an email that you responded. I normally do. I tried your suggestion and nothing changed. Any other suggestions you may have are greatly welcomed.

    – Scot
    May 2 '16 at 5:34











  • Hi Scot, see my edit please, as it doesnt fit into the comment.

    – Michael
    May 2 '16 at 7:19











  • Thank you for the quick response. Did you keep your save() added to app/code/local/Mage/Sales/Model/Order/Shipment.php in addition to these two changes?

    – Scot
    May 2 '16 at 18:43











  • yes, because under some circumstances i can't remember now i needed it...

    – Michael
    May 2 '16 at 19:30











  • Michael, I'm confused. Both of your edited boxes are the same and I don't see the added $shipment nor sendEmail(). The code you added is the same that I have in both Api.php and V2.php in 1.9.2.2.

    – Scot
    May 2 '16 at 20:32

















Michael, Thank you for responding. For some reason I did not get an email that you responded. I normally do. I tried your suggestion and nothing changed. Any other suggestions you may have are greatly welcomed.

– Scot
May 2 '16 at 5:34





Michael, Thank you for responding. For some reason I did not get an email that you responded. I normally do. I tried your suggestion and nothing changed. Any other suggestions you may have are greatly welcomed.

– Scot
May 2 '16 at 5:34













Hi Scot, see my edit please, as it doesnt fit into the comment.

– Michael
May 2 '16 at 7:19





Hi Scot, see my edit please, as it doesnt fit into the comment.

– Michael
May 2 '16 at 7:19













Thank you for the quick response. Did you keep your save() added to app/code/local/Mage/Sales/Model/Order/Shipment.php in addition to these two changes?

– Scot
May 2 '16 at 18:43





Thank you for the quick response. Did you keep your save() added to app/code/local/Mage/Sales/Model/Order/Shipment.php in addition to these two changes?

– Scot
May 2 '16 at 18:43













yes, because under some circumstances i can't remember now i needed it...

– Michael
May 2 '16 at 19:30





yes, because under some circumstances i can't remember now i needed it...

– Michael
May 2 '16 at 19:30













Michael, I'm confused. Both of your edited boxes are the same and I don't see the added $shipment nor sendEmail(). The code you added is the same that I have in both Api.php and V2.php in 1.9.2.2.

– Scot
May 2 '16 at 20:32





Michael, I'm confused. Both of your edited boxes are the same and I don't see the added $shipment nor sendEmail(). The code you added is the same that I have in both Api.php and V2.php in 1.9.2.2.

– Scot
May 2 '16 at 20:32


















draft saved

draft discarded




















































Thanks for contributing an answer to Magento Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f96582%2fshipping-email-ignored-when-api-sends-tracking-number-only-if-custom-php-present%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

“%fieldName is a required field.”, in Magento2 REST API Call for GET Method Type The Next...

How to change City field to a dropdown in Checkout step Magento 2Magento 2 : How to change UI field(s)...

夢乃愛華...