diff --git a/Block/System/Config/Form/Field/Version.php b/Block/System/Config/Form/Field/Version.php index 469ffe1026a318d35fe1594ee5d530beb0be3a37..50339f7674680e692c6dc7abce4406438a2c5328 100644 --- a/Block/System/Config/Form/Field/Version.php +++ b/Block/System/Config/Form/Field/Version.php @@ -1,11 +1,11 @@ <?php -namespace uafrica\Customshipping\Block\System\Config\Form\Field; +namespace bobgo\Customshipping\Block\System\Config\Form\Field; use Magento\Framework\Data\Form\Element\AbstractElement; /** * @category BobGroup - * @package uafrica_customshipping + * @package bobgo_Customshipping * @author info@bob.co.za * @website https://www.bob.co.za */ @@ -14,17 +14,17 @@ class Version extends \Magento\Config\Block\System\Config\Form\Field const EXTENSION_URL = 'https://www.bob.co.za'; /** - * @var \uafrica\Customshipping\Helper\Data $helper + * @var \bobgo\Customshipping\Helper\Data $helper */ protected $_helper; /** * @param \Magento\Backend\Block\Template\Context $context - * @param \uafrica\Customshipping\Helper\Data $helper + * @param \bobgo\Customshipping\Helper\Data $helper */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \uafrica\Customshipping\Helper\Data $helper + \bobgo\Customshipping\Helper\Data $helper ) { $this->_helper = $helper; parent::__construct($context); diff --git a/Helper/Data.php b/Helper/Data.php index edaa3a3c4130e14603ee05b0257faaf613d02bb6..f1f28ca67887520fd7fcc80c5eb20d677ef1b52a 100644 --- a/Helper/Data.php +++ b/Helper/Data.php @@ -1,5 +1,5 @@ <?php -namespace uafrica\Customshipping\Helper; +namespace bobgo\Customshipping\Helper; use Magento\Framework\App\Helper\AbstractHelper; use Magento\Framework\App\Helper\Context; @@ -7,16 +7,16 @@ use Magento\Framework\Module\ModuleListInterface; use Magento\Store\Model\ScopeInterface; /** - * @category uafrica - * @package uafrica_customshipping - * @author uafrica + * @category bobgo + * @package bobgo_Customshipping + * @author bobgo * @website https://www.bob.co.za */ class Data extends AbstractHelper { - const XML_PATH_ENABLED = 'uafrica_customshipping/general/enabled'; - const XML_PATH_DEBUG = 'uafrica_customshipping/general/debug'; + const XML_PATH_ENABLED = 'bobgo_Customshipping/general/enabled'; + const XML_PATH_DEBUG = 'bobgo_Customshipping/general/debug'; /** * @var \Psr\Log\LoggerInterface @@ -65,7 +65,7 @@ class Data extends AbstractHelper public function getExtensionVersion() { - $moduleCode = 'uafrica_Customshipping'; + $moduleCode = 'bobgo_Customshipping'; $moduleInfo = $this->_moduleList->getOne($moduleCode); return $moduleInfo['setup_version']; } diff --git a/Model/Carrier/Company.php b/Model/Carrier/Company.php index 4b6415834aa2d67b045fa7bff94f5ba3ca970e34..40c2f5b669d6dc3d4bd03a84250a966c4c8a4d95 100644 --- a/Model/Carrier/Company.php +++ b/Model/Carrier/Company.php @@ -1,6 +1,6 @@ <?php -namespace uafrica\Customshipping\Model\Carrier; +namespace bobgo\Customshipping\Model\Carrier; class Company { diff --git a/Model/Carrier/Customshipping.php b/Model/Carrier/Customshipping.php index f1c86eb1489d124154d812da7dcef3807f57b0a8..0e2566673b14cc00ca795955d75fa4a5f55d2c16 100644 --- a/Model/Carrier/Customshipping.php +++ b/Model/Carrier/Customshipping.php @@ -1,7 +1,7 @@ <?php declare(strict_types=1); -namespace uafrica\Customshipping\Model\Carrier; +namespace bobgo\Customshipping\Model\Carrier; use Magento\Catalog\Model\ResourceModel\Product\CollectionFactory; use Magento\CatalogInventory\Api\StockRegistryInterface; @@ -31,9 +31,9 @@ use Magento\Store\Model\StoreManagerInterface; use Psr\Log\LoggerInterface; /** - * uAfrica shipping implementation + * bobgo shipping implementation * @category bob - * @package uafrica_Customshipping + * @package bobgo_Customshipping * @author info@bob.co.za * @website https://www.bob.co.za * @SuppressWarnings(PHPMD.ExcessiveClassComplexity) @@ -44,9 +44,10 @@ class Customshipping extends AbstractCarrierOnline implements \Magento\Shipping\ { /** * Code of the carrier + *` * @var string */ - public const CODE = 'uafrica'; + public const CODE = 'bobgo'; const UNITS = 100; @@ -73,7 +74,7 @@ class Customshipping extends AbstractCarrierOnline implements \Magento\Shipping\ protected $_result = null; /** - * Container types that could be customized for uAfrica carrier + * Container types that could be customized for bobgo carrier * * @var string[] */ @@ -200,7 +201,7 @@ class Customshipping extends AbstractCarrierOnline implements \Magento\Shipping\ /** - * Make request to uAfrica API to get shipping rates + * Make request to bobgo API to get shipping rates * @param $payload * @return array */ @@ -399,7 +400,7 @@ class Customshipping extends AbstractCarrierOnline implements \Magento\Shipping\ { $codes = [ 'method' => [ - 'UAFRICA_SHIPPING' => __('uAfrica Shipping'), + 'bobgo_SHIPPING' => __('bobgo Shipping'), ], 'delivery_confirmation_types' => [ 'NO_SIGNATURE_REQUIRED' => __('Not Required'), @@ -634,7 +635,7 @@ class Customshipping extends AbstractCarrierOnline implements \Magento\Shipping\ } /** - * Parse track details response from uAfrica + * Parse track details response from bobgo * * @return array * @SuppressWarnings(PHPMD.CyclomaticComplexity) @@ -700,7 +701,7 @@ class Customshipping extends AbstractCarrierOnline implements \Magento\Shipping\ } /** - * Perfom API Request to uAfrica API and return response + * Perfom API Request to bobgo API and return response * @param array $payload * @param Result $result * @return void @@ -715,14 +716,14 @@ class Customshipping extends AbstractCarrierOnline implements \Magento\Shipping\ } /** - * Perform API Request for Shipment Tracking to uAfrica API and return response + * Perform API Request for Shipment Tracking to bobgo API and return response * @param $trackInfo * @param array $result * @return array */ private function _requestTracking($trackInfo, array $result): array { - $response = $this->trackUafricaShipment($trackInfo); + $response = $this->trackbobgoShipment($trackInfo); $result = $this->prepareActivity($response[0], $result); @@ -730,7 +731,7 @@ class Customshipping extends AbstractCarrierOnline implements \Magento\Shipping\ } /** - * Format rates from uAfrica API response and append to rate result instance of carrier + * Format rates from bobgo API response and append to rate result instance of carrier * @param mixed $rates * @param Result $result * @return void @@ -775,7 +776,7 @@ class Customshipping extends AbstractCarrierOnline implements \Magento\Shipping\ /** - * Prepare received checkpoints and activity from uAfrica Shipment Tracking API + * Prepare received checkpoints and activity from bobgo Shipment Tracking API * @param $response * @param array $result * @return array @@ -788,7 +789,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; @@ -824,18 +825,17 @@ class Customshipping extends AbstractCarrierOnline implements \Magento\Shipping\ /** - * Curl request to uAfrica Shipment Tracking API + * Curl request to bobgo Shipment Tracking API * @param $trackInfo * @return mixed */ - private function trackUafricaShipment($trackInfo): mixed + private function trackbobgoShipment($trackInfo): mixed { $this->curl->get(uData::TRACKING . $trackInfo); $response = $this->curl->getBody(); - $response = json_decode($response, true); - return $response; + return json_decode($response, true); } /** diff --git a/Model/Carrier/uData.php b/Model/Carrier/uData.php index b293e7fd166444f63a8a91413442806e66e6d449..51b4feadc451a969f9e1499e97468ad1b2c5722c 100644 --- a/Model/Carrier/uData.php +++ b/Model/Carrier/uData.php @@ -1,16 +1,16 @@ <?php -namespace uafrica\Customshipping\Model\Carrier; +namespace bobgo\Customshipping\Model\Carrier; /** * Class uData - * @package uafrica\Customshipping\Model\Carrier + * bobGo API Resources + * @package bobgo\Customshipping\Model\Carrier */ class uData { - /** Tracking Endpoint */ public const TRACKING = 'https://api.dev.ship.uafrica.com/tracking?channel=localhost&tracking_reference='; /*** RATES API Endpoint*/ - public const RATES_ENDPOINT = 'https://api.dev.ship.uafrica.com/rates-at-checkout/woocommerce'; + public const RATES_ENDPOINT = 'https://api.dev.ship.uafrica.com/rates-at-checkout/magento'; } diff --git a/Model/Carrier/uSub.php b/Model/Carrier/uSub.php index 38040f0eb259f015ba1c4ae46523f69fc738070e..fd3e3cef4fe4f202f969689bf843e16635ddd7ba 100644 --- a/Model/Carrier/uSub.php +++ b/Model/Carrier/uSub.php @@ -1,6 +1,6 @@ <?php -namespace uafrica\Customshipping\Model\Carrier; +namespace bobgo\Customshipping\Model\Carrier; use Magento\Checkout\Api\Data\ShippingInformationInterface; use Magento\Framework\App\ObjectManager; use Magento\Framework\Exception\NoSuchEntityException; diff --git a/Model/Source/Dropoff.php b/Model/Source/Dropoff.php index 4606fed88affd3ce7c561b626d2b0aeff10c61ff..ebfed2edd7da9034b96127d2b9dac9ccddacce96 100644 --- a/Model/Source/Dropoff.php +++ b/Model/Source/Dropoff.php @@ -1,6 +1,6 @@ <?php -namespace uafrica\Customshipping\Model\Source; +namespace bobgo\Customshipping\Model\Source; class Dropoff extends Generic { diff --git a/Model/Source/Freemethod.php b/Model/Source/Freemethod.php index d71e97c9ff1d4bb8d950c69b53c8b2812536c4ff..1687ac64d09dac94fe312899a498b5cd1a8d8fb6 100644 --- a/Model/Source/Freemethod.php +++ b/Model/Source/Freemethod.php @@ -1,9 +1,9 @@ <?php -namespace uafrica\Customshipping\Model\Source; +namespace bobgo\Customshipping\Model\Source; /** - * uafrica Free Method source implementation + * bobgo Free Method source implementation */ class Freemethod extends Method { diff --git a/Model/Source/Generic.php b/Model/Source/Generic.php index 0ad8d4768d8538fdc14a91c98faaa248c9a1fd01..f22455290855c7372fdfbc06b4814c2ed9c69e89 100644 --- a/Model/Source/Generic.php +++ b/Model/Source/Generic.php @@ -1,13 +1,13 @@ <?php -namespace uafrica\customshipping\Model\Source; +namespace bobgo\Customshipping\Model\Source; use Magento\Framework\Data\OptionSourceInterface; -use uafrica\Customshipping\Model\Carrier\Customshipping; +use bobgo\Customshipping\Model\Carrier\Customshipping; /** - * uAfrica generic source implementation + * bobgo generic source implementation */ class Generic implements OptionSourceInterface { diff --git a/Model/Source/Method.php b/Model/Source/Method.php index 0c958e50750ed8d7faa332cc1903c4e13efae178..c7ca37c8a3bd12db5b489f32cd151281a9ceb19e 100644 --- a/Model/Source/Method.php +++ b/Model/Source/Method.php @@ -1,6 +1,6 @@ <?php -namespace uafrica\Customshipping\Model\Source; +namespace bobgo\Customshipping\Model\Source; class Method extends Generic { diff --git a/Model/Source/Packaging.php b/Model/Source/Packaging.php index 969d080a3337621d3a7d61c091cc1f768fa093e4..43f90a96069a4da3ec368601efd80ae39bad618b 100644 --- a/Model/Source/Packaging.php +++ b/Model/Source/Packaging.php @@ -1,6 +1,6 @@ <?php -namespace uafrica\Customshipping\Model\Source; +namespace bobgo\Customshipping\Model\Source; class Packaging extends Generic { diff --git a/Model/Source/Unitofmeasure.php b/Model/Source/Unitofmeasure.php index 2fd77f1979280e1e25181eaf9d8446672ee353de..2d5fad6cf81cc46eaabb18e47b458f96d566b80f 100644 --- a/Model/Source/Unitofmeasure.php +++ b/Model/Source/Unitofmeasure.php @@ -1,6 +1,6 @@ <?php -namespace uafrica\Customshipping\Model\Source; +namespace bobgo\Customshipping\Model\Source; class Unitofmeasure extends Generic { diff --git a/Observer/SaveOrderBeforeSalesModelQuote.php b/Observer/SaveOrderBeforeSalesModelQuote.php index 1c81b724936d828e66598284be87b2da6a05db77..f3cdd8e942077e94408187016749d981e0e7076c 100644 --- a/Observer/SaveOrderBeforeSalesModelQuote.php +++ b/Observer/SaveOrderBeforeSalesModelQuote.php @@ -1,6 +1,6 @@ <?php -namespace uafrica\Customshipping\Observer; +namespace bobgo\Customshipping\Observer; use Magento\Framework\DataObject\Copy; use Magento\Framework\Event\Observer; diff --git a/Plugin/Block/DataProviders/Tracking/ChangeTitle.php b/Plugin/Block/DataProviders/Tracking/ChangeTitle.php index 854d22746bbd8f28e33d27357d47098d9e741610..21e7fd5b5b309f0e781178c4ab17d5a8255e003e 100644 --- a/Plugin/Block/DataProviders/Tracking/ChangeTitle.php +++ b/Plugin/Block/DataProviders/Tracking/ChangeTitle.php @@ -1,20 +1,20 @@ <?php -namespace uafrica\Customshipping\Plugin\Block\DataProviders\Tracking; +namespace bobgo\Customshipping\Plugin\Block\DataProviders\Tracking; -use uafrica\Customshipping\Model\Carrier; +use bobgo\Customshipping\Model\Carrier; use Magento\Shipping\Model\Tracking\Result\Status; use Magento\Shipping\Block\DataProviders\Tracking\DeliveryDateTitle as Subject; /** - * Plugin to change delivery date title with UAfrica customized value + * Plugin to change delivery date title with bobgo customized value */ class ChangeTitle { /** - * Title modification in case if UAfrica used as carrier + * Title modification in case if bobgo used as carrier * * @param Subject $subject * @param \Magento\Framework\Phrase|string $result diff --git a/Plugin/Block/Tracking/PopUpDeliveryDate.php b/Plugin/Block/Tracking/PopUpDeliveryDate.php index e605536ec491c0166eca7cd90758868ceecb50f4..3d813732a47c68901da1caba4d2def8b1d6f9b45 100644 --- a/Plugin/Block/Tracking/PopUpDeliveryDate.php +++ b/Plugin/Block/Tracking/PopUpDeliveryDate.php @@ -1,18 +1,18 @@ <?php -namespace uafrica\Customshipping\Plugin\Block\Tracking; +namespace bobgo\Customshipping\Plugin\Block\Tracking; use Magento\Shipping\Block\Tracking\Popup; use Magento\Shipping\Model\Tracking\Result\Status; use Magento\Shiiping\Model\Carrier; /* - * Plugin to update delivery date value in case if UAfrica is a carrier used + * Plugin to update delivery date value in case if bobgo is a carrier used */ class PopupDeliveryDate { /** - * Show only date for expected delivery in case if UAfrica is a carrier + * Show only date for expected delivery in case if bobgo is a carrier * * @param Popup $subject * @param string $result diff --git a/Plugin/Checkout/Block/LayoutProcessorPlugin.php b/Plugin/Checkout/Block/LayoutProcessorPlugin.php index d379412da7cfd5c94e1d03968688cd2afe30a592..2fdf43f9251fc2908abb0e6c7987577b3d55bf23 100644 --- a/Plugin/Checkout/Block/LayoutProcessorPlugin.php +++ b/Plugin/Checkout/Block/LayoutProcessorPlugin.php @@ -1,51 +1,85 @@ <?php -namespace uafrica\Customshipping\Plugin\Checkout\Block; +namespace bobgo\Customshipping\Plugin\Checkout\Block; use Magento\Checkout\Block\Checkout\LayoutProcessor; class LayoutProcessorPlugin { +// /** +// * This is the Class That Allows The Field To Appear As Required On Checkout, +// * But It Does Not Save The Data To The Quote Table In The Database For The Order +// * To Be Processed Correctly In The Backend And Frontend It Works With Shipping +// * Information Management Class +// * @param LayoutProcessor $subject +// * @param array $jsLayout +// * @return array +// */ + /** - * This is the Class That Allows The Field To Appear As Required On Checkout, - * But It Does Not Save The Data To The Quote Table In The Database For The Order - * To Be Processed Correctly In The Backend And Frontend It Works With Shipping - * Information Management Class - * @param LayoutProcessor $subject + * @param \Magento\Checkout\Block\Checkout\LayoutProcessor $subject * @param array $jsLayout * @return array */ + public function afterProcess( - LayoutProcessor $subject, + \Magento\Checkout\Block\Checkout\LayoutProcessor $subject, array $jsLayout - ): array - { - + ) { $jsLayout['components']['checkout']['children']['steps']['children']['shipping-step']['children'] - ['shippingAddress']['children']['shipping-address-fieldset']['children']['suburb'] = [ - 'component' => 'Magento_Ui/js/form/element/textarea', - 'config' => [ - 'customScope' => 'shippingAddress.extension_attributes', - 'customEntry' => null, - 'template' => 'ui/form/field', - 'elementTmpl' => 'ui/form/element/input', - 'options' => [], - 'tooltip' => [ - 'description' => __('Necessary for shipping.') - ], - 'id' => 'suburb' - ], - 'dataScope' => 'shippingAddress.extension_attributes.suburb', - 'label' => 'Suburb(BobGo Required)', + ['shippingAddress']['children']['shipping-address-fieldset']['children']['street'] = [ + 'component' => 'Magento_Ui/js/form/components/group', + 'label' => ('Street Address'), + 'required' => false, + 'dataScope' => 'shippingAddress.street', 'provider' => 'checkoutProvider', - 'visible' => false, - 'validation' => [ - 'required-entry' => false - ], - 'sortOrder' => 110, - /*'customEntry' => null,*/ - 'id' => 'suburb' + 'sortOrder' => 55, + 'type' => 'group', + 'additionalClasses' => 'street', + 'children' => [ + [ + 'label' => ('Street Address'), + 'component' => 'Magento_Ui/js/form/element/abstract', + 'config' => [ + 'placeholder' => 'street address', + 'customScope' => 'shippingAddress', + 'template' => 'ui/form/field', + 'elementTmpl' => 'ui/form/element/input' + ], + 'dataScope' => '0', + 'provider' => 'checkoutProvider', + 'validation' => ['required-entry' => true, "min_text_length" => 1, "max_text_length" => 255], + ], + [ + 'label' => __('Label 2'), + 'component' => 'Magento_Ui/js/form/element/abstract', + 'config' => [ + 'placeholder' => 'town', + 'customScope' => 'shippingAddress', + 'template' => 'ui/form/field', + 'elementTmpl' => 'ui/form/element/input' + ], + 'dataScope' => '1', + 'provider' => 'checkoutProvider', + 'validation' => ['required-entry' => true, "min_text_length" => 1, "max_text_length" => 255], + ], + [ + 'label' => __('Label 3'), + 'component' => 'Magento_Ui/js/form/element/abstract', + 'config' => [ + 'placeholder' => 'suburb', + 'customScope' => 'shippingAddress', + 'template' => 'ui/form/field', + 'elementTmpl' => 'ui/form/element/input' + ], + 'dataScope' => '2', + 'provider' => 'checkoutProvider', + 'validation' => ['required-entry' => true, "min_text_length" => 1, "max_text_length" => 255], + ], + 'dataScope' => '3', + 'provider' => 'checkoutProvider', + 'validation' => ['required-entry' => false, "min_text_length" => 1, "max_text_length" => 255], + ], ]; - return $jsLayout; } } diff --git a/Plugin/ShippingInformationManagement.php b/Plugin/ShippingInformationManagement.php index 24b2b3a2bd0dab29e31249256742bf5e23cffd7e..f19b720feb8dab3ef2827eeff498a36c55ea7531 100644 --- a/Plugin/ShippingInformationManagement.php +++ b/Plugin/ShippingInformationManagement.php @@ -1,6 +1,6 @@ <?php -namespace uafrica\Customshipping\Plugin; +namespace bobgo\Customshipping\Plugin; use Magento\Quote\Api\CartRepositoryInterface; diff --git a/Readme.md b/Readme.md index f9d0d6c8ed7881381a70796b84d2e2a6e1bbd2bc..e5100a761c642369b324ac3830dcf37748480c7e 100644 --- a/Readme.md +++ b/Readme.md @@ -1,17 +1,17 @@ -# Magento 2 uAfrica Shipping Extension +# Magento 2 BobGo Shipping Extension ## Introduction -A complete guide to install Magento uAfrica Shipping extension in Magento 2. +A complete guide to install Magento Bob Go Shipping extension in Magento 2. ## Features ->This extension allows you to get real-time shipping rates from BobGo shipping services and display them to your customers during checkout. +>This extension allows you to get real-time shipping rates from Bob Go shipping services and display them to your customers during checkout. ->This extension also allows you to track shipments and get delivery status updates from BobGo shipping services. +>This extension also allows you to track shipments and get delivery status updates from Bob Go shipping services. -## How to install Magento 2 Bobgo Shipping Extension +## How to install Magento 2 Bob Go Shipping Extension ### Option 1 (recommended): Install via composer @@ -23,12 +23,12 @@ Run the following command in Magento 2 root folder:</br> #### 1. Execute the following command to install the module: ``` -composer require uafrica/customshipping +composer require bobgo/customshipping ``` #### 2. Enter following commands to enable the module: ``` -bin/magento module:enable uafrica_Customshipping +bin/magento module:enable bobgo_Customshipping bin/magento cache:clean bin/magento cache:flush bin/magento setup:upgrade @@ -41,20 +41,20 @@ bin/magento setup:static-content:deploy 1. Download the extension zip file from the link below: </br> - <a href="https://github.com/uafrica/magento-uafrica-shipping-extension/archive/refs/heads/main.zip"> Download Magento 2 uAfrica Shipping Extension </a> + <a href="https://gitlab.bob.co.za/bobgo/bobgo-magento-extension/-/archive/main/bobgo-magento-extension-main.zip"> Download Magento 2 Bob Go Shipping Extension </a> 2. Unzip the file and copy contents -3. Create `uafrica/Customshipping` <em>Directory</em> +3. Create `bobgo/Customshipping` <em>Directory</em> **It should look like this:** </br> ->{Magento root}/app/code/uafrica/Customshipping/ +>{Magento root}/app/code/bobgo/Customshipping/ ->**{Magento root}**`/app/code/uafrica/Customshipping/`**{Paste here}** +>**{Magento root}**`/app/code/bobgo/Customshipping/`**{Paste here}** -3. Go to Magento root folder and run all commands below to install `uafrica_Customshipping`: </br> +3. Go to Magento root folder and run all commands below to install `bobgo_Customshipping`: </br> ``` bin/magento cache:clean Bin/magento cache:flush @@ -65,22 +65,22 @@ ________________________________________________________________________________ # After installation -## How to configure Magento 2 uAfrica Shipping Extension +## How to configure Magento 2 Bob Go Shipping Extension -### ✓ Step 1: Create an account on Bobgo +### ✓ Step 1: Create an account on Bob Go -You need to create an account on Bobgo to get your Store Identified by the API. +You need to create an account on Bob Go to get your Store Identified by the API. -Please visit [Bobgo](https://uafrica.co.za) to create an account. +Please visit [Bob Go](https://bobgo.co.za) to create an account. ### ✓ Step 2: Login to Magento Admin -1. Click on **UAFRICA** > bobGo > Enabled for Checkout > Yes </br> +1. Click on **bobgo** > bobGo > Enabled for Checkout > Yes </br> 2. and go to `Stores > Configuration > Sales > Delivery Methods` to configure the extension. -### ✓ Step 3: Configure Bobgo Shipping Extension +### ✓ Step 3: Configure Bob Go Shipping Extension 1. Select `Bobgo` as shipping method. @@ -110,13 +110,13 @@ When the extension is **installed** and **enabled**, a new field will be created ## How it works -## How to use Magento 2 Bobgo Shipping Extension (carrier) to Ship Orders +## How to use Magento 2 Bob Go Shipping Extension (carrier) to Ship Orders ### ✓ Step 1: Add products to cart(Checkout) >1. Go to checkout page. >2. Select shipping address. ->3. BobGo will collect **Shipping Rates** From various couriers. +>3. Bob Go will collect **Shipping Rates** From various couriers. >4. Select shipping method. >5. Place order. @@ -126,5 +126,5 @@ When the extension is **installed** and **enabled**, a new field will be created >1. Go to `Sales > Orders` in Magento Admin >2. Select an order >3. Click `Ship` button ->4. Select `uAfrica` as shipping method +>4. Select `bobgo` as shipping method >5. Click `Submit Shipment` button diff --git a/composer.json b/composer.json index 8168ba4b1181dadc2a09d5f554b2e78359d21ee0..bd2a1d95264e21da9c6cf29dfdf1b7daee09fffd 100644 --- a/composer.json +++ b/composer.json @@ -1,5 +1,5 @@ { - "name": "uafrica/bobgo", + "name": "bobgo/bobgo", "description": "Streamline your shipments fulfillments with bobgo", "type": "magento2-module", "version": "1.0.0", @@ -19,7 +19,7 @@ "registration.php" ], "psr-4": { - "uafrica\\Customshipping\\": "" + "bobgo\\Customshipping\\": "" } } } diff --git a/etc/adminhtml/system.xml b/etc/adminhtml/system.xml index 792020a3143a4ee6abca203b862f674a96b01121..dd2c48d4d059a8b62648c3210292782dbc7e86bb 100644 --- a/etc/adminhtml/system.xml +++ b/etc/adminhtml/system.xml @@ -1,26 +1,26 @@ <?xml version="1.0"?> <!-- /** - * @category Uafrica - * @package Uafrica_Customshipping - * @author Uafrica + * @category bobgo + * @package bobgo_Customshipping + * @author bobgo */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd"> <system> - <tab id="uafrica" translate="label" sortOrder="200"> - <label>uafrica</label> + <tab id="bobgo" translate="label" sortOrder="200"> + <label>bobgo</label> </tab> - <section id="uafrica_customshipping" showInDefault="1"> - <tab>uafrica</tab> + <section id="bobgo_Customshipping" showInDefault="1"> + <tab>bobgo</tab> <label>bobGo</label> <resource>Magento_Config::config</resource> <group id="general" showInDefault="1"> <label>General Settings</label> <field id="version" translate="label" type="label" sortOrder="1" showInDefault="1" showInWebsite="0" showInStore="0"> <label>Version</label> - <frontend_model>uafrica\Customshipping\Block\System\Config\Form\Field\Version</frontend_model> + <frontend_model>bobgo\Customshipping\Block\System\Config\Form\Field\Version</frontend_model> </field> <field id="enabled" translate="label" type="select" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1"> <label>Enabled for Checkout</label> @@ -41,12 +41,12 @@ </group> </section> <section id="carriers" translate="label" type="text" sortOrder="1" showInDefault="1" showInWebsite="1" showInStore="1"> - <group id="uafrica" translate="label" type="text" sortOrder="2" showInDefault="1" showInWebsite="1" showInStore="1"> - <label>uAfrica</label> + <group id="bobgo" translate="label" type="text" sortOrder="2" showInDefault="1" showInWebsite="1" showInStore="1"> + <label>bobgo</label> <field id="version" translate="label" type="label" sortOrder="0" showInDefault="1" showInWebsite="0" showInStore="0"> <label>Version</label> - <frontend_model>uafrica\Customshipping\Block\System\Config\Form\Field\Version</frontend_model> + <frontend_model>bobgo\Customshipping\Block\System\Config\Form\Field\Version</frontend_model> </field> <field id="active" translate="label" type="select" sortOrder="1" showInDefault="1" showInWebsite="1" showInStore="0"> @@ -86,7 +86,7 @@ </field> <field id="unit_of_measure" translate="label" type="select" sortOrder="73" showInDefault="1" showInWebsite="1" canRestore="1"> <label>Weight Unit</label> - <source_model>uafrica\Customshipping\Model\Source\Unitofmeasure</source_model> + <source_model>bobgo\Customshipping\Model\Source\Unitofmeasure</source_model> </field> <field id="additional_info" translate="label" type="select" sortOrder="7" showInDefault="1" showInWebsite="1"> <label>Display Additional Information</label> diff --git a/etc/config.xml b/etc/config.xml index eeba0c66da7f010bc660fa9aa0ae42d65681738b..9cf20c6dfe2a5977a39683d2b25fdca49b8a3068 100644 --- a/etc/config.xml +++ b/etc/config.xml @@ -1,29 +1,29 @@ <?xml version="1.0"?> <!-- /** - * @category Uafrica - * @package Uafrica_Customshipping - * @author Uafrica + * @category bobgo + * @package bobgo_customshipping + * @author bobgo */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd"> <default> - <uafrica_customshipping> + <bobgo_customshipping> <general> <debug>0</debug> </general> - </uafrica_customshipping> + </bobgo_customshipping> <carriers> - <uafrica> + <bobgo> <active>0</active> <sallowspecific>0</sallowspecific> <price>0.00</price> - <model>uafrica\Customshipping\Model\Carrier\Customshipping</model> + <model>bobgo\Customshipping\Model\Carrier\Customshipping</model> <name>Fixed</name> - <title>uAfrica</title> + <title>bobgo</title> <specificerrmsg>This shipping method is not available. To use this shipping method, please contact us.</specificerrmsg> - </uafrica> + </bobgo> </carriers> </default> diff --git a/etc/di.xml b/etc/di.xml index f93b3182a2951ab815b2deabe8105d67dd836147..d501898738c3d0f7ca44668d75b476cfa319b620 100644 --- a/etc/di.xml +++ b/etc/di.xml @@ -3,6 +3,6 @@ xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <type name="Magento\Checkout\Model\ShippingInformationManagement"> <plugin name="get_suburb" - type="uafrica\Customshipping\Plugin\ShippingInformationManagement" sortOrder="1"/> + type="bobgo\Customshipping\Plugin\ShippingInformationManagement" sortOrder="1"/> </type> </config> diff --git a/etc/events.xml b/etc/events.xml index c54fd93b7597557cc6c21f8fcc90e712dc54c5ae..2a246a7dd4ac640f74034c951c461b4018ab29db 100644 --- a/etc/events.xml +++ b/etc/events.xml @@ -1,7 +1,7 @@ <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Event/etc/events.xsd"> <event name="sales_model_service_quote_submit_before"> - <observer name="uafrica_customshipping_sales_model_service_quote_submit_before" - instance="uafrica\Customshipping\Observer\SaveOrderBeforeSalesModelQuote" /> + <observer name="bobgo_Customshipping_sales_model_service_quote_submit_before" + instance="bobgo\Customshipping\Observer\SaveOrderBeforeSalesModelQuote" /> </event> </config> diff --git a/etc/frontend/di.xml b/etc/frontend/di.xml index a06930c7ab62a170f5960aab4fb2c2026509886f..fd464886f98c6e4839a15029a4e81438b27023e9 100644 --- a/etc/frontend/di.xml +++ b/etc/frontend/di.xml @@ -1,9 +1,9 @@ <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <type name="Magento\Checkout\Block\Checkout\LayoutProcessor"> - <plugin name="add_custom_field_checkout_shipping_form" type="uafrica\Customshipping\Plugin\Checkout\Block\LayoutProcessorPlugin" sortOrder="10"/> + <plugin name="add_custom_field_checkout_shipping_form" type="bobgo\Customshipping\Plugin\Checkout\Block\LayoutProcessorPlugin" sortOrder="10"/> <arguments> <argument name="layoutProcessors" xsi:type="array"> - <item name="orderattribute" xsi:type="object">uafrica\Customshipping\Plugin\Checkout\Block\LayoutProcessorPlugin</item> + <item name="orderattribute" xsi:type="object">bobgo\Customshipping\Plugin\Checkout\Block\LayoutProcessorPlugin</item> </argument> </arguments> </type> diff --git a/etc/module.xml b/etc/module.xml index 8c5f805a7f40344c403f95af89f805806299756f..702d466c8e47cafc80e350a173beaa093b451277 100644 --- a/etc/module.xml +++ b/etc/module.xml @@ -1,13 +1,13 @@ <?xml version="1.0"?> <!-- /** - * @category Uafrica - * @package Uafrica_Customshipping - * @author Uafrica + * @category bobgo + * @package bobgo_Customshipping + * @author bobgo */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> - <module name="uafrica_Customshipping" setup_version="1.0.0"> + <module name="bobgo_Customshipping" setup_version="1.0.0"> <sequence> <module name="Magento_Webapi"/> <module name="Magento_Catalog"/> diff --git a/registration.php b/registration.php index 3874a8c7c571621285294fb2e7411bbc0c4b18d7..425ec6f971baf00372ebfd12f04a91f659befe2e 100644 --- a/registration.php +++ b/registration.php @@ -1,6 +1,6 @@ <?php \Magento\Framework\Component\ComponentRegistrar::register( \Magento\Framework\Component\ComponentRegistrar::MODULE, - 'uafrica_Customshipping', + 'bobgo_Customshipping', __DIR__ ); diff --git a/vendor/composer/installed.php b/vendor/composer/installed.php index 9e79e7e740d968ce8d00bdc05cdbe83de6a2da3a..133ab49c92cf1b4f94eca24b0e2662e55a91bbd4 100644 --- a/vendor/composer/installed.php +++ b/vendor/composer/installed.php @@ -5,7 +5,7 @@ 'version' => 'dev-main', 'reference' => '5d71c85cc020f9db5753213fce46620f15cb94d1', 'type' => 'library', - 'install_path' => __DIR__ . '/../magento-uafrica-shipping-extension/', + 'install_path' => __DIR__ . '/../magento-bobgo-shipping-extension/', 'aliases' => array(), 'dev' => true, ), @@ -15,7 +15,7 @@ 'version' => 'dev-main', 'reference' => '5d71c85cc020f9db5753213fce46620f15cb94d1', 'type' => 'library', - 'install_path' => __DIR__ . '/../magento-uafrica-shipping-extension/', + 'install_path' => __DIR__ . '/../magento-bobgo-shipping-extension/', 'aliases' => array(), 'dev_requirement' => false, ), diff --git a/view/frontend/layout/checkout_cart_index.xml b/view/frontend/layout/checkout_cart_index.xml index 2c08acb3437459f52f010a28450a53ab6d43dd21..5fc57d490edfd59068b1aefa9eafb66ce7de08e2 100644 --- a/view/frontend/layout/checkout_cart_index.xml +++ b/view/frontend/layout/checkout_cart_index.xml @@ -9,8 +9,8 @@ <item name="children" xsi:type="array"> <item name="shipping-rates-validation" xsi:type="array"> <item name="children" xsi:type="array"> - <item name="uafrica-rates-validation" xsi:type="array"> - <item name="component" xsi:type="string">uafrica_Customshipping/js/view/shipping-rates-validation</item> + <item name="bobgo-rates-validation" xsi:type="array"> + <item name="component" xsi:type="string">bobgo_Customshipping/js/view/shipping-rates-validation</item> </item> </item> </item> diff --git a/view/frontend/layout/checkout_index_index.xml b/view/frontend/layout/checkout_index_index.xml index 3d41b4eac5eb388c255204ad196ae32b769ec5f5..5ff2aad3d5ab9e5c438099624d4223f7b87a067e 100644 --- a/view/frontend/layout/checkout_index_index.xml +++ b/view/frontend/layout/checkout_index_index.xml @@ -15,8 +15,8 @@ <item name="children" xsi:type="array"> <item name="shipping-rates-validation" xsi:type="array"> <item name="children" xsi:type="array"> - <item name="uafrica-rates-validation" xsi:type="array"> - <item name="component" xsi:type="string">uafrica_Customshipping/js/view/shipping-rates-validation</item> + <item name="bobgo-rates-validation" xsi:type="array"> + <item name="component" xsi:type="string">bobgo_Customshipping/js/view/shipping-rates-validation</item> </item> </item> </item> diff --git a/view/frontend/requirejs-config.js b/view/frontend/requirejs-config.js index 79d332fcf0aba003f083425c3afde641c35733df..f95fdac27f622687e1590a9a1b999b3ec86697ab 100644 --- a/view/frontend/requirejs-config.js +++ b/view/frontend/requirejs-config.js @@ -2,7 +2,7 @@ var config = { config: { mixins: { 'Magento_Checkout/js/action/set-shipping-information': { - 'uafrica_Customshipping/js/action/set-shipping-information-mixin': true + 'bobgo_Customshipping/js/action/set-shipping-information-mixin': true } } } diff --git a/view/frontend/web/js/view/shipping-rates-validation.js b/view/frontend/web/js/view/shipping-rates-validation.js index bfe148b4ad02dd6ee67588cf6c06fed1f2c09835..492fb9acf901a5643ae057266f9ca613a3fbb622 100644 --- a/view/frontend/web/js/view/shipping-rates-validation.js +++ b/view/frontend/web/js/view/shipping-rates-validation.js @@ -20,8 +20,8 @@ define( sampleShippingProviderShippingRatesValidationRules ) { "use strict"; - defaultShippingRatesValidator.registerValidator('uafrica', sampleShippingProviderShippingRatesValidator); - defaultShippingRatesValidationRules.registerRules('uafrica', sampleShippingProviderShippingRatesValidationRules); + defaultShippingRatesValidator.registerValidator('bobgo', sampleShippingProviderShippingRatesValidator); + defaultShippingRatesValidationRules.registerRules('bobgo', sampleShippingProviderShippingRatesValidationRules); return Component; } );