-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feat (tracking): Create tracking page in Shop Interface
- Create tracking page - Update readme - Add link to tracking page on order page see #5
- Loading branch information
Showing
29 changed files
with
494 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
{ | ||
"private": true, | ||
"scripts": { | ||
"dev": "npm run development", | ||
"development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js", | ||
"watch": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js", | ||
"watch-poll": "cross-env npm run watch -- --watch-poll --progress", | ||
"hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js", | ||
"prod": "npm run production", | ||
"production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js" | ||
}, | ||
"devDependencies": { | ||
"axios": "^0.19.0", | ||
"cross-env": "^6.0.3", | ||
"jquery": "^3.4.1", | ||
"laravel-mix": "^5.0.0", | ||
"laravel-mix-merge-manifest": "^0.1.2", | ||
"sass": "^1.24.4", | ||
"sass-loader": "^8.0.0", | ||
"vue": "^2.6.11", | ||
"vue-template-compiler": "^2.6.11" | ||
}, | ||
"dependencies": { | ||
"accounting": "^0.4.1", | ||
"ez-plus": "^1.2.1", | ||
"vee-validate": "^2.2.15", | ||
"vue-flatpickr": "^2.3.0", | ||
"vue-slider-component": "^3.1.0" | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"IcoMoonType":"selection","icons":[{"icon":{"paths":["M794.624 366.24c-5.952-8.896-15.936-14.24-26.624-14.24h-32c-17.696 0-32 14.304-32 32v192c0 17.696 14.304 32 32 32h128c17.696 0 32-14.304 32-32v-48c0-6.304-1.888-12.512-5.376-17.76l-96-144zM864 576h-128v-192h32l96 144v48zM1007.872 490.752l-128-192c-17.856-26.784-47.744-42.752-79.872-42.752h-128v-64c0-52.928-43.072-96-96-96h-480c-52.928 0-96 43.072-96 96v352c0 52.928 43.072 96 96 96v0 96c0 52.928 43.072 96 96 96h36.544c14.304 55.072 64 96 123.488 96 59.424 0 109.12-40.928 123.424-96h169.024c14.304 55.072 64 96 123.488 96 59.424 0 109.12-40.928 123.424-96h36.608c52.928 0 96-43.072 96-96v-192c0-19.008-5.568-37.44-16.128-53.248zM96 576c-17.664 0-32-14.304-32-32v-352c0-17.696 14.336-32 32-32h480c17.696 0 32 14.304 32 32v352c0 17.696-14.304 32-32 32h-480zM352.032 864c-35.36 0-64-28.672-64-64s28.64-64 64-64c35.328 0 64 28.672 64 64s-28.704 64-64 64zM768 864c-35.36 0-64-28.672-64-64s28.64-64 64-64c35.328 0 64 28.672 64 64s-28.672 64-64 64zM960 736c0 17.696-14.304 32-32 32h-36.576c-14.304-55.072-64-96-123.424-96-59.488 0-109.184 40.928-123.488 96h-169.024c-14.304-55.072-64-96-123.424-96-59.488 0-109.184 40.928-123.488 96h-36.576c-17.664 0-32-14.304-32-32v-96h416c52.928 0 96-43.072 96-96v-224h128c10.688 0 20.672 5.344 26.624 14.24l128 192c3.488 5.248 5.376 11.456 5.376 17.76v192z"],"attrs":[{}],"isMulticolor":false,"isMulticolor2":false,"tags":["truck","transport","transaction","shipping"],"grid":32},"attrs":[{}],"properties":{"order":8,"id":0,"prevSize":32,"code":59652,"name":"truck"},"setIdx":0,"setId":2,"iconIdx":0}],"height":1024,"metadata":{"name":"icomoon"},"preferences":{"showGlyphs":true,"showCodes":true,"showQuickUse":true,"showQuickUse2":true,"showSVGs":true,"fontPref":{"prefix":"icon-","metadata":{"fontFamily":"icomoon"},"metrics":{"emSize":1024,"baseline":6.25,"whitespace":50},"embed":false},"imagePref":{"prefix":"icon-","png":true,"useClassSelector":true,"color":0,"bgColor":16777215,"name":"icomoon","classSelector":".icon"},"historySize":50,"gridSize":16,"showGrid":true}} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"/js/shipping.js": "/js/shipping.js?id=bf58a857d1dc0b9196b6", | ||
"/css/shipping.css": "/css/shipping.css?id=de79e44769cc7a39975c" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<?php | ||
|
||
namespace GGPHP\Shipping\Http\Controllers\Shop; | ||
|
||
use Webkul\Shop\Http\Controllers\Controller; | ||
use Webkul\Sales\Repositories\OrderRepository; | ||
|
||
class TrackingController extends Controller | ||
{ | ||
protected $_config; | ||
|
||
protected $orderRepository; | ||
|
||
/** | ||
* Create a new controller instance | ||
* | ||
* @return void | ||
*/ | ||
public function __construct(OrderRepository $orderRepository) | ||
{ | ||
$this->middleware('customer'); | ||
|
||
$this->orderRepository = $orderRepository; | ||
|
||
parent::__construct(); | ||
} | ||
|
||
/** | ||
* Show the view for the specified resource. | ||
* | ||
* @param int $orderId | ||
* @return \Illuminate\View\View | ||
*/ | ||
public function view($orderId) | ||
{ | ||
$order = $this->orderRepository->findOrFail($orderId); | ||
$shipments = $order->shipments()->get()->toArray(); | ||
$trackings = $shipments ? uspsTrackById(array_column($shipments, 'track_number')) : []; | ||
|
||
if (! empty($shipments) && count($shipments) == 1 && ! isset($trackings['status'])) | ||
$trackings = [$trackings]; | ||
|
||
if (! empty($trackings['message'])) | ||
$trackings['message'] = str_replace('<SUP>®</SUP>', '', $trackings['message']); | ||
|
||
return view($this->_config['view'], compact('trackings', 'order')); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?php | ||
|
||
namespace GGPHP\Shipping\Providers; | ||
|
||
use Illuminate\Support\ServiceProvider; | ||
use Illuminate\Support\Facades\Event; | ||
|
||
class EventServiceProvider extends ServiceProvider | ||
{ | ||
/** | ||
* Bootstrap services. | ||
* | ||
* @return void | ||
*/ | ||
public function boot() | ||
{ | ||
Event::listen(['bagisto.shop.layout.head'], function($viewRenderEventManager) { | ||
$viewRenderEventManager->addTemplate('ggphp-shipping::shop.style'); | ||
}); | ||
|
||
Event::listen(['bagisto.shop.layout.body.after'], function($viewRenderEventManager) { | ||
$viewRenderEventManager->addTemplate('ggphp-shipping::shop.script'); | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"IcoMoonType":"selection","icons":[{"icon":{"paths":["M794.624 366.24c-5.952-8.896-15.936-14.24-26.624-14.24h-32c-17.696 0-32 14.304-32 32v192c0 17.696 14.304 32 32 32h128c17.696 0 32-14.304 32-32v-48c0-6.304-1.888-12.512-5.376-17.76l-96-144zM864 576h-128v-192h32l96 144v48zM1007.872 490.752l-128-192c-17.856-26.784-47.744-42.752-79.872-42.752h-128v-64c0-52.928-43.072-96-96-96h-480c-52.928 0-96 43.072-96 96v352c0 52.928 43.072 96 96 96v0 96c0 52.928 43.072 96 96 96h36.544c14.304 55.072 64 96 123.488 96 59.424 0 109.12-40.928 123.424-96h169.024c14.304 55.072 64 96 123.488 96 59.424 0 109.12-40.928 123.424-96h36.608c52.928 0 96-43.072 96-96v-192c0-19.008-5.568-37.44-16.128-53.248zM96 576c-17.664 0-32-14.304-32-32v-352c0-17.696 14.336-32 32-32h480c17.696 0 32 14.304 32 32v352c0 17.696-14.304 32-32 32h-480zM352.032 864c-35.36 0-64-28.672-64-64s28.64-64 64-64c35.328 0 64 28.672 64 64s-28.704 64-64 64zM768 864c-35.36 0-64-28.672-64-64s28.64-64 64-64c35.328 0 64 28.672 64 64s-28.672 64-64 64zM960 736c0 17.696-14.304 32-32 32h-36.576c-14.304-55.072-64-96-123.424-96-59.488 0-109.184 40.928-123.488 96h-169.024c-14.304-55.072-64-96-123.424-96-59.488 0-109.184 40.928-123.488 96h-36.576c-17.664 0-32-14.304-32-32v-96h416c52.928 0 96-43.072 96-96v-224h128c10.688 0 20.672 5.344 26.624 14.24l128 192c3.488 5.248 5.376 11.456 5.376 17.76v192z"],"attrs":[{}],"isMulticolor":false,"isMulticolor2":false,"tags":["truck","transport","transaction","shipping"],"grid":32},"attrs":[{}],"properties":{"order":8,"id":0,"prevSize":32,"code":59652,"name":"truck"},"setIdx":0,"setId":2,"iconIdx":0}],"height":1024,"metadata":{"name":"icomoon"},"preferences":{"showGlyphs":true,"showCodes":true,"showQuickUse":true,"showQuickUse2":true,"showSVGs":true,"fontPref":{"prefix":"icon-","metadata":{"fontFamily":"icomoon"},"metrics":{"emSize":1024,"baseline":6.25,"whitespace":50},"embed":false},"imagePref":{"prefix":"icon-","png":true,"useClassSelector":true,"color":0,"bgColor":16777215,"name":"icomoon","classSelector":".icon"},"historySize":50,"gridSize":16,"showGrid":true}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
$(function() { | ||
$('.account-items-list table tbody tr').each(function() { | ||
var id = $(this).find('td:nth-child(1)').text(); | ||
var status = $(this).find('td span.badge').text(); | ||
var link = window.location.origin + '/customer/account/orders/' + id + '/tracking'; | ||
if (status == 'Completed') | ||
$(this).find('td.actions a').after('<a href="' + link + '"><span class="icon icon-truck"></span></a>'); | ||
}); | ||
}); |
Oops, something went wrong.