src/ShopBundle/objects/TCMSTableEditor/TCMSShopTableEditor_ShopArticle.class.php
public function Insert()
    {
        if ($this->isNewVariant()) {
            $this->sId = $this->sRestriction;
            $variant = $this->DatabaseCopy();
            /** @var TdbShopArticle $product */
            $product = $this->oTable;
            if (!$product->fieldActive) {
                $variantTableEditor = TTools::GetTableEditorManager('shop_article', $variant->id);
                $variantTableEditor->SaveField('variant_parent_is_active', '0');
            }
        } else {
            parent::Insert();
        }
    }
public function Insert()
    {
        if ($this->isNewVariant()) {
            $this->sId = $this->sRestriction;
            $variant = $this->DatabaseCopy();
            /** @var TdbShopArticle $product */
            $product = $this->oTable;
            if (!$product->fieldActive) {
                $variantTableEditor = TTools::GetTableEditorManager('shop_article', $variant->id);
                $variantTableEditor->SaveField('variant_parent_is_active', '0');
            }
        } else {
            parent::Insert();
        }
    }
public function Insert ( ) { if ( $ this -> isNewVariant ( ) ) { $ this -> sId = $ this -> sRestriction ; $ variant = $ this -> DatabaseCopy ( ) ; /** @var TdbShopArticle $product */ $ product = $ this -> oTable ; if ( ! $ product -> fieldActive ) { $ variantTableEditor = TTools :: GetTableEditorManager ( 'shop_article' , $ variant -> id ) ; $ variantTableEditor -> SaveField ( 'variant_parent_is_active' , '0' ) ; } } else { parent :: Insert ( ) ; } }
we overwrite the insert method, so that when inserting variants, we realy perform
a copy of the parent.
we overwrite the insert method so that when inserting variants we realy perform a copy of the parent .