diff --git a/uafrica/Customshipping/Model/Carrier/Customshipping.php b/uafrica/Customshipping/Model/Carrier/Customshipping.php index 447829269758e0ab411359858b19086b0d70889f..534938720950d05dff1338eabe33c698685ed484 100644 --- a/uafrica/Customshipping/Model/Carrier/Customshipping.php +++ b/uafrica/Customshipping/Model/Carrier/Customshipping.php @@ -474,6 +474,8 @@ class Customshipping extends AbstractCarrier implements CarrierInterface $originRegion = $this->getConfigData('origin_region_id'); $originCity = $this->getConfigData('origin_city'); $originStreet = $this->getConfigData('origin_street'); + //URL to get the rates from + $url = $this->getConfigData('rates_endpoint'); $originStreet1 = $originStreet; $originStreet2 = $originStreet; @@ -504,7 +506,7 @@ class Customshipping extends AbstractCarrier implements CarrierInterface 'postal_code' => $origin, 'province' => $originRegion, 'city' => $originCity, - 'name' => 'Gundo', + 'name' => $url, 'address1' => $originStreet1, 'address2' => $originStreet2, 'address3' => '', @@ -514,7 +516,7 @@ class Customshipping extends AbstractCarrier implements CarrierInterface 'address_type' => '', 'company_name' => 'Jam Clothing' ], - //TODO: Get the destination from the request + //TODO: Get the destination (Receiver Details) from the request 'destination' => [ 'country' => $destCountry, 'postal_code' => $destination, diff --git a/uafrica/Customshipping/Model/Source/Generic.php b/uafrica/Customshipping/Model/Source/Generic.php index f2bbce3f6147c7116ff255155103bbb7e20da8fb..0ad8d4768d8538fdc14a91c98faaa248c9a1fd01 100644 --- a/uafrica/Customshipping/Model/Source/Generic.php +++ b/uafrica/Customshipping/Model/Source/Generic.php @@ -3,12 +3,13 @@ namespace uafrica\customshipping\Model\Source; +use Magento\Framework\Data\OptionSourceInterface; use uafrica\Customshipping\Model\Carrier\Customshipping; /** * uAfrica generic source implementation */ -class Generic implements \Magento\Framework\Data\OptionSourceInterface +class Generic implements OptionSourceInterface { /** * @var Customshipping diff --git a/uafrica/Customshipping/etc/adminhtml/system.xml b/uafrica/Customshipping/etc/adminhtml/system.xml index 28a9dbcc4a8c336e3f9ba6f7dcd2da8ec2e802d6..b27a0966d8f7f4ebf63ce12880a357e2abadc249 100644 --- a/uafrica/Customshipping/etc/adminhtml/system.xml +++ b/uafrica/Customshipping/etc/adminhtml/system.xml @@ -30,10 +30,6 @@ <label>Debug Mode</label> <source_model>Magento\Config\Model\Config\Source\Yesno</source_model> </field> -<!-- <field id="url" translate="label" type="select" sortOrder="10" showInDefault="1" showInStore="1" showInWebsite="1">--> -<!-- <label>Rates collection endpoint</label>--> -<!-- </field>--> - </group> </section> <section id="carriers" translate="label" type="text" sortOrder="1" showInDefault="1" showInWebsite="1" showInStore="1"> @@ -62,21 +58,6 @@ <label>Residential Delivery</label> <source_model>Magento\Config\Model\Config\Source\Yesno</source_model> </field> - -<!-- <field id="production_webservices_url" translate="label" type="text" sortOrder="90" showInDefault="0" showInWebsite="1" canRestore="1">--> -<!-- <label>Get Rates(uAfrica)</label>--> -<!-- <depends>--> -<!-- <field id="sandbox_mode">0</field>--> -<!-- </depends>--> -<!--<!–- Not Functional at this stage–>--> -<!-- <comment>URL To Get Shipping Rates</comment>--> -<!-- </field>--> - -<!-- <field id="price" translate="label" type="text" sortOrder="4" showInDefault="1" showInWebsite="1" showInStore="0">--> -<!-- <label>Shipping Cost</label>--> -<!-- <validate>validate-number validate-zero-or-greater</validate>--> -<!-- </field>--> - <field id="specificerrmsg" translate="label" type="textarea" sortOrder="80" showInDefault="1" showInWebsite="1" showInStore="1"> <label>Displayed Error Message</label> </field> @@ -145,7 +126,12 @@ <comment>The Client Secret you received from uAfrica</comment> </field> <field id="rates_endpoint" translate="label" type="text" sortOrder="1" showInDefault="1" showInWebsite="1" showInStore="0"> - <label>uAfrica Rates</label> + <label>uAfrica Rates (Production)</label> + <comment>Rates at check out collection Endpoint</comment> + + </field> + <field id="rates_endpoint_sandbox" translate="label" type="text" sortOrder="1" showInDefault="1" showInWebsite="1" showInStore="0"> + <label>uAfrica Rates (Sandbox)</label> <comment>Rates at check out collection Endpoint</comment> </field> @@ -158,6 +144,14 @@ <label>Weight Unit</label> <source_model>uafrica\Customshipping\Model\Source\Unitofmeasure</source_model> </field> + <field id="debug" translate="label" type="select" sortOrder="1950" showInDefault="1" showInWebsite="1"> + <label>Debug</label> + <source_model>Magento\Config\Model\Config\Source\Yesno</source_model> + </field> + <field id="sandbox_mode" translate="label" type="select" sortOrder="1960" showInDefault="1" showInWebsite="1"> + <label>Sandbox Mode</label> + <source_model>Magento\Config\Model\Config\Source\Yesno</source_model> + </field> </group> </section>