(컨트롤러에서) Magento 맞춤 모듈의 코딩을 사용하여 제품 가시성을 변경하고 싶습니다. 나는 코드 아래에서 노력하고 있지만 가시성은 변경되지 않는다.Magento에서 프로그래밍 방식으로 제품 가시성을 변경하는 방법
올바른 방법을 제안하십시오.
$relContact = Mage::getModel('catalog/category/indexer/product')->getCollection();
Mage::register('isSecureArea', true);
foreach ($relContact as $product) {
try {
$product->setVisibility(Mage_Catalog_Model_Product_Visibility::VISIBILITY_NOT_VISIBLE);
//$product->setVisiblity(VISIBILITY_NOT_VISIBLE);
} catch(Exception $e) {
echo "Product #".$product->getId()." Visiblity could not be changed: ".$e->getMessage();
}
프런트 엔드에서이 제품을 숨기기/숨기기 해제했지만 관리 패널 제품 가시성 값이 변경되지 않았습니까? 그렇게 할 수있는 방법이 있습니다. –
새 제품을 추가하거나 기존 제품을 업데이트 하시겠습니까? – sudhakar
기존 제품 업데이트 중. –