From 8f2415cae809b1c18c5f8a9d19838f1561905ff5 Mon Sep 17 00:00:00 2001 From: Johan van der Klis Date: Fri, 23 Aug 2024 15:53:47 +0200 Subject: [PATCH] Name change --- composer.json | 2 +- config_nl.xml | 11 ----------- src/Config/Config.php | 4 ++-- src/Module/Hooks/Front/FrontHooks.php | 4 ++-- src/SimpleForm/FormController.php | 8 ++++---- .../DataRetrievers/CheckoutDataRetriever.php | 2 +- .../DataRetrievers/OrderConfDataRetriever.php | 6 +++--- .../DataRetrievers/ProductDataRetriever.php | 4 ++-- src/Tracking/Presenter/Presenter.php | 2 +- ws_taggrs.php => taggrs_prestashop.php | 4 ++-- vendor/.htaccess | 10 ---------- vendor/autoload.php | 2 +- vendor/composer/autoload_real.php | 8 ++++---- vendor/composer/autoload_static.php | 8 ++++---- vendor/composer/installed.php | 16 ++++++++-------- 15 files changed, 35 insertions(+), 56 deletions(-) delete mode 100644 config_nl.xml rename ws_taggrs.php => taggrs_prestashop.php (95%) delete mode 100644 vendor/.htaccess diff --git a/composer.json b/composer.json index f7980fa..65393a7 100644 --- a/composer.json +++ b/composer.json @@ -1,5 +1,5 @@ { - "name": "websmid/ws_taggrs", + "name": "websmid/taggrs_prestashop", "type": "library", "autoload": { "psr-4": { diff --git a/config_nl.xml b/config_nl.xml deleted file mode 100644 index fde8c03..0000000 --- a/config_nl.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - ws_taggrs - - - - - - 1 - 0 - \ No newline at end of file diff --git a/src/Config/Config.php b/src/Config/Config.php index 69021f7..de139d9 100644 --- a/src/Config/Config.php +++ b/src/Config/Config.php @@ -20,12 +20,12 @@ class Config self::GTM_CODE => [ 'type' => 'text', 'label' => 'GTM CODE', - 'name' => 'GTM_CODE', + 'name' => self::GTM_CODE, ], self::GTM_URL => [ 'type' => 'text', 'label' => 'TAGGRS URL', - 'name' => 'GTM_URL', + 'name' => self::GTM_URL, ] ]; } \ No newline at end of file diff --git a/src/Module/Hooks/Front/FrontHooks.php b/src/Module/Hooks/Front/FrontHooks.php index f2a2dab..b7e41bd 100644 --- a/src/Module/Hooks/Front/FrontHooks.php +++ b/src/Module/Hooks/Front/FrontHooks.php @@ -18,8 +18,8 @@ public function hookActionFrontControllerSetMedia($params) ]); $this->context->controller->registerJavascript( - 'module-ws_taggrs-taggrs_dynamic_events', - 'modules/ws_taggrs/views/js/taggrs_dynamic_events.js', + 'module-taggrs-prestashop-_dynamic_events', + 'modules/taggrs_prestashop/views/js/taggrs_dynamic_events.js', [ 'priority' => 200, 'attributes' => 'async', diff --git a/src/SimpleForm/FormController.php b/src/SimpleForm/FormController.php index 28a0147..0fd0b10 100644 --- a/src/SimpleForm/FormController.php +++ b/src/SimpleForm/FormController.php @@ -40,11 +40,11 @@ public function generateFormWithFields() // Base form info $fieldsForm[0]['form'] = [ 'legend' => [ - 'title' => Context::getContext()->getTranslator()->trans('Instellingen', [], 'Modules.Ws_Taggrs.Admin'), + 'title' => Context::getContext()->getTranslator()->trans('Instellingen', [], 'Modules.Taggrs_Prestashop.Admin'), ], 'input' => [], 'submit' => [ - 'title' => Context::getContext()->getTranslator()->trans('Opslaan', [], 'Modules.Ws_Taggrs.Admin'), + 'title' => Context::getContext()->getTranslator()->trans('Opslaan', [], 'Modules.Taggrs_Prestashop.Admin'), 'class' => 'btn btn-default pull-right' ] ]; @@ -87,13 +87,13 @@ public function generateFormWithFields() $helper->submit_action = 'submitWSForm'; $helper->toolbar_btn = [ 'save' => [ - 'desc' => Context::getContext()->getTranslator()->trans('Opslaan', [], 'Modules.Ws_Taggrs.Admin'), + 'desc' => Context::getContext()->getTranslator()->trans('Opslaan', [], 'Modules.Taggrs_Prestashop.Admin'), 'href' => AdminController::$currentIndex.'&configure='.$this->module->name.'&save'.$this->module->name. '&token='.Tools::getAdminTokenLite('AdminModules'), ], 'back' => [ 'href' => AdminController::$currentIndex.'&token='.Tools::getAdminTokenLite('AdminModules'), - 'desc' => Context::getContext()->getTranslator()->trans('Terug', [], 'Modules.Ws_Taggrs.Admin') + 'desc' => Context::getContext()->getTranslator()->trans('Terug', [], 'Modules.Taggrs_Prestashop.Admin') ] ]; diff --git a/src/Tracking/DataRetrievers/CheckoutDataRetriever.php b/src/Tracking/DataRetrievers/CheckoutDataRetriever.php index 97dfc25..00d29c3 100644 --- a/src/Tracking/DataRetrievers/CheckoutDataRetriever.php +++ b/src/Tracking/DataRetrievers/CheckoutDataRetriever.php @@ -27,7 +27,7 @@ public function getBaseData() $newProduct = [ 'item_id' => $product->id, 'item_name' => $product->name, - 'price' => (string)round($product->price_amount, 2), + 'price' => (string)round((float)$product->price_amount, 2), 'quantity' => $product->quantity ]; diff --git a/src/Tracking/DataRetrievers/OrderConfDataRetriever.php b/src/Tracking/DataRetrievers/OrderConfDataRetriever.php index b7ebde8..fd2f21c 100644 --- a/src/Tracking/DataRetrievers/OrderConfDataRetriever.php +++ b/src/Tracking/DataRetrievers/OrderConfDataRetriever.php @@ -41,8 +41,8 @@ public function getBaseData() 'currency' => $currency['iso_code'], 'transaction_id' => $baseOrder->reference, 'value' => (float)round((float)$baseOrder->total_paid, 2), - 'tax' => (float)round($totalTax, 2), - 'shipping' => (float)round($baseOrder->total_shipping_tax_incl, 2), + 'tax' => (float)round((float)$totalTax, 2), + 'shipping' => (float)round((float)$baseOrder->total_shipping_tax_incl, 2), 'items' => [], 'user_data' => [ 'first_name' => $orderCustomer['firstname'], @@ -88,4 +88,4 @@ public function getBaseData() return $rawData; } -} +} \ No newline at end of file diff --git a/src/Tracking/DataRetrievers/ProductDataRetriever.php b/src/Tracking/DataRetrievers/ProductDataRetriever.php index 24fb216..94473a2 100644 --- a/src/Tracking/DataRetrievers/ProductDataRetriever.php +++ b/src/Tracking/DataRetrievers/ProductDataRetriever.php @@ -20,11 +20,11 @@ public function getBaseData() $rawData = [ 'currency' => $currency['iso_code'], - 'value' => (float)round($baseProduct->price_amount, 2), + 'value' => (float)round((float)$baseProduct->price_amount, 2), 'items' => [ 'item_id' => $baseProduct->id, 'item_name' => $baseProduct->name, - 'price' => (float)round($baseProduct->price_amount, 2), + 'price' => (float)round((float)$baseProduct->price_amount, 2), 'item_category' => $baseProduct->category_name, 'item_brand' => $baseProduct->manufacturer_name, ] diff --git a/src/Tracking/Presenter/Presenter.php b/src/Tracking/Presenter/Presenter.php index 5afcea9..dcaf250 100644 --- a/src/Tracking/Presenter/Presenter.php +++ b/src/Tracking/Presenter/Presenter.php @@ -24,7 +24,7 @@ public function setCustomVariables(array $templateVars) public function present() { - if( empty($moduleClass = Module::getInstanceByname('ws_taggrs')) ){ + if( empty($moduleClass = Module::getInstanceByname('taggrs_prestashop')) ){ return ''; } diff --git a/ws_taggrs.php b/taggrs_prestashop.php similarity index 95% rename from ws_taggrs.php rename to taggrs_prestashop.php index 1daf506..52e6ee5 100644 --- a/ws_taggrs.php +++ b/taggrs_prestashop.php @@ -33,7 +33,7 @@ require_once __DIR__ . '/vendor/autoload.php'; } -class Ws_Taggrs extends Module +class Taggrs_PrestaShop extends Module { use Install; use AdminHooks; @@ -41,7 +41,7 @@ class Ws_Taggrs extends Module public function __construct() { - $this->name = 'ws_taggrs'; + $this->name = 'taggrs_prestashop'; $this->version = '1.0.1'; $this->author = 'Johan van der Klis | De Websmid BV'; $this->need_instance = 0; diff --git a/vendor/.htaccess b/vendor/.htaccess deleted file mode 100644 index 3de9e40..0000000 --- a/vendor/.htaccess +++ /dev/null @@ -1,10 +0,0 @@ -# Apache 2.2 - - Order deny,allow - Deny from all - - -# Apache 2.4 - - Require all denied - diff --git a/vendor/autoload.php b/vendor/autoload.php index 9d831da..4c92981 100644 --- a/vendor/autoload.php +++ b/vendor/autoload.php @@ -4,4 +4,4 @@ require_once __DIR__ . '/composer/autoload_real.php'; -return ComposerAutoloaderInit34c6e9bc511b04a2dbb3f5cb6679729f::getLoader(); +return ComposerAutoloaderInitbef1af25f41ee2416e5b800b21b7f451::getLoader(); diff --git a/vendor/composer/autoload_real.php b/vendor/composer/autoload_real.php index 22be216..ea6078b 100644 --- a/vendor/composer/autoload_real.php +++ b/vendor/composer/autoload_real.php @@ -2,7 +2,7 @@ // autoload_real.php @generated by Composer -class ComposerAutoloaderInit34c6e9bc511b04a2dbb3f5cb6679729f +class ComposerAutoloaderInitbef1af25f41ee2416e5b800b21b7f451 { private static $loader; @@ -22,15 +22,15 @@ public static function getLoader() return self::$loader; } - spl_autoload_register(array('ComposerAutoloaderInit34c6e9bc511b04a2dbb3f5cb6679729f', 'loadClassLoader'), true, true); + spl_autoload_register(array('ComposerAutoloaderInitbef1af25f41ee2416e5b800b21b7f451', 'loadClassLoader'), true, true); self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__))); - spl_autoload_unregister(array('ComposerAutoloaderInit34c6e9bc511b04a2dbb3f5cb6679729f', 'loadClassLoader')); + spl_autoload_unregister(array('ComposerAutoloaderInitbef1af25f41ee2416e5b800b21b7f451', 'loadClassLoader')); $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded()); if ($useStaticLoader) { require __DIR__ . '/autoload_static.php'; - call_user_func(\Composer\Autoload\ComposerStaticInit34c6e9bc511b04a2dbb3f5cb6679729f::getInitializer($loader)); + call_user_func(\Composer\Autoload\ComposerStaticInitbef1af25f41ee2416e5b800b21b7f451::getInitializer($loader)); } else { $map = require __DIR__ . '/autoload_namespaces.php'; foreach ($map as $namespace => $path) { diff --git a/vendor/composer/autoload_static.php b/vendor/composer/autoload_static.php index 36ca714..2c5ccfc 100644 --- a/vendor/composer/autoload_static.php +++ b/vendor/composer/autoload_static.php @@ -4,7 +4,7 @@ namespace Composer\Autoload; -class ComposerStaticInit34c6e9bc511b04a2dbb3f5cb6679729f +class ComposerStaticInitbef1af25f41ee2416e5b800b21b7f451 { public static $prefixLengthsPsr4 = array ( 'W' => @@ -27,9 +27,9 @@ class ComposerStaticInit34c6e9bc511b04a2dbb3f5cb6679729f public static function getInitializer(ClassLoader $loader) { return \Closure::bind(function () use ($loader) { - $loader->prefixLengthsPsr4 = ComposerStaticInit34c6e9bc511b04a2dbb3f5cb6679729f::$prefixLengthsPsr4; - $loader->prefixDirsPsr4 = ComposerStaticInit34c6e9bc511b04a2dbb3f5cb6679729f::$prefixDirsPsr4; - $loader->classMap = ComposerStaticInit34c6e9bc511b04a2dbb3f5cb6679729f::$classMap; + $loader->prefixLengthsPsr4 = ComposerStaticInitbef1af25f41ee2416e5b800b21b7f451::$prefixLengthsPsr4; + $loader->prefixDirsPsr4 = ComposerStaticInitbef1af25f41ee2416e5b800b21b7f451::$prefixDirsPsr4; + $loader->classMap = ComposerStaticInitbef1af25f41ee2416e5b800b21b7f451::$classMap; }, null, ClassLoader::class); } diff --git a/vendor/composer/installed.php b/vendor/composer/installed.php index 90bda25..7ab06c2 100644 --- a/vendor/composer/installed.php +++ b/vendor/composer/installed.php @@ -1,22 +1,22 @@ array( - 'pretty_version' => '1.0.0+no-version-set', - 'version' => '1.0.0.0', + 'pretty_version' => 'dev-main', + 'version' => 'dev-main', 'type' => 'library', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), - 'reference' => NULL, - 'name' => 'websmid/ws_taggrs', + 'reference' => 'f33906b0bdf1809051d879eb1a46c1da323120e6', + 'name' => 'websmid/taggrs_prestashop', 'dev' => true, ), 'versions' => array( - 'websmid/ws_taggrs' => array( - 'pretty_version' => '1.0.0+no-version-set', - 'version' => '1.0.0.0', + 'websmid/taggrs_prestashop' => array( + 'pretty_version' => 'dev-main', + 'version' => 'dev-main', 'type' => 'library', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), - 'reference' => NULL, + 'reference' => 'f33906b0bdf1809051d879eb1a46c1da323120e6', 'dev_requirement' => false, ), ),