@@ -522,27 +522,28 @@ public function associatePdtPdt($association)
522
522
);
523
523
} elseif ((string ) $ association ->assocType == 3 ) {
524
524
$ preAssociatedArray [] = $ prid ;
525
- $ this ->_changeVisibility ($ prid );
525
+ $ this ->_hideVisibility ($ prid );
526
526
} elseif ((string ) $ association ->assocType == 4 ) {
527
527
$ bundleArray [] = $ prid ;
528
528
$ bundleQuantityArray [] = (int ) $ association ->quantity ;
529
529
$ bundlePositionArray [] = (int ) $ position ;
530
530
}
531
531
} elseif ($ prid && strtolower ((string ) $ association ->isActive ) == 'n ' ) {
532
- if ((string ) $ association ->assocType == 0 ) {
532
+ if ((string ) $ association ->assocType == 0 ) {
533
533
$ crossArray [$ prid ] = array (
534
534
'position ' => $ position
535
535
);
536
536
} elseif ((string ) $ association ->assocType == 1 ) {
537
- $ upsellArray [$ prid ] = array (
537
+ $ upsellArray [$ prid ] = array (
538
538
'position ' => $ position
539
539
);
540
540
} elseif ((string ) $ association ->assocType == 2 ) {
541
- $ relatedArray [$ prid ] = array (
541
+ $ relatedArray [$ prid ] = array (
542
542
'position ' => $ position
543
543
);
544
544
} elseif ((string ) $ association ->assocType == 3 ) {
545
- $ disAssociateArray [] = $ prid ;
545
+ $ disAssociateArray [] = $ prid ;
546
+ $ this ->_bothVisibility ($ prid );
546
547
}
547
548
}
548
549
}
@@ -2229,12 +2230,21 @@ private function _getMageId($attriextid)
2229
2230
return $ rowArray ['magento_id ' ];
2230
2231
}
2231
2232
2232
- private function _changeVisibility ($ proid )
2233
+ private function _hideVisibility ($ proid )
2233
2234
{
2234
2235
$ product = Mage::getModel ('catalog/product ' );
2235
2236
$ product ->load ($ proid );
2236
2237
$ product ->setVisibility (Mage_Catalog_Model_Product_Visibility::VISIBILITY_NOT_VISIBLE );
2237
2238
$ product ->save ();
2238
2239
}
2240
+
2241
+ private function _bothVisibility ($ proid )
2242
+ {
2243
+ $ product = Mage::getModel ('catalog/product ' );
2244
+ $ product ->load ($ proid );
2245
+ $ product ->setVisibility (Mage_Catalog_Model_Product_Visibility::VISIBILITY_BOTH );
2246
+ $ product ->save ();
2247
+ }
2248
+
2239
2249
}
2240
2250
?>
0 commit comments