From 54b7fa6bae6cac9f5133afeb2b0cc7ccbbc3d59e Mon Sep 17 00:00:00 2001 From: yangwb1 <770260332@qq.com> Date: Thu, 27 Dec 2018 15:28:05 +0800 Subject: [PATCH] fix bundle products import issue: Field `parent_product_id` doesn not have a default value --- .../itemprocessors/bundle/limora_bundleprocessor.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/magmi/plugins/base/itemprocessors/bundle/limora_bundleprocessor.php b/magmi/plugins/base/itemprocessors/bundle/limora_bundleprocessor.php index e592c59e..cd46d778 100755 --- a/magmi/plugins/base/itemprocessors/bundle/limora_bundleprocessor.php +++ b/magmi/plugins/base/itemprocessors/bundle/limora_bundleprocessor.php @@ -163,9 +163,9 @@ protected function _createOptions($item, $params) if (!empty($option['title'])) { if (empty($existingOption['title'])) { - $sql = "INSERT INTO $optv (option_id, store_id, title) VALUES(:option_id, :store_id, :title)"; + $sql = "INSERT INTO $optv (option_id, store_id, title,parent_product_id) VALUES(:option_id, :store_id, :title, :parent_product_id)"; $bind = array('option_id'=>$option['option_id'],'store_id'=>$option['store_id'], - 'title'=>$option['title']); + 'title'=>$option['title'],'parent_product_id' => $option['parent_id']); $this->insert($sql, $bind); } elseif ($existingOption['title'] != $option['title']) { $sql = "UPDATE $optv SET title = :title WHERE option_id = :option_id AND store_id = :store_id"; @@ -181,13 +181,13 @@ protected function _createOptions($item, $params) $optionId = $this->insert($sql, $bind); $option['option_id'] = $optionId; - $sql = "INSERT INTO $optv (option_id, store_id, title) VALUES(:option_id, :store_id, :title)"; - $bind = array('option_id'=>$option['option_id'],'store_id'=>0,'title'=>$option['code']); + $sql = "INSERT INTO $optv (option_id, store_id, title, parent_product_id) VALUES(:option_id, :store_id, :title, :parent_product_id)"; + $bind = array('option_id'=>$option['option_id'],'store_id'=>0,'title'=>$option['code'],'parent_product_id' => $option['parent_id']); $this->insert($sql, $bind); if (!empty($option['title']) && $option['store_id'] != 0) { $bind = array('option_id'=>$option['option_id'],'store_id'=>$option['store_id'], - 'title'=>$option['title']); + 'title'=>$option['title'],'parent_product_id' => $option['parent_id']); $this->insert($sql, $bind); } }