Skip to content

MAGESHIP-21-develop Add track_url to DB & API and send via Customer S… #10977

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed

MAGESHIP-21-develop Add track_url to DB & API and send via Customer S… #10977

wants to merge 3 commits into from

Conversation

RhodriOwainDavies
Copy link

@RhodriOwainDavies RhodriOwainDavies commented Sep 21, 2017

Please beware this is critical for Magento Shipping (to be released in v2.2.2 - discuss with @joni-jones @orlangur & Nadia Kalinovich

Linked to #10799

Forked from develop branch, merge target branch develop as per @orlangur 's request.

Description

Add a new field sales_shipment_track.track_url.
Expose this field via API.
Including this URL as a hyperlink in the Shipment Sent Email template.

Feature

To support impending Magento Shipping feature request of inserting Carrier Specific URL in email template to Customer

Manual testing scenarios

  1. API Test
    POST /V1/order/{orderId}/ship
    Pass in tracking_url as an extension attribute (in same manner as tracking_number)
  2. UI Test
    In the admin section, view a Shipment which already has a trackinging URL set (via API in Test Can you commit to repository a folder dev/tests/static ? #1). Click Send Tracking Email. Check email, Tracking Number should be a hyperlink to tracking_url

Contribution checklist

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • All automated tests passed successfully (all builds on Travis CI are green)

@vrann vrann self-assigned this Sep 23, 2017
@vrann vrann added this to the September 2017 milestone Sep 23, 2017
@vrann vrann added the develop label Sep 23, 2017
@@ -32,7 +32,7 @@
"magento/module-sales-sample-data": "Sample Data version:100.3.*"
},
"type": "magento2-module",
"version": "100.3.0-dev",
"version": "100.3.1-dev",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change is not needed, the version of the extension will be bumped automatically during the build depending on the severity of the changes

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated

Copy link
Contributor

@vrann vrann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TrackUrl interface is added to the system but never referenced neither from the interfaces in Api namespace nor from the extensions attributes. How is it expected to be exposed through the API?

I tried to run API query adding track_url to the body, but it resulted in decoding error, because Property TrackUrl does not have corresponding setter in class Magento\Sales\Api\Data\ShipmentTrackCreationInterface

Please advise.

Request:

{
  "items": [
    {
      "extension_attributes":[],
      "order_item_id":3,
      "qty":1
    
    },
    {
      "extension_attributes":[],
      "order_item_id":4,
      "qty":1
    }
  ],
  "notify":true,
  "appendComment":true,
  "comment":{
    "extension_attributes":[],
    "comment":"Shipped via Shipment Provider",
    "is_visible_on_front":0
  },
  "tracks":[
    {
      "extension_attributes":[],
      "track_number":"1234567890",
      "track_url": "http://fedex.com/122321212",
      "title":"fedex",
      "carrier_code":
      "fedex"
    }
  ],
  "packages":[
    {
      "extension_attributes":[]
    }
  ],
  "arguments":{
    "extension_attributes":[]
  }
}

@@ -46,6 +46,10 @@
*/
const TRACK_NUMBER = 'track_number';
/*
* Track URL.
*/
const TRACK_URL = 'track_url';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this constant does not have corresponding getter and setter in this interface and should not reside here, rather in the interface which has setter for it.

@RhodriOwainDavies
Copy link
Author

Hi @vrann

Thanks for your review, I've addressed all your comments. Can you please test again and let me know. If the changes are successful, I'll update #10977 with the same changes.

Cheers,

Rhodri D

Copy link
Contributor

@vrann vrann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was expecting to see tracking URL in the admin backend and in the customer account on the frontend, but neither of those places has it. Is it just sent via email? Please add them to order shipments and to the customer account.
screen shot 2017-10-05 at 4 54 14 pm
screen shot 2017-10-05 at 4 53 27 pm

@@ -160,7 +160,7 @@
"magento/module-robots": "100.3.0-dev",
"magento/module-rss": "100.3.0-dev",
"magento/module-rule": "100.3.0-dev",
"magento/module-sales": "100.3.0-dev",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change is not needed, it will be automatically set by the packaging tool

@vrann
Copy link
Contributor

vrann commented Oct 11, 2017

@RhodriOwainDavies discussed with @antonkril today, this change cannot be released in 2.2 as backward incompatible. Please re-create the PR for develop branch

@vrann vrann closed this Oct 11, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants