Skip to content

Commit

Permalink
Merge pull request #221 from Nosto/release/3.3.0
Browse files Browse the repository at this point in the history
Release 3.3.0
  • Loading branch information
liangde-chen committed Mar 28, 2018
2 parents d8cbc99 + b96304e commit 03a5b28
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 11 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
All notable changes to this project will be documented in this file.
This project adheres to Semantic Versioning(http://semver.org/).

## 3.3.0
- Add marketing permission for customer tagging and for buyer
- Fix the compatibility issue with some third-party plugins which update catalog without setting employee to prestashop context

## 3.2.4
- Fix the bug that could not add product to cart without nosto account

Expand Down
1 change: 1 addition & 0 deletions classes/models/NostoCustomer.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ public static function loadData(Customer $customer)
$nostoCustomer->setFirstName($customer->firstname);
$nostoCustomer->setLastName($customer->lastname);
$nostoCustomer->setEmail($customer->email);
$nostoCustomer->setMarketingPermission($customer->newsletter);
try {
$nostoCustomer->populateCustomerReference($customer);
} catch (Exception $e) {
Expand Down
1 change: 1 addition & 0 deletions classes/models/order/NostoOrderBuyer.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ public static function loadData(Customer $customer, Order $order)
$nostoBuyer->setFirstName($customer->firstname);
$nostoBuyer->setLastName($customer->lastname);
$nostoBuyer->setEmail($customer->email);
$nostoBuyer->setMarketingPermission($customer->newsletter);

$billingAddressId = $order->id_address_invoice;
$addresses = $customer->getAddresses($order->id_lang);
Expand Down
20 changes: 17 additions & 3 deletions classes/services/NostoProductService.php
Original file line number Diff line number Diff line change
Expand Up @@ -189,9 +189,23 @@ public function upsert($params)
if ($object instanceof Product) {
//run over all the nosto account
$nostoProductService = $this;
NostoHelperContext::runWithEachNostoAccount(function () use ($object, $nostoProductService) {
$nostoProductService->updateProduct($object);
});
// We need to forge the employee in order to get a price for a product
$employeeId = false; //@codingStandardsIgnoreLine
if (!is_object(Context::getContext()->employee) && !is_object(Context::getContext()->cart)) {
//if employee is null and cart is null, new Product() kills the process.
$employeeId = 0;
}
NostoHelperContext::runInContext(
function () use ($object, $nostoProductService) {
NostoHelperContext::runWithEachNostoAccount(function () use ($object, $nostoProductService) {
$nostoProductService->updateProduct($object);
});
},
false,
false,
false,
$employeeId
);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "nosto/nostotagging",
"description": "Nosto Module for Prestashop",
"require": {
"nosto/php-sdk": "3.2.1"
"nosto/php-sdk": "3.3.1"
},
"require-dev": {
"phing/phing": "2.*",
Expand Down
12 changes: 6 additions & 6 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion nostotagging.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class NostoTagging extends Module
*
* @var string
*/
const PLUGIN_VERSION = '3.2.4';
const PLUGIN_VERSION = '3.3.0';

/**
* Internal name of the Nosto plug-in
Expand Down

0 comments on commit 03a5b28

Please sign in to comment.