diff --git a/system/modules/isotope/library/Isotope/Frontend.php b/system/modules/isotope/library/Isotope/Frontend.php index 781bafc35b..d24d252a43 100644 --- a/system/modules/isotope/library/Isotope/Frontend.php +++ b/system/modules/isotope/library/Isotope/Frontend.php @@ -719,7 +719,7 @@ public function addOptionsPrice($fltPrice, $objSource, $strField, $intTaxClass, /** @var AttributeOption $objOption */ foreach ($objOptions as $objOption) { - if (\in_array($objOption->id, $value)) { + if (\in_array($objOption->getLanguageId(), $value)) { $amount = $objOption->getAmount($fltPrice, 0); $objTax = $objSource->getRelated('tax_class'); diff --git a/system/modules/isotope/library/Isotope/Model/Attribute.php b/system/modules/isotope/library/Isotope/Model/Attribute.php index 04464867c7..35ce40057d 100644 --- a/system/modules/isotope/library/Isotope/Model/Attribute.php +++ b/system/modules/isotope/library/Isotope/Model/Attribute.php @@ -259,7 +259,7 @@ public function saveToDCA(array &$arrData) $arrOptions = []; foreach (AttributeOption::findByAttribute($this, ['order' => AttributeOption::getTable().'.label']) as $model) { $arrOptions[] = [ - 'value' => $model->id, + 'value' => $model->getLanguageId(), 'label' => $model->label, ]; } @@ -269,7 +269,7 @@ public function saveToDCA(array &$arrData) $arrOptions = []; foreach (AttributeOption::findByProducts($this, ['order' => AttributeOption::getTable().'.label']) as $model) { $arrOptions[] = [ - 'value' => $model->id, + 'value' => $model->getLanguageId(), 'label' => $model->label, ]; } diff --git a/system/modules/isotope/library/Isotope/Model/AttributeOption.php b/system/modules/isotope/library/Isotope/Model/AttributeOption.php index ab33786d37..be7f73e1e9 100644 --- a/system/modules/isotope/library/Isotope/Model/AttributeOption.php +++ b/system/modules/isotope/library/Isotope/Model/AttributeOption.php @@ -46,6 +46,19 @@ class AttributeOption extends \MultilingualModel */ protected static $strTable = 'tl_iso_attribute_option'; + /** + * Backwards compatibility with DC_Multi + * @return int + */ + public function getLanguageId() + { + if ($this instanceof Terminal42\DcMultilingualBundle\Model\MultilingualTrait) { + return parent::getLanguageId(); + } + + return $this->id; + } + /** * Get array representation of the attribute option * @@ -57,7 +70,7 @@ class AttributeOption extends \MultilingualModel public function getAsArray(IsotopeProduct $objProduct = null, $blnPriceInLabel = true) { return array( - 'value' => \method_exists($this, 'getLanguageId') ? $this->getLanguageId() : $this->id, + 'value' => $this->getLanguageId(), 'label' => $blnPriceInLabel ? $this->getLabel($objProduct) : $this->label, 'group' => 'group' === $this->type ? '1' : '', 'default' => $this->isDefault ? '1' : '',