Skip to content
Snippets Groups Projects
Commit 42311650 authored by Christel Loftus's avatar Christel Loftus
Browse files

clear frontend files

parent f3c166d1
Branches
Tags 1.0.20
1 merge request!6Rates at checkout
Pipeline #65217 passed
......@@ -15,7 +15,7 @@
<path value="$PROJECT_DIR$/vendor/composer" />
</include_path>
</component>
<component name="PhpProjectSharedConfiguration" php_language_level="8.1">
<component name="PhpProjectSharedConfiguration" php_language_level="7.1">
<option name="suggestChangeDefaultLanguageLevel" value="false" />
</component>
<component name="PhpStanOptionsConfiguration">
......
<?php
namespace BobGroup\BobGo\Model\Carrier;
/**
* Get the AdditionalInfo information from the request body and return it
*/
class AdditionalInfo
{
/**
* @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;
}
public function getSuburb(): mixed
{
$data = json_decode(file_get_contents('php://input'), true);
if (isset($data['address']['custom_attributes'][0]['value'])) {
$destSub = $data['address']['custom_attributes'][0]['value'];
//print_r($destSub);
} else {
$destSub = '';
}
return $destSub;
}
/**
* @return mixed|string
*/
public function getDestTelephone(): mixed
{
$data = json_decode(file_get_contents('php://input'), true);
if (isset($data['address']['telephone'])) {
$destTelephone = $data['address']['telephone'];
} else {
$destTelephone = '';
}
return $destTelephone;
}
/**
* @var \BobGroup\BobGo\Model\Carrier\AdditionalInfo
*/
public $countryFactory;
public function __construct($countryFactory)
{
$this->countryFactory = $countryFactory;
}
/**
* country full name
*
* @return string
*/
public function getCountryName($countryId): string
{
$countryName = '';
$country = $this->countryFactory->create()->loadByCode($countryId);
if ($country) {
$countryName = $country->getName();
}
return $countryName;
}
// // Method to get the per-package price
// protected function _getPerpackagePrice($cost, $handlingType, $handlingFee)
//
//namespace BobGroup\BobGo\Model\Carrier;
//
///**
// * Get the AdditionalInfo information from the request body and return it
// */
//class AdditionalInfo
//{
//
// /**
// * @return mixed|string
// */
// public function getDestComp(): mixed
// {
// if ($handlingType == AbstractCarrier::HANDLING_TYPE_PERCENT) {
// return $cost + $cost * $this->_numBoxes * $handlingFee / self::UNITS;
// $data = json_decode(file_get_contents('php://input'), true);
//
// if (isset($data['address']['company'])) {
// $destComp = $data['address']['company'];
// } else {
// $destComp = '';
// }
// return $cost + $this->_numBoxes * $handlingFee;
// return $destComp;
// }
//
// // Method to get the per-order price
// protected function _getPerorderPrice($cost, $handlingType, $handlingFee)
// public function getSuburb(): mixed
// {
// if ($handlingType == self::HANDLING_TYPE_PERCENT) {
// return $cost + $cost * $handlingFee / self::UNITS;
//
// $data = json_decode(file_get_contents('php://input'), true);
//
// if (isset($data['address']['custom_attributes'][0]['value'])) {
// $destSub = $data['address']['custom_attributes'][0]['value'];
// //print_r($destSub);
// } else {
// $destSub = '';
// }
// return $cost + $handlingFee;
// return $destSub;
// }
//
// // Method to get configuration data of the carrier
// public function getCode($type, $code = '')
// /**
// * @return mixed|string
// */
// public function getDestTelephone(): mixed
// {
// $codes = [
// 'method' => [
// 'bobGo' => __('BobGo'),
// ],
// 'unit_of_measure' => [
// 'KGS' => __('Kilograms'),
// 'LBS' => __('Pounds'),
// ],
// ];
// if (!isset($codes[$type])) {
// return false;
// } elseif ('' === $code) {
// return $codes[$type];
// }
// if (!isset($codes[$type][$code])) {
// return false;
// $data = json_decode(file_get_contents('php://input'), true);
//
// if (isset($data['address']['telephone'])) {
// $destTelephone = $data['address']['telephone'];
// } else {
// return $codes[$type][$code];
// $destTelephone = '';
// }
// return $destTelephone;
// }
//
//
// /**
// * @var \BobGroup\BobGo\Model\Carrier\AdditionalInfo
// */
// public $countryFactory;
//
// public function __construct($countryFactory)
// {
// $this->countryFactory = $countryFactory;
// }
//
// /**
// * country full name
// *
// * @return string
// */
// public function getCountryName($countryId): string
// {
// $countryName = '';
// $country = $this->countryFactory->create()->loadByCode($countryId);
// if ($country) {
// $countryName = $country->getName();
// }
// return $countryName;
// }
//
//// // Method to get the per-package price
//// protected function _getPerpackagePrice($cost, $handlingType, $handlingFee)
//// {
//// if ($handlingType == AbstractCarrier::HANDLING_TYPE_PERCENT) {
//// return $cost + $cost * $this->_numBoxes * $handlingFee / self::UNITS;
//// }
//// return $cost + $this->_numBoxes * $handlingFee;
//// }
////
//// // Method to get the per-order price
//// protected function _getPerorderPrice($cost, $handlingType, $handlingFee)
//// {
//// if ($handlingType == self::HANDLING_TYPE_PERCENT) {
//// return $cost + $cost * $handlingFee / self::UNITS;
//// }
//// return $cost + $handlingFee;
//// }
////
//// // Method to get configuration data of the carrier
//// public function getCode($type, $code = '')
//// {
//// $codes = [
//// 'method' => [
//// 'bobGo' => __('BobGo'),
//// ],
//// 'unit_of_measure' => [
//// 'KGS' => __('Kilograms'),
//// 'LBS' => __('Pounds'),
//// ],
//// ];
//// if (!isset($codes[$type])) {
//// return false;
//// } elseif ('' === $code) {
//// return $codes[$type];
//// }
//// if (!isset($codes[$type][$code])) {
//// return false;
//// } else {
//// return $codes[$type][$code];
//// }
//// }
//
//}
}
This diff is collapsed.
<?php
namespace BobGroup\BobGo\Model\Carrier;
/**
* Class uData
* @package BobGroup\BobGo\Model\Carrier
*/
class uData
{
/** Tracking Endpoint */
public const TRACKING = 'https://api.dev.bobgo.co.za/tracking?channel=%s&tracking_reference=%s';
/*** RATES API Endpoint*/
public const RATES_ENDPOINT = 'https://api.dev.bobgo.co.za/rates-at-checkout/magento';
}
//
//namespace BobGroup\BobGo\Model\Carrier;
//
///**
// * Class uData
// * @package BobGroup\BobGo\Model\Carrier
// */
//class uData
//{
//
// /** Tracking Endpoint */
// public const TRACKING = 'https://api.dev.bobgo.co.za/tracking?channel=%s&tracking_reference=%s';
//
// /*** RATES API Endpoint*/
// public const RATES_ENDPOINT = 'https://api.dev.bobgo.co.za/rates-at-checkout/magento';
//}
<?php
////
////namespace BobGroup\BobGo\Model\Source;
////
////class Unitofmeasure extends Generic
////{
//// /**
//// * Carrier code
//// * @var string
//// */
//// protected string $_code = 'unit_of_measure';
////
////}
//
//
//namespace BobGroup\BobGo\Model\Source;
//
//class Unitofmeasure extends Generic
//{
// /**
// * Carrier code
// * @var string
// */
// protected string $_code = 'unit_of_measure';
//use Magento\Framework\Option\ArrayInterface;
//
//class Unitofmeasure implements ArrayInterface
//{
// public function toOptionArray()
// {
// return [
// ['value' => 'KGS', 'label' => __('Kilograms')],
// ['value' => 'LBS', 'label' => __('Pounds')]
// ];
// }
//}
namespace BobGroup\BobGo\Model\Source;
use Magento\Framework\Option\ArrayInterface;
class Unitofmeasure implements ArrayInterface
{
public function toOptionArray()
{
return [
['value' => 'KGS', 'label' => __('Kilograms')],
['value' => 'LBS', 'label' => __('Pounds')]
];
}
}
{
"name": "bob-public-utils/bobgo-magento-extension",
"description": "Streamline your order fulfillments with Bob Go",
"name": "bobgroup/bobgo",
"description": "A simple flat rate shipping method for Magento 2",
"require": {
"php": "~8.1.28",
"monolog/monolog": "1.16.0",
"php": "~7.1.3||~7.2.0||~7.3.0||~7.4.0",
"magento/framework": "*"
},
"type": "magento2-module",
"version": "1.0.0",
"authors": [
{
"name": "Bob Go",
"email": "support@bobgo.co.za",
"homepage": "https://www.bobgo.co.za"
}
],
"license": [
"AFL-3.0",
"OSL-3.0"
"OSL-3.0",
"AFL-3.0"
],
"autoload": {
"files": [
......@@ -28,3 +20,4 @@
}
}
}
<!--<?xml version="1.0"?>-->
<!--<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Acl/etc/acl.xsd">-->
<!-- <acl>-->
<!-- <resources>-->
<!-- <resource id="Magento_Backend::admin">-->
<!-- <resource id="Magento_Config::config">-->
<!-- <resource id="BobGroup_BobGo::config" title="Bob Go Config" sortOrder="10"/>-->
<!-- </resource>-->
<!-- </resource>-->
<!-- </resources>-->
<!-- </acl>-->
<!--</config>-->
<!--<?xml version="1.0"?>-->
<!--<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">-->
<!-- <event name="admin_system_config_changed_section_carriers">-->
<!-- <observer name="bobgo_config_change_observer" instance="BobGroup\BobGo\Observer\ConfigChangeObserver" />-->
<!-- </event>-->
<!--</config>-->
......@@ -3,37 +3,35 @@
xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd">
<system>
<section id="carriers">
<group id="bobgo" translate="label" type="text" sortOrder="0" showInDefault="1" showInWebsite="1" showInStore="1">
<group id="bobgo" translate="label" type="text" sortOrder="1" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Bob Go</label>
<field id="active" translate="label" type="select" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1" canRestore="1">
<field id="active" translate="label" type="select" sortOrder="1" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Enabled</label>
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
</field>
<field id="title" translate="label" type="text" sortOrder="20" showInDefault="1" showInWebsite="1" showInStore="1" canRestore="1">
<field id="title" translate="label" type="text" sortOrder="2" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Title</label>
</field>
<field id="name" translate="label" type="text" sortOrder="30" showInDefault="1" showInWebsite="1" showInStore="1" canRestore="1">
<field id="name" translate="label" type="text" sortOrder="3" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Method Name</label>
</field>
<field id="shipping_cost" translate="label" type="text" sortOrder="40" showInDefault="1" showInWebsite="1" showInStore="1" canRestore="1">
<field id="shipping_cost" translate="label" type="text" sortOrder="4" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Shipping Cost</label>
<validate>validate-number validate-zero-or-greater</validate>
</field>
<field id="sallowspecific" translate="label" type="select" sortOrder="50" showInDefault="1" showInWebsite="1" showInStore="1" canRestore="1">
<field id="sallowspecific" translate="label" type="select" sortOrder="5" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Ship to Applicable Countries</label>
<frontend_class>shipping-applicable-country</frontend_class> <source_model>Magento\Shipping\Model\Config\Source\Allspecificcountries</source_model>
<source_model>Magento\Shipping\Model\Config\Source\Allspecificcountries</source_model>
</field>
<field id="specificcountry" translate="label" type="multiselect" sortOrder="60" showInDefault="1" showInWebsite="1" showInStore="1" canRestore="1">
<field id="specificcountry" translate="label" type="multiselect" sortOrder="6" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Ship to Specific Countries</label>
<source_model>Magento\Directory\Model\Config\Source\Country</source_model>
<can_be_empty>1</can_be_empty>
</field>
<field id="showmethod" translate="label" type="select" sortOrder="70" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Show Method if not applicable</label>
<field id="showmethod" translate="label" type="select" sortOrder="7" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Show Method if Not Applicable</label>
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
<frontend_class>shipping-skip-hide</frontend_class>
</field>
<field id="sort_order" translate="label" type="text" sortOrder="80" showInDefault="1" showInWebsite="1" showInStore="1" canRestore="1">
<field id="sort_order" translate="label" type="text" sortOrder="8" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Sort Order</label>
</field>
</group>
......
<?xml version="1.0"?>
<!--<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd">-->
<!-- <default>-->
<!-- <BobGroup_BobGo>-->
<!-- <general>-->
<!-- <debug>0</debug>-->
<!-- </general>-->
<!-- </BobGroup_BobGo>-->
<!-- <carriers>-->
<!-- <bobgo>-->
<!-- <active>1</active>-->
<!-- <price>0.00</price>-->
<!-- <model>BobGroup\BobGo\Model\Carrier\BobGo</model>-->
<!-- <name>BobGo</name>-->
<!-- <max_package_weight>300</max_package_weight>-->
<!-- <title>Bob Go</title>-->
<!-- <specificerrmsg>We could not find any shipping rates for your delivery address. Please make sure your address is correct. If you are experiencing problems, please contact us.</specificerrmsg>-->
<!-- </bobgo>-->
<!-- </carriers>-->
<!-- </default>-->
<!--</config>-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd">
<default>
......@@ -29,8 +7,10 @@
<active>1</active>
<title>Bob Go</title>
<name>BobGo</name>
<shipping_cost>10</shipping_cost>
<shipping_cost>5.00</shipping_cost>
<sallowspecific>0</sallowspecific>
<specificcountry></specificcountry>
<showmethod>1</showmethod>
<sort_order>15</sort_order>
<model>BobGroup\BobGo\Model\Carrier\BobGo</model>
</bobgo>
......
<!--<?xml version="1.0"?>-->
<!--&lt;!&ndash;<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">&ndash;&gt;-->
<!--&lt;!&ndash; <type name="BobGroup\BobGo\Logger\Logger">&ndash;&gt;-->
<!--&lt;!&ndash; <arguments>&ndash;&gt;-->
<!--&lt;!&ndash; <argument name="name" xsi:type="string">bobgo</argument>&ndash;&gt;-->
<!--&lt;!&ndash; <argument name="handlers" xsi:type="array">&ndash;&gt;-->
<!--&lt;!&ndash; <item name="stream" xsi:type="object">BobGroup\BobGo\Logger\Handler</item>&ndash;&gt;-->
<!--&lt;!&ndash; </argument>&ndash;&gt;-->
<!--&lt;!&ndash; </arguments>&ndash;&gt;-->
<!--&lt;!&ndash; </type>&ndash;&gt;-->
<!--&lt;!&ndash; <type name="BobGroup\BobGo\Observer\ConfigChangeObserver">&ndash;&gt;-->
<!--&lt;!&ndash; <arguments>&ndash;&gt;-->
<!--&lt;!&ndash; <argument name="curl" xsi:type="object">Magento\Framework\HTTP\Client\Curl</argument>&ndash;&gt;-->
<!--&lt;!&ndash; </arguments>&ndash;&gt;-->
<!--&lt;!&ndash; </type>&ndash;&gt;-->
<!--&lt;!&ndash;</config>&ndash;&gt;-->
<!--<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">-->
<!-- <type name="BobGroup\BobGo\Logger\Handler">-->
<!-- <arguments>-->
<!-- <argument name="fileName" xsi:type="string">/var/log/bobgo_plugin.log</argument>-->
<!-- <argument name="loggerType" xsi:type="number">100</argument>-->
<!-- </arguments>-->
<!-- </type>-->
<!-- <type name="BobGroup\BobGo\Logger\Logger">-->
<!-- <arguments>-->
<!-- <argument name="handlers" xsi:type="array">-->
<!-- <item name="bobgo" xsi:type="object">BobGroup\BobGo\Logger\Handler</item>-->
<!-- </argument>-->
<!-- </arguments>-->
<!-- </type>-->
<!--</config>-->
<?php
//return [
// 'backend' => [
// 'frontName' => 'admin'
// ],
// 'install' => [
// 'date' => 'Wed, 15 Jan 2020 00:00:00 +0000'
// ],
// 'system' => [
// 'default' => [
// 'dev' => [
// 'log' => [
// 'active' => '1'
// ]
// ]
// ]
// ],
// // Other configurations...
//];
<!--<?xml version="1.0"?>-->
<!--<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Api/etc/extension_attributes.xsd">-->
<!-- <extension_attributes for="Magento\Quote\Api\Data\AddressInterface">-->
<!-- <attribute code="suburb" type="string"/>-->
<!-- </extension_attributes>-->
<!--</config>-->
<?xml version="1.0"?>
<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="BobGroup\BobGo\Plugin\Checkout\Block\LayoutProcessorPlugin" sortOrder="10"/>
<arguments>
<argument name="layoutProcessors" xsi:type="array">
<item name="orderattribute" xsi:type="object">BobGroup\BobGo\Plugin\Checkout\Block\LayoutProcessorPlugin</item>
</argument>
</arguments>
</type>
</config>
......
<?xml version="1.0"?>
<!--
/**
* @category Bob Go
* @package bobgo_CustomShipping
* @author Bob Go
*/
-->
<!--<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">-->
<!-- <module name="BobGroup_BobGo" setup_version="1.0.0">-->
<!-- <sequence>-->
<!-- <module name="Magento_Webapi"/>-->
<!-- <module name="Magento_Catalog"/>-->
<!-- <module name="Magento_Store"/>-->
<!-- <module name="Magento_Sales"/>-->
<!-- <module name="Magento_Quote"/>-->
<!-- <module name="Magento_SalesRule"/>-->
<!-- </sequence>-->
<!-- </module>-->
<!--</config>-->
<!--<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">-->
<!--<module name="BobGroup_BobGo" setup_version="1.0.0">-->
<!-- <sequence>-->
<!-- <module name="Magento_Config"/>-->
<!-- <module name="Magento_Shipping"/>-->
<!-- </sequence>-->
<!--</module>-->
<!--</config>-->
<!-- <?xml version="1.0"?>-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="BobGroup_BobGo"/>
<module name="BobGroup_BobGo" setup_version="1.0.0"/>
</config>
<?php
declare(strict_types=1);
use Magento\Framework\Component\ComponentRegistrar;
ComponentRegistrar::register(
ComponentRegistrar::MODULE,
\Magento\Framework\Component\ComponentRegistrar::register(
\Magento\Framework\Component\ComponentRegistrar::MODULE,
'BobGroup_BobGo',
__DIR__
);
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment