Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1291,14 +1291,14 @@ public function getEntityByCategory($root, $category)
protected function _initOnTabAttributes()
{
if (Mage::helper('core')->isModuleEnabled('OnTap_Merchandiser')) {
$this->_particularAttributes = array_merge($this->_particularAttributes, [
$this->_particularAttributes = array_merge($this->_particularAttributes, array(
'_ontap_heroproducts',
'_ontap_attribute',
'_ontap_attribute_value',
'_ontap_attribute_logic',
'_ontap_ruled_only',
'_ontap_automatic_sort'
]);
));
}
return $this;
}
Expand All @@ -1319,7 +1319,7 @@ protected function _saveOnTab()

$entityTable = Mage::getSingleton('core/resource')->getTableName('merchandiser_category_values');
$categoryId = null;
$attributeIdsByCode = [];
$attributeIdsByCode = array();

while ($bunch = $this->_dataSourceModel->getNextBunch()) {
$onTapData = array();
Expand All @@ -1335,14 +1335,14 @@ protected function _saveOnTab()
$category = $this->getEntityByCategory($rowData[self::COL_ROOT], $rowData[self::COL_CATEGORY]);
$categoryId = (int) $category['entity_id'];

$onTapData[$categoryId] = [
$onTapData[$categoryId] = array(
'category_id' => $categoryId,
'heroproducts' => '',
'attribute_codes' => '',
'smart_attributes' => '',
'ruled_only' => '',
'automatic_sort' => ''
];
);
}

//we have a non-SCOPE_DEFAULT row, we check if it has a stock_id, if not, skip it.
Expand All @@ -1356,21 +1356,21 @@ protected function _saveOnTab()
}

//get the _ontab_* smart attribute values and map them to the new keys that are present in the database.
$smartAttributes = array_intersect_key($rowData, [
$smartAttributes = array_intersect_key($rowData, array(
'_ontap_attribute' => '',
'_ontap_attribute_value' => '',
'_ontap_attribute_logic' => '',
]);
));

//only add if we've found data
//todo check if we've got all values, there should be three, else it will throw an error here.
if ($smartAttributes) {
if (! isset($onTapData[$categoryId]['attribute_codes'])) {
$onTapData[$categoryId]['attribute_codes'] = [];
$onTapData[$categoryId]['smart_attributes'] = [];
$onTapData[$categoryId]['attribute_codes'] = array();
$onTapData[$categoryId]['smart_attributes'] = array();
}

$smartAttributes = array_combine(['attribute', 'value', 'link'], $smartAttributes);
$smartAttributes = array_combine(array('attribute', 'value', 'link'), $smartAttributes);

if (! isset($attributeIdsByCode[$smartAttributes['attribute']])) {
$attributeIdsByCode[$smartAttributes['attribute']] =
Expand All @@ -1389,7 +1389,7 @@ protected function _saveOnTab()

if (isset($rowData['_ontap_heroproducts'])) {
if (! isset($onTapData[$categoryId]['heroproducts'])) {
$onTapData[$categoryId]['heroproducts'] = [];
$onTapData[$categoryId]['heroproducts'] = array();
}
$onTapData[$categoryId]['heroproducts'][] = $rowData['_ontap_heroproducts'];
}
Expand Down