Updating variant product data

  • Posts: 250
  • Thank you received: 7
11 years 1 month ago #125066

All the physical products in my store are represented by variants. I want to use the import system to update variant details, in particular product_width and product_length but will also want to use this to update price.

I have prepared a csv file with product_id and the fields that takes this form ...

product_id,product_width,product_length
110,914.4,9144
111,1066.8,9144
93,1066.8,9144

But when I import I get this message ...

The product is of the type but it already exists in the database and is of the type variant. In order to avoid any problem the product insertion process has been skipped. Please correct its type before trying to reimport it.

There are a number of posts with problems regarding importing variants and the answer seems to be that the parent product has to be included in the csv file but I can't find anything that tells me how. Do I have to add a product_parent_id column to the csv file, or how else does it work?

Many thanks,

Ian

Please Log in or Create an account to join the conversation.

  • Posts: 13201
  • Thank you received: 2322
11 years 1 month ago #125089

Hi,

Actually, the best way to edit the products / variants is to use the mass actions via the menu System > Massaction.
It allow you to filter the elements, and update their values easily.

Here is some documentation:
www.hikashop.com/support/2013-08-08-00-1...massaction-form.html

Last edit: 11 years 1 month ago by Xavier. Reason: giving documentation link

Please Log in or Create an account to join the conversation.

  • Posts: 250
  • Thank you received: 7
11 years 1 month ago #125105

Hi,

Thanks for the prompt reply, and mass actions look like a really powerful feature, but it doesn't really answer my question.

I have a csv file with a list of product ids and their respective dimensions (Length and width) - these dimensions are different for each product so mass actions wouldn't be appropriate. The mass actions documentation talks about triggering a csv import but there doesn't seem to be an option to actually do this, maybe this has been replaced by the cron function?

Anyway I am concerned now that when I come to update my product prices, which I was planning to do from a csv file triggered by cron, the file will be rejected because the products are variants. So can anyone answer my original question, how do I import product data from a csv file when the product ids are all for variants?

Many thanks,

Ian

Please Log in or Create an account to join the conversation.

  • Posts: 13201
  • Thank you received: 2322
11 years 1 month ago #125161

Hi,

I come back with my mass actions :)
In the mass actions, you can select the filter "CSV products" and check the option "Save the products on Mass Action csv import.". This should update your products.

Please Log in or Create an account to join the conversation.

  • Posts: 250
  • Thank you received: 7
11 years 1 month ago #125231

Ok, the documentation is a bit thin on how this works but I think I get it now, but unless I am misunderstanding something there would appear to be a couple of bugs.

I have configured a mass action to import my csv and and "save the products on Mass Action csv import "as you suggest, I have then set the action to Display the results. There are two problems, one is that I get a notice that a number of lines can not be imported saying the product doesn't exist when in fact if I look at the database it does.

The other problem is the results output is showing the same value for width length and height when in fact these values are different. The results page also lists some of the products which the import said don't exist, highlighted in red on the attached screenshot.

I hope you can explain / address these issues.

Many thanks for the support.

Ian

Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 13201
  • Thank you received: 2322
11 years 1 month ago #125367

Hi,

Thanks to give us your csv file in order to see if it's well formatted.

And a backend + ftp access in order to debug that problem.

Please Log in or Create an account to join the conversation.

  • Posts: 250
  • Thank you received: 7
11 years 1 month ago #125371

Thanks for the reply. Annoyingly my broadband connection is down today. I'll pm you the details as soon as I am reconnected.

Ian

Please Log in or Create an account to join the conversation.

  • Posts: 250
  • Thank you received: 7
11 years 1 month ago #125377

Hi,

My broadband connection is back, so attached is the csv file which was designed to update the product_width and product_length for variants. I've sent site login details and ftp via a private message.

Many thanks for your help,

Ian

Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 13201
  • Thank you received: 2322
11 years 1 month ago #125701

Hi,

I have reproduced the bug on my end, so I have debugged it on local.
It will be in the new package of HikaShop which should be uploaded for tomorrow, thanks to download it from our website, it will still have the version 2.2.2

The following user(s) said Thank You: iedwards

Please Log in or Create an account to join the conversation.

  • Posts: 250
  • Thank you received: 7
11 years 1 month ago #125856

Hi Xavier,

Thank you for the update, that has fixed the display issue but I still have the problem on csv import that I am getting a notice that says some products can not be found when they do actually exist, they are even listed in the report at the end of the mass action.

See attached screen shot. The red crosses mark lines in the notice that I think are incorrect as the products do exist.



I have attached the csv file I am using and will also pm you login details to the site on my development server as these have changed.

Thanks again for the excellent support.

Ian

Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 13201
  • Thank you received: 2322
11 years 1 month ago #125859

Hi,

Have you tried without the double quotes in the csv file ? (for the columns name)

Please Log in or Create an account to join the conversation.

  • Posts: 250
  • Thank you received: 7
11 years 1 month ago #125861

Yes, I have. Originally I didn't use the quotes but had the same problem. It's odd because I get errors up to product_id 16 then the other 500 or so products are fine. I was wondering if the fact that some products are missing is causing a flag to be set that isn't reset but there doesn't seem to be any pattern to it.

Ian

Last edit: 11 years 1 month ago by iedwards.

Please Log in or Create an account to join the conversation.

  • Posts: 13201
  • Thank you received: 2322
11 years 1 month ago #126050

Hi,

Thanks for your reports, it allow us to improve our features.

I have corrected many things about this importCsv, this will be in the next release.
To correct it now, thanks to replace the function "getFromFile()" in "administrator/components/com_hikashop/classes/massaction.php" by:

	function getFromFile($element, $check = false){
		$data = new stdClass();
		$app = JFactory::getApplication();
		// get the elements from the file
		$importHelper = hikashop_get('helper.import');
		$importFile = array();
		$elts = explode('/',$element['path']);
		if($elts == null) return false;
		$nb = count($elts);
		if($nb == 1){
			$elts = explode('\\',$element['path']);
			$nb = count($elts);
		}

		if(!file_exists($element['path'])){
			if(!$check)$app->enqueueMessage(JText::sprintf( 'NO_FILE_FOUND',$element['path']), 'error');
			$data->error = 'not_found';
			return $data;
		}

		hikashop_increasePerf();
		$contentFile = @file_get_contents($element['path']);
		if(!$contentFile){
			if(!$check)$app->enqueueMessage(JText::sprintf( 'FAIL_OPEN',$element['path']), 'error');
			$data->error = 'fail_open';
			return $data;
		};

		$contentFile = str_replace(array("\r\n","\r"),"\n",$contentFile);
		$contentFile = strip_tags($contentFile);
		$importLines = explode("\n", $contentFile);
		$importLines = str_replace('"','',$importLines);

		// Get the columns
		$columns = str_replace('"','',$importLines[0]);
		$listSeparators = array(';',',','|',"\t");
		$separator = ';';
		foreach($listSeparators as $sep){
			if(preg_match('#(?!\\\\)'.$sep.'#',$columns)){
				$separator = $sep;
				$columns=str_replace($sep,'|',$columns);
				break;
			}
		}
		unset($importLines[0]);

		if(empty($importLines)){
			if(!$check)$app->enqueueMessage('EMPTY','error');
			$data->error = 'empty';
			return $data;
		}

		$columns = explode('|',$columns);
		$numberColumns = count($columns);

		// Check if the columns exists in db
		$db = JFactory::getDBO();
		if(!HIKASHOP_J25) {
			$tmp = $db->getTableFields(hikashop_table('product'));
			$productColumns = reset($tmp);
			unset($tmp);
			$tmp = $db->getTableFields(hikashop_table('price'));
			$priceColumns = reset($tmp);
			unset($tmp);
		} else {
			$productColumns = $db->getTableColumns(hikashop_table('product'));
			$priceColumns = $db->getTableColumns(hikashop_table('price'));
		}
		$db->setQuery('SELECT characteristic_value FROM '.hikashop_table('characteristic').' WHERE characteristic_parent_id = 0');
		$characteristicColumns = $db->loadResultArray();
		$categoryColumns = array('categories_ordering','parent_category','categories_image','categories');
		$otherColumns = array('files','images','related','options');
		if(!is_array($characteristicColumns)) $characteristicColumns = array($characteristicColumns);
		$mergedColumns = array_merge(array_keys($productColumns),array_keys($priceColumns),$categoryColumns,$characteristicColumns,$otherColumns);
		$wrongColumns = array_diff($columns,$mergedColumns);


		if(!empty($wrongColumns) && $check){
			if(!$check)$app->enqueueMessage('WRONG_COLUMNS','error');
			$data->wrongColumns = $wrongColumns;
			$data->validColumns = $mergedColumns;
			$data->error = 'wrong_columns';
			return $data;
		}elseif($check){
			$data->error = 'valid';
			return $data;
		}

		// Change the column if the column in the csv is wrong and set in parameters, else delete this column
		if(isset($element['change']) && is_array($element['change'])){
			foreach($columns as $num => $column){
				foreach($element['change'] as $key => $value){
					if($column == $key && $value != 'delete'){
						$columns[$num] = $value;
					}
					elseif($column == $key && $value == 'delete'){
						unset($columns[$num]);
					}
				}
			}
		}

		// Get the missing product_code / product_id
		$pool = array();
		$missingIds = array();
		$missingCodes = array();
		foreach($importLines as $key => $importLine){
			$product = $this->getProduct($importLines, $key, $numberColumns, $separator);
			if(!is_array($product)) continue;
			$newProduct = new stdClass();
			foreach($product as $num => $value){
				if(!empty($columns[$num])){
					$field = $columns[$num];
					if( strpos('|',$field) !== false ) { $field = str_replace('|','__tr__',$field); }
					//$newProduct->$field = trim($value,'\'" ');
					$newProduct->$field = preg_replace('#^[\'" ]{1}(.*)[\'" ]{1}$#','$1',$value);
				}
			}
			$pool[$key] = new stdClass();
			if(isset($newProduct->product_id)){
				$pool[$key]->product_id = $newProduct->product_id;
			}
			if(isset($newProduct->product_code)){
				$pool[$key]->product_code = $newProduct->product_code;
			}
			if(!isset($pool[$key]->product_id) && !isset($pool[$key]->product_code)){
				continue;
			}
			if(!isset($pool[$key]->product_code)){
				$missingCodes[] = $pool[$key]->product_id;
			}
			if(!isset($pool[$key]->product_id)){
				$missingIds[] = $pool[$key]->product_code;
			}
		}

		$missing = array();
		if(!empty($missingCodes)){
			$db->setQuery('SELECT * FROM '.hikashop_table('product').' WHERE product_id IN ('.implode(',',$missingCodes).')');
			$missingCodes = $db->loadObjectList();
		}
		if(!empty($missingIds)){
			$db->setQuery('SELECT * FROM '.hikashop_table('product').' WHERE product_code IN ('.implode(',',$db->quote($missingIds)).')');
			$missingIds = $db->loadObjectList();
		}

		$errorcount = 0;
		$importProducts = array();
		foreach($importLines as $key => $importLine){
			$product = $this->getProduct($importLines, $key, $numberColumns, $separator);

			if(!is_array($product)) continue;
			$newProduct = new stdClass();
			foreach($product as $num => $value){
				if(!empty($columns[$num])){
					$field = $columns[$num];
					if( strpos('|',$field) !== false ) { $field = str_replace('|','__tr__',$field); }
					//$newProduct->$field = trim($value,'\'" ');
					$newProduct->$field = preg_replace('#^[\'" ]{1}(.*)[\'" ]{1}$#','$1',$value);
				}
			}

			// need the product code and the product id
			if(empty($newProduct->product_id)){
				foreach($missingIds as $missingId){
					if($newProduct->product_code == $missingId->product_code){
						$newProduct->product_id = $missingId->product_id;
					}
				}
			}
			if(empty($newProduct->product_code)){
				foreach($missingCodes as $missingCode){
					if($newProduct->product_id == $missingCode->product_id){
						$newProduct->product_code = $missingCode->product_code;
					}
				}
			}

			if(empty($newProduct->product_code) || empty($newProduct->product_id)){
				$errorcount++;
				if($errorcount<20){
					if(isset($importLine[$key-1]))$app->enqueueMessage(JText::sprintf('IMPORT_ERRORLINE',$importLines[$key-1]).' '.JText::_('PRODUCT_NOT_FOUND'),'notice');
				}elseif($errorcount == 20){
					$app->enqueueMessage('...','notice');
				}
			}else{
				$importProducts[$newProduct->product_id] = $newProduct;
				$ids[] = $newProduct->product_id;
			}
		}
		$data->ids = $ids;
		$data->elements = $importProducts;

		return $data;
	}

And the function "onProcessProductMassFiltercsvImport" in "plugins/plg_hikashop_massaction_product/massaction_product.php" by:
	function onProcessProductMassFiltercsvImport(&$elements,&$query,$filter,$num){
		if(empty($filter['type']) || $filter['type']=='all') return;
		if(!isset($this->massaction))$this->massaction = hikashop_get('class.massaction');
		if(count($elements)){
			foreach($elements as $k => $element){
				if($element->$filter['type']!=$filter['value']) unset($elements[$k]);
			}
		}else{
			$data = $this->massaction->getFromFile($filter);
			if(empty($data->ids) || isset($data->error))
				return false;

			JArrayHelper::toInteger($data->ids);
			$db = JFactory::getDBO();

			$productClass = hikashop_get('class.product');
			$productClass->getProducts($data->ids);

			// Get all the product code - id - parent_id in the csv
			$pool = array();
			foreach($data->ids as $i => $id){
				if(!isset($data->elements[$id]->product_id) || !isset($data->elements[$id]->product_code) || !isset($data->elements[$id]->product_parent_id)) continue;
				$pool[$data->elements[$id]->product_code] = array();
				$pool[$data->elements[$id]->product_code]['id'] = $data->elements[$id]->product_id;
				$pool[$data->elements[$id]->product_code]['parent_id'] = $data->elements[$id]->product_parent_id;
			}
			// Get all the missing product parent id
			$toGet = array();
			foreach($data->ids as $i => $id){
				if(isset($data->elements[$id]->product_parent_id) && $data->elements[$id]->product_parent_id != '' && (int)$data->elements[$id]->product_parent_id == 0 && !in_array($data->elements[$id]->product_parent_id,$pool) && !in_array($data->elements[$id]->product_parent_id,$toGet)){
					$toGet[] = $data->elements[$id]->product_parent_id;
				}
			}
			// Select all the missing product parent id
			$db->setQuery('SELECT * FROM '.hikashop_table('product').' WHERE product_code IN (\''.implode('\',\'',$toGet).'\')');
			$gets = $db->loadObjectList();
			foreach($gets as $get){
				$pool[$get->product_code]['id'] = $get->product_id;
				$pool[$get->product_code]['parent_id'] = $get->product_parent_id;
			}

			if(!is_array($data->ids)) $data->ids = array($data->ids);

			foreach($data->ids as $i => $id){
				if(!isset($data->elements[$id])) continue;
				$data->elements[$id]->product_id = (int)$data->elements[$id]->product_id;

				if(isset($data->elements[$id]->product_type) && $data->elements[$id]->product_type == 'variant' && (int)$data->elements[$id]->product_parent_id == 0){
					if(array_key_exists($data->elements[$id]->product_parent_id,$pool)){
						$data->elements[$id]->product_parent_id = $pool[$data->elements[$id]->product_parent_id]['id'];
					}else{
						continue;
					}
				}

				$oldElement = $productClass->all_products[$id];

				// Manage the prices
				if(!empty($data->elements[$id]->price_value)){
					$data->elements[$id]->prices = array();
					$price_values = explode('|',$data->elements[$id]->price_value);
					$price_currencies = explode('|',$data->elements[$id]->price_currency_id);
					$price_min_quantities = explode('|',$data->elements[$id]->price_min_quantity);
					$price_accesses = explode('|',$data->elements[$id]->price_access);
					foreach($price_values as $k => $price_value){
						$data->elements[$id]->prices[$k] = new stdClass();
						$data->elements[$id]->prices[$k]->price_value = $price_value;
					}
					foreach($price_currencies as $k => $price_currency){
						if(!is_int($price_currency)){
							$db->setQuery('SELECT currency_id FROM '.hikashop_table('currency').' WHERE currency_code LIKE '.$db->quote($price_currency));
							$price_currency_id = $db->loadResult();
						}
						$data->elements[$id]->prices[$k]->price_currency_id = $price_currency_id;
					}
					foreach($price_min_quantities as $k => $price_min_quantity){
						$data->elements[$id]->prices[$k]->price_min_quantity = $price_min_quantity;
					}
					foreach($price_accesses as $k => $price_access){
						$price_access_clean = str_replace(',','',$price_access);
						$data->elements[$id]->prices[$k]->price_access = $price_access_clean;
					}
				}
				unset($data->elements[$id]->price_value);
				unset($data->elements[$id]->price_currency_id);
				unset($data->elements[$id]->price_min_quantity);
				unset($data->elements[$id]->price_access);

				// Manage the files
				if(!empty($data->elements[$id]->files)){
					$newFiles = explode(';',$data->elements[$id]->files);
					$data->elements[$id]->files = array();
					foreach($newFiles as $k => $newFile){
						$same = 0;
						foreach($oldElement->files as $oldFile){
							if($oldFile->file_path == $newFile){
								$data->elements[$id]->files[] = $oldFile->file_id;
								$same = 1;
							}
						}
						if(!empty($newFile) && $same == 0){
							$db->setQuery('SELECT file_id FROM '.hikashop_table('file').' WHERE file_path LIKE '.$db->quote($newFile));
							$newFileId = $db->loadResult();
							if(!empty($newFileId))
								$data->elements[$id]->files[] = $newFileId;
						}
					}
				}
				// Manage the images
				if(!empty($data->elements[$id]->images)){
					$newImages = explode(';',$data->elements[$id]->images);
					$data->elements[$id]->images = array();
					foreach($newImages as $k => $newImage){
						$same = 0;
						foreach($oldElement->images as $oldImage){
							if(!empty($newImage) && $oldImage->file_path == $newImage){
								$data->elements[$id]->images[] = $oldImage->file_id;
								$same = 1;
							}
						}
						if(!empty($newImage) && $same == 0){
							$db->setQuery('SELECT file_id FROM '.hikashop_table('file').' WHERE file_path LIKE '.$db->quote($newImage));
							$newImageId = $db->loadResult();
							if(!empty($newImageId))
								$data->elements[$id]->images[] = $newImageId;
						}
					}
				}
				// Manage the categories
				if(!empty($data->elements[$id]->categories)){
					$categories = explode(';',$data->elements[$id]->categories);

					$data->elements[$id]->categories = array();
					foreach($categories as $category){
						$db->setQuery('SELECT category_id FROM '.hikashop_table('category').' WHERE category_name LIKE '.$db->quote($category));
						$data->elements[$id]->categories[] = $db->loadResult();
					}
					unset($oldElement->categories);
				}
				if(!empty($data->elements[$id]->categories_ordering)){
					$data->elements[$id]->categories_ordering = explode(';',$data->elements[$id]->categories_ordering);
					unset($oldElement->categories_ordering);
				}
				// Manage the relateds
				if(!empty($data->elements[$id]->related)){
					$relateds = explode(';',$data->elements[$id]->related);
					$data->elements[$id]->related = array();
					foreach($relateds as $k => $related){
						$db->setQuery('SELECT product_id FROM '.hikashop_table('product').' WHERE product_code LIKE '.$db->quote($related));
						$data->elements[$id]->related[$k]->product_related_id = $db->loadResult();
						$data->elements[$id]->related[$k]->product_id = $id;
						$data->elements[$id]->related[$k]->product_related_ordering = $k;
						$data->elements[$id]->related[$k]->product_related_type = 'related';
					}
				}
				// Manage the options
				if(!empty($data->elements[$id]->options)){
					$options = explode(';',$data->elements[$id]->options);
					$data->elements[$id]->options = array();
					foreach($options as $option){
						$db->setQuery('SELECT product_id FROM '.hikashop_table('product').' WHERE product_code LIKE '.$db->quote($option));
						$data->elements[$id]->options[$k]->product_related_id = $db->loadResult();
						$data->elements[$id]->options[$k]->product_id = $id;
						$data->elements[$id]->options[$k]->product_related_ordering = $k;
						$data->elements[$id]->options[$k]->product_related_type = 'related';
					}
				}
				unset($oldElement->images);
				unset($oldElement->files);
				unset($oldElement->related);
				unset($oldElement->options);
				// Replace the old values in the oldElement becoming the element
				foreach($oldElement as $k => $old){
					foreach($data->elements[$id] as $l => $new){
						if($k == $l){
							$oldElement->$k = $new;
						}
					}

				}
				$data->elements[$id] = $oldElement;

				// Save the elements if checkbox checked
				if(isset($filter['save'])){
					if(isset($data->elements[$id]->prices))
						$productClass->updatePrices($data->elements[$id],$id);
					if($data->elements[$id]->product_type!='variant')
						$productClass->updateCategories($data->elements[$id],$id);
					if(!empty($data->elements[$id]->files))
						$productClass->updateFiles($data->elements[$id],$id,'files');
					if(!empty($data->elements[$id]->images))
						$productClass->updateFiles($data->elements[$id],$id,'images');
					if(!empty($data->elements[$id]->related))
						$productClass->updateRelated($data->elements[$id],$id,'related');
					if(!empty($data->elements[$id]->options))
						$productClass->updateRelated($data->elements[$id],$id,'options');

					// unset all the vars which are not in the product table
					$db->setQuery('SHOW columns FROM '.hikashop_table('product'));
					$cols = $db->loadObjectList();
					$fields = array();
					foreach($cols as $col){
						$fields[] = $col->Field;
					}
					foreach($data->elements[$id] as $l => $content){
						if(!in_array($l,$fields)){
							unset($data->elements[$id]->$l);
						}
					}
					if(isset($data->elements[$id]->product_created) && (int)$data->elements[$id]->product_created == 0){
						unset($data->elements[$id]->product_created);
					}
					$data->elements[$id]->product_modified = time();
					$data->elements[$id]->product_width = str_replace($data->elements[$id]->product_dimension_unit,'',$data->elements[$id]->product_width);
					$data->elements[$id]->product_length = str_replace($data->elements[$id]->product_dimension_unit,'',$data->elements[$id]->product_length);
					$data->elements[$id]->product_height = str_replace($data->elements[$id]->product_dimension_unit,'',$data->elements[$id]->product_height);

					$elements = $data->elements;

					// Save the new data of the product
					$productClass->save($elements[$id]);
				}
			}
			// Get all the products but the ones in the csv file
			if($filter['type'] == 'out'){
				JArrayHelper::toInteger($data->ids);
				$db->setQuery('SELECT product_id FROM '.hikashop_table('product').' WHERE product_id NOT IN ('.implode(',',$data->ids).')');
				$ids = $db->loadResultArray();
				$productClass = hikashop_get('class.product');
				$elements = array();
				foreach($ids as $id){
					$elements[] = $productClass->get($id);
				}
			}
		}
	}

The following user(s) said Thank You: iedwards

Please Log in or Create an account to join the conversation.

  • Posts: 250
  • Thank you received: 7
11 years 1 month ago #126061

Thank you very much Xavier, that seems to have solved the problem.

First rate support, it is very reassuring to know that you guys will fix any issues so promptly.

Ian

Please Log in or Create an account to join the conversation.

  • Posts: 250
  • Thank you received: 7
11 years 1 month ago #128924

I have run into another problem importing product data from a csv file.

I want to update the product images across the shop as the manufacturer has changed the package designs.

I have a csv file which has two columns 'product_code' and 'images', the images column contains the file names of the new product images all of which have all been copied to the hikashop "uploads" folder.

If I try an import via the Products | Import i get this message that I have complained of before ...

The product is of the type but it already exists in the database and is of the type variant. In order to avoid any problem the product insertion process has been skipped. Please correct its type before trying to reimport it.


The advice previously (see the rest of this topic) was to use the Mass Actions facility which worked with what I was trying to do before but doesn't in this instance.

UPDATE: I have found that importing the csv via mass actions added the product info to the root product category, so it created new products with the product code and image supplied rather than updating the existing products.

Can the issue of importing csv data for variants be fixed please? In other words can the logic that causes the import to be skipped for variants be over ridden because it's not helping!

Many thanks,

Ian

Last edit: 11 years 1 month ago by iedwards. Reason: Added update about the result of mass import

Please Log in or Create an account to join the conversation.

  • Posts: 13201
  • Thank you received: 2322
11 years 1 month ago #129066

Hi,

It seems that when we just have "product_code;images" and importing the csv via the product import feature it delete the existing product and create a new one in the main category.

I have added it to debug on our TODO list.

Thanks to try to add the column "product_name" it seems to be working with that column.

Last edit: 11 years 1 month ago by Xavier.

Please Log in or Create an account to join the conversation.

  • Posts: 250
  • Thank you received: 7
11 years 1 month ago #129117

Unfortunately I can't use product name as variants take the name of the parent product (several variants with the same name), it's only the product_code that is unique.

Will you make it so that I can update variants as well please?

Thank you.

Ian

Last edit: 11 years 1 month ago by iedwards.

Please Log in or Create an account to join the conversation.

  • Posts: 13201
  • Thank you received: 2322
11 years 1 month ago #129172

And what about using the product_id too ?

Please Log in or Create an account to join the conversation.

  • Posts: 250
  • Thank you received: 7
11 years 1 month ago #129191

The product data comes from the manufacturer who supplies me with the product_code and images but he doesn't know the product_id which is internal to Hikashop.

Please Log in or Create an account to join the conversation.

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
11 years 4 weeks ago #129652

Then, instead, you can try to use the normal import of products and add the "product_type" column with the value "variant" for all the entries in your CSV and that will consider them as variants.
I would recommend to do a backup before trying that in case something goes wrong.

The following user(s) said Thank You: iedwards

Please Log in or Create an account to join the conversation.

Time to create page: 0.115 seconds
Powered by Kunena Forum