diff --git a/README.md b/README.md index 7495da5..6687df8 100644 --- a/README.md +++ b/README.md @@ -99,13 +99,17 @@ Product category: {{ product_category_[1-10] }}. ## Changelog +### 1.2.1 + +- Support for PHP 5.6 + ### 1.2.0 New feature: - Changes due to Smaily workflows automation - Subdomain field parsed when full url entered -- Separate url-s to run customer and cart cron. +- Separate url-s to run customer and cart cron - Settings page updated for better user-friendliness - Cron tokens auto generated and url-example now dynamic - Optimized newsletter subscribe form to use in left/right column of your webpage @@ -117,13 +121,13 @@ Bugfix: - Abandoned cart didn't erase email fields that were previously sent - Customer cron did't get new state of unsubscribed customers before synchronizing with Smaily -- Rss-feed did't show discount and price correctly with taxes. +- Rss-feed did't show discount and price correctly with taxes ### 1.1.0 - 2019 -- New Feature. Added Abandoned cart support. -- Changed admin page behaviour when API credentials allready validated. +- New Feature. Added Abandoned cart support +- Changed admin page behaviour when API credentials allready validated ### 1.0.0 - 2018 -- This is the first public release. +- This is the first public release diff --git a/controllers/front/SmailyCartCron.php b/controllers/front/SmailyCartCron.php index 7181533..08a609a 100644 --- a/controllers/front/SmailyCartCron.php +++ b/controllers/front/SmailyCartCron.php @@ -153,7 +153,7 @@ private function abandonedCart() * @param integer $id_cart Cart ID * @return void */ - private function updateSentStatus(int $id_customer, int $id_cart) + private function updateSentStatus($id_customer, $id_cart) { $sql = 'INSERT INTO ' . _DB_PREFIX_ . 'smaily_cart (id_customer, id_cart, date_sent) VALUES (' . $id_customer . ', ' . $id_cart . ', CURRENT_TIMESTAMP)'; diff --git a/smailyforprestashop.php b/smailyforprestashop.php index 0444182..9b5b9be 100644 --- a/smailyforprestashop.php +++ b/smailyforprestashop.php @@ -32,7 +32,7 @@ public function __construct() { $this->name = 'smailyforprestashop'; $this->tab = 'advertising_marketing'; - $this->version = '1.2.0'; + $this->version = '1.2.1'; $this->author = 'Smaily'; $this->need_instance = 0; $this->ps_versions_compliancy = array( @@ -172,7 +172,7 @@ public function getContent() $customer_cron_token = pSQL(Tools::getValue('SMAILY_CUSTOMER_CRON_TOKEN')); $customer_cron_token = trim(Tools::stripslashes($customer_cron_token)); if (empty($customer_cron_token)) { - $customer_cron_token = bin2hex(random_bytes(6)); + $customer_cron_token = uniqid(); } // Syncronize additional. @@ -207,7 +207,7 @@ public function getContent() $cart_cron_token = pSQL(Tools::getValue('SMAILY_CART_CRON_TOKEN')); $cart_cron_token = trim(Tools::stripslashes($cart_cron_token)); if (empty($cart_cron_token)) { - $cart_cron_token = bin2hex(random_bytes(6)); + $cart_cron_token = uniqid(); } // Abandoned cart Autoresponder $cart_autoresponder = pSQL((Tools::getValue('SMAILY_CART_AUTORESPONDER'))); @@ -266,13 +266,13 @@ public function getContent() if (false != Configuration::get('SMAILY_CUSTOMER_CRON_TOKEN')) { $customer_cron_token = pSQL(Configuration::get('SMAILY_CUSTOMER_CRON_TOKEN')); } else { - $customer_cron_token = bin2hex(random_bytes(6)); + $customer_cron_token = uniqid(); } // Get cart cron token or generate random string when not set. if (false != Configuration::get('SMAILY_CART_CRON_TOKEN')) { $cart_cron_token = pSQL(Configuration::get('SMAILY_CART_CRON_TOKEN')); } else { - $cart_cron_token = bin2hex(random_bytes(6)); + $cart_cron_token = uniqid(); } // Get abandoned cart autoresponder values for template. $cart_autoresponder_for_template = pSQL((Configuration::get('SMAILY_CART_AUTORESPONDER'))); @@ -377,7 +377,7 @@ public function logToFile($filename, $response) * @param string $method 'GET' or 'POST' method. * @return array $response Response from smaily api. */ - public function callApi(string $endpoint, array $data, string $method = 'GET') + public function callApi($endpoint, array $data, $method = 'GET') { // Smaily api credentials. $subdomain = pSQL(Configuration::get('SMAILY_SUBDOMAIN'));