add missing context
This commit is contained in:
@@ -985,8 +985,12 @@ class MauticConnect extends Module
|
||||
$customer = new Customer((int)$cart->id_customer);
|
||||
|
||||
$currency = new Currency((int)$cart->id_currency);
|
||||
$link = new Link(); // Needed for generating image URLs
|
||||
|
||||
Context::getContext()->currency = $currency;
|
||||
Context::getContext()->customer = $customer;
|
||||
Context::getContext()->language = new Language($cart->id_lang);
|
||||
Context::getContext()->country = new \Country(\Configuration::get('PS_COUNTRY_DEFAULT'));
|
||||
Context::getContext()->link = new Link();
|
||||
// 3. Gather primary data
|
||||
$customer_email = $customer->email;
|
||||
if (!$this->isContactInSegment($customer_email, $mauticSegmentId)) {
|
||||
@@ -994,7 +998,7 @@ class MauticConnect extends Module
|
||||
}
|
||||
|
||||
|
||||
$action_url = $link->getPageLink('cart', true, null, [
|
||||
$action_url = Context::getContext()->link->getPageLink('cart', true, null, [
|
||||
'action' => 'show',
|
||||
|
||||
]);
|
||||
@@ -1006,10 +1010,10 @@ class MauticConnect extends Module
|
||||
$abandoned_cart_items_for_html = [];
|
||||
foreach ($products as $product) {
|
||||
|
||||
$product_obj = new Product($product['id_product'], false, $this->context->language->id);
|
||||
$product_obj = new Product($product['id_product'], false, Context::getContext()->language->id);
|
||||
$product_url = $product_obj->getLink();
|
||||
$cover_img = Product::getCover($product_obj->id);
|
||||
$image_url = $link->getImageLink($product_obj->link_rewrite, $cover_img['id_image'], 'cart_default');
|
||||
$image_url = Context::getContext()->link->getImageLink($product_obj->link_rewrite, $cover_img['id_image'], 'cart_default');
|
||||
|
||||
$abandoned_cart_items_for_html[] = [
|
||||
'image_url' => $image_url,
|
||||
@@ -1056,7 +1060,7 @@ class MauticConnect extends Module
|
||||
"about" => [ // What this email is about: the abandoned cart items
|
||||
"@type" => "OfferCatalog", // A collection of offers/products
|
||||
"name" => "Неоформлене замовлення",
|
||||
"description" => "Ви, можливо, забули придбати ці товари на ".Tools::getShopDomainSsl(),
|
||||
"description" => "Ви, можливо, забули придбати ці товари на " . Tools::getShopDomainSsl(),
|
||||
// Optionally, add a general image for the catalog/brand
|
||||
// // "image": "https://exclusion-ua.shop/logo.png",
|
||||
"merchant" => [
|
||||
|
||||
Reference in New Issue
Block a user