mirror of
https://github.com/retailcrm/prestashop-module.git
synced 2025-03-01 19:03:14 +03:00
Added loading catalog in CRM after ICML generation
This commit is contained in:
parent
c27a932f2e
commit
960ed4438a
@ -87,6 +87,34 @@ class RetailcrmCatalogHelper
|
|||||||
return _PS_ROOT_DIR_ . '/' . self::getIcmlFileName();
|
return _PS_ROOT_DIR_ . '/' . self::getIcmlFileName();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static function isIcmlFileLinkActual()
|
||||||
|
{
|
||||||
|
$api = RetailcrmTools::getApiClient();
|
||||||
|
if (empty($api)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
$reference = new RetailcrmReferences($api);
|
||||||
|
$site = $reference->getSite();
|
||||||
|
|
||||||
|
if (empty($site)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
$newYmlUrl = RetailcrmCatalogHelper::getIcmlFileLink();
|
||||||
|
|
||||||
|
RetailcrmLogger::writeDebug(
|
||||||
|
__METHOD__, sprintf(
|
||||||
|
'Comparing %s and %s: %s',
|
||||||
|
$newYmlUrl,
|
||||||
|
$site['ymlUrl'],
|
||||||
|
$newYmlUrl === $site['ymlUrl'] ? 'true' : 'false'
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
return $newYmlUrl === $site['ymlUrl'];
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param int $productsCount
|
* @param int $productsCount
|
||||||
* @param int $offersCount
|
* @param int $offersCount
|
||||||
|
@ -61,6 +61,20 @@ class RetailcrmIcmlEvent extends RetailcrmAbstractEvent implements RetailcrmEven
|
|||||||
|
|
||||||
$icml = new RetailcrmIcml($shop['name'], RetailcrmCatalogHelper::getIcmlFilePath());
|
$icml = new RetailcrmIcml($shop['name'], RetailcrmCatalogHelper::getIcmlFilePath());
|
||||||
$icml->generate($data[0], $data[1]);
|
$icml->generate($data[0], $data[1]);
|
||||||
|
|
||||||
|
if (true !== RetailcrmCatalogHelper::isIcmlFileLinkActual()) {
|
||||||
|
RetailcrmLogger::writeDebug(
|
||||||
|
__METHOD__,
|
||||||
|
'Skip statistic update due to non consistent ICML file link'
|
||||||
|
);
|
||||||
|
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
$api = RetailcrmTools::getApiClient();
|
||||||
|
if (null !== $api) {
|
||||||
|
$api->statisticUpdate();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
@ -1 +1 @@
|
|||||||
<!DOCTYPE html><html lang=""><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="../modules/retailcrm/views/favicon.ico"><title>prestashop</title><link href="../modules/retailcrm/views/js/app.js" rel="preload" as="script"><link href="../modules/retailcrm/views/js/chunk-vendors.js" rel="preload" as="script"></head><body><noscript><strong>We're sorry but prestashop doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div><script src="../modules/retailcrm/views/js/chunk-vendors.js"></script><script src="../modules/retailcrm/views/js/app.js"></script></body></html>
|
<!DOCTYPE html><html lang=""><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="../modules/retailcrm/views/favicon.ico"><title>prestashop</title><link href="../modules/retailcrm/views/js/app.js" rel="preload" as="script"><link href="../modules/retailcrm/views/js/chunk-vendors.js" rel="preload" as="script"></head><body><noscript><strong>We're sorry but prestashop doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div><script src="../modules/retailcrm/views/js/chunk-vendors.js"></script><script src="../modules/retailcrm/views/js/app.js"></script></body></html>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user