Omega Posted September 11, 2011 Share Posted September 11, 2011 Hi I am able to import my cfv file and it shows up in my store, but there a few problems. 1. When I click on an image to to see the product, its says that there are no products in this catagory 2. For some reason, some catagories show and others do not. I use open office to edit, but I dont know what the original format was. Any help appriciated. I have seen the other threads, but I can not seem to make sense of the template. Link to comment Share on other sites More sharing options...
Optim'Informatique Posted September 12, 2011 Share Posted September 12, 2011 Have you a categories column in you csv ? Have you check your products categories after the import ? Which version do you use ? Link to comment Share on other sites More sharing options...
Omega Posted September 12, 2011 Author Share Posted September 12, 2011 I am using Prestashop 1.4.4.1 To give you an idea of what I am trying to import See below. After the import, only a few of the catagories are populated. Link to comment Share on other sites More sharing options...
Optim'Informatique Posted September 13, 2011 Share Posted September 13, 2011 OK. One of my client had a similar problem on 1.4.3, there was a bug in the import, categories where changes if not set in the csv file. I guess you have the same problem. I don't know if it is exactly the same code in 1.4.4.1 but you can try these modifications in AdminImport.php public function productImport() { global $cookie; $this->receiveTab(); $handle = $this->openCsvFile(); $defaultLanguageId = (int)(Configuration::get('PS_LANG_DEFAULT')); self::setLocale(); for ($current_line = 0; $line = fgetcsv($handle, MAX_LINE_SIZE, Tools::getValue('separator')); $current_line++) { if (Tools::getValue('convert')) $line = $this->utf8_encode_array($line); $info = self::getMaskedRow($line); if (array_key_exists('id', $info) AND (int)($info['id']) AND Product::existsInDatabase((int)($info['id']))) { $product = new Product((int)($info['id'])); $categoryData = Product::getProductCategories((int)($product->id)); //DEBUG_OPTIMINFO // foreach ($categoryData as $tmp) // $product->category[] = $tmp['id_category']; //get default category : one product, one default cat $def_sql = 'SELECT id_category_default FROM '._DB_PREFIX_.'product WHERE id_product='.$product->id; $def_cat = Db::getInstance()->ExecuteS($def_sql); $product->id_category_default = $def_cat[0]['id_category_default']; $product->id_category[] = $def_cat[0]['id_category_default']; $cat_sql = 'SELECT id_category FROM '._DB_PREFIX_.'category_product WHERE id_product='.$product->id; $cat_order = Db::getInstance()->ExecuteS($cat_sql); foreach($cat_order AS $cat){ $product->id_category[] = $cat['id_category']; } //END OPTIMINFO } else $product = new Product(); I Hope this will help you. Link to comment Share on other sites More sharing options...
Omega Posted September 13, 2011 Author Share Posted September 13, 2011 Thanks for the help and information. This is a bit too advanced for me, so I guess I had better staert to manually input the items. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now