Skip to content

Commit

Permalink
Remove php 5.6+ syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
sinukaarel committed Jun 6, 2019
1 parent f765988 commit 1434497
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 12 deletions.
14 changes: 9 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
2 changes: 1 addition & 1 deletion controllers/front/SmailyCartCron.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)';
Expand Down
12 changes: 6 additions & 6 deletions smailyforprestashop.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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')));
Expand Down Expand Up @@ -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')));
Expand Down Expand Up @@ -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'));
Expand Down

0 comments on commit 1434497

Please sign in to comment.