mirror of
https://github.com/retailcrm/prestashop-module.git
synced 2025-04-11 12:50:55 +00:00
parent
a307b1b4f0
commit
0b11bad72a
2 changed files with 21 additions and 2 deletions
|
@ -208,7 +208,7 @@ class RetailcrmCatalog
|
|||
}
|
||||
|
||||
$offers = Product::getProductAttributesIds($product['id_product']);
|
||||
$features = Product::getFeaturesStatic($product['id_product']);
|
||||
$features = Product::getFrontFeaturesStatic($id_lang, $product['id_product']);
|
||||
|
||||
if (!empty($offers)) {
|
||||
$offersCount += count($offers);
|
||||
|
|
21
retailcrm/lib/RetailcrmIcml.php
Normal file → Executable file
21
retailcrm/lib/RetailcrmIcml.php
Normal file → Executable file
|
@ -189,6 +189,7 @@ class RetailcrmIcml
|
|||
$this->setOffersProperties($offer);
|
||||
$this->setOffersParams($offer);
|
||||
$this->setOffersCombinations($offer);
|
||||
$this->setOffersFeatures($offer);
|
||||
|
||||
$this->writer->endElement(); // end </offer>
|
||||
}
|
||||
|
@ -213,7 +214,6 @@ class RetailcrmIcml
|
|||
|
||||
private function setOffersParams($offer)
|
||||
{
|
||||
RetailcrmLogger::writeCaller('inventories', print_r($offer, true));
|
||||
foreach ($offer as $key => $value) {
|
||||
if (!array_key_exists($key, $this->params)) {
|
||||
continue;
|
||||
|
@ -251,6 +251,25 @@ class RetailcrmIcml
|
|||
}
|
||||
}
|
||||
|
||||
private function setOffersFeatures($offer)
|
||||
{
|
||||
foreach ($offer['features'] as $feature) {
|
||||
if (
|
||||
empty($feature['id_feature'])
|
||||
|| empty($feature['name'])
|
||||
|| $feature['value'] === null
|
||||
) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$this->writer->startElement('param');
|
||||
$this->writer->writeAttribute('code', 'feature_' . $feature['id_feature']);
|
||||
$this->writer->writeAttribute('name' , $feature['name']);
|
||||
$this->writer->text($feature['value']);
|
||||
$this->writer->endElement();
|
||||
}
|
||||
}
|
||||
|
||||
private function writeEnd()
|
||||
{
|
||||
$this->writer->endElement(); // end </yml_catalog>
|
||||
|
|
Loading…
Add table
Reference in a new issue