고객이 자신의 제품을 만들고 해당 기능을 사용하도록 설정하기 전에 관리자가 승인 한 기능을 가진 모듈을 사용하여 frontend에서 magento 제품을 업데이트하는 데 문제가 있습니다 (이 부분이 작동 함).Magento 모듈에서 제품을 업데이트 할 수 없음
고객이 관리자 승인 제품을 업데이트하려고 시도하면 문제가 발생합니다 (승인 전과 같이 새로 생성 된 제품이 보류 중임을 나타내지 만 제품 작성 기능 중에 작성된 데이터/속성을 계속 업데이트 할 수 있음) 내가 승인/보류중인 고객 제품
public function editPostAction() {
$id = $this->getRequest()->getParam('productid');
if ($id !== false) {
list($data, $errors) = $this->validatePost();
if (!empty($errors)) {
foreach ($errors as $message) {
$this->_getSession()->addError($message);
}
$this->_redirect('customer/products/edit/', array(
'id' => $id
));
} else {
$customerId = $this->_getSession()->getCustomer()->getid();
$product = Mage::getResourceModel('customerpartner/customerpartner_product_collection')
->addAttributeToSelect('*')
->addAttributeToFilter('customer_id', $customerId)
->addAttributeToFilter('entity_id', $id)
->load()
->getFirstItem();
$product->setName($this->getRequest()->getParam('name'));
$product->setSku($this->getRequest()->getParam('sku'));
$product->setDescription($this->getRequest()->getParam('description'));
$product->setShortDescription($this->getRequest()->getParam('short_description'));
$product->setPrice($this->getRequest()->getParam('price'));
$product->setWeight($this->getRequest()->getParam('weight'));
$product->setStock($this->getRequest()->getParam('stock'));
$product->save();
if (isset($_FILES) && count($_FILES) > 0) {
foreach($_FILES as $image) {
if ($image['tmp_name'] != '') {
if (($error = $this->uploadImage($image, $id)) !== true) {
$errors[] = $error;
}
}
}
}
if (empty($errors)) {
$this->_getSession()->addSuccess($this->__('Your product was successfully updated'));
} else {
$this->_getSession()->addError('Product info was saved but was imposible to save the image');
foreach ($errors as $message) {
$this->_getSession()->addError($message);
}
}
$this->_redirect('customer/products/');
}
}
}
뿐만 아니라에 제출 양식을 업데이트 할 수있는 행동과 컨트롤러가 모든
먼저 컨트롤러)를 사용하여 업데이트되지 않은 것은을 업데이트 할 예정이다 제품 속성 및 이미지가 표시되지만 페이지가 제출시 다시로드되고 성공적으로 표시됩니다. 저장된 메시지가 있지만 속성이 업데이트되지 않고 해당 제품의 편집 양식 (각 제품에 대해 생성 된)으로 되돌아갑니다. 업데이트 양식의 값은 방금 제출 한 업데이트 값을 가지지 만 제품 속성은 카탈로그도 마찬가지입니다 (새 프로세스 작성시 입력 된 값과 동일하게 유지됩니다).
잘못된 작업을 계속 파악하거나 api 또는 direct SQL을 사용하여 작업을 완료하려면 이동하십시오.