Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
bobgo-magento-extension
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Bob Public Utils
bobgo-magento-extension
Commits
ee1657f7
Commit
ee1657f7
authored
2 years ago
by
Gundo Sifhufhi
Browse files
Options
Downloads
Patches
Plain Diff
Company info, extraction.
parent
20fa636d
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
Model/Carrier/Customshipping.php
+4
-9
4 additions, 9 deletions
Model/Carrier/Customshipping.php
Model/Carrier/uSubs.php
+23
-0
23 additions, 0 deletions
Model/Carrier/uSubs.php
with
27 additions
and
9 deletions
Model/Carrier/Customshipping.php
+
4
−
9
View file @
ee1657f7
...
...
@@ -108,6 +108,7 @@ class Customshipping extends AbstractCarrierOnline implements \Magento\Shipping\
*/
protected
JsonFactory
$jsonFactory
;
private
$cartRepository
;
private
uSubs
$uSubs
;
/**
...
...
@@ -181,6 +182,7 @@ class Customshipping extends AbstractCarrierOnline implements \Magento\Shipping\
);
$this
->
jsonFactory
=
$jsonFactory
;
$this
->
curl
=
$curlFactory
->
create
();
$this
->
uSubs
=
new
uSubs
();
}
...
...
@@ -783,7 +785,7 @@ class Customshipping extends AbstractCarrierOnline implements \Magento\Shipping\
'activity'
=>
$checkpoint
[
'status'
],
'deliverydate'
=>
$this
->
formatDate
(
$checkpoint
[
'time'
]),
'deliverytime'
=>
$this
->
formatTime
(
$checkpoint
[
'time'
]),
'deliverylocation'
=>
'Unavailable'
,
//
'deliverylocation' => 'Unavailable',
];
}
return
$result
;
...
...
@@ -853,14 +855,7 @@ class Customshipping extends AbstractCarrierOnline implements \Magento\Shipping\
*/
protected
function
getDestComp
():
mixed
{
$data
=
json_decode
(
file_get_contents
(
'php://input'
),
true
);
if
(
isset
(
$data
[
'address'
][
'company'
]))
{
$destComp
=
$data
[
'address'
][
'company'
];
}
else
{
$destComp
=
''
;
}
return
$destComp
;
return
$this
->
uSubs
->
getDestComp
();
}
/**
...
...
This diff is collapsed.
Click to expand it.
Model/Carrier/uSubs.php
0 → 100644
+
23
−
0
View file @
ee1657f7
<?php
namespace
uafrica\Customshipping\Model\Carrier
;
/** Get Company information if available from the Estimate Shipping Methods Request Body */
class
uSubs
{
/**
* @return mixed|string
*/
public
function
getDestComp
():
mixed
{
$data
=
json_decode
(
file_get_contents
(
'php://input'
),
true
);
if
(
isset
(
$data
[
'address'
][
'company'
]))
{
$destComp
=
$data
[
'address'
][
'company'
];
}
else
{
$destComp
=
''
;
}
return
$destComp
;
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment