CSV Import mandatory columns?

  • Posts: 52
  • Thank you received: 0
  • Hikashop Business
9 years 3 months ago #209401

-- HikaShop version -- : 2.5.0
-- Joomla version -- : 3.4.3
-- PHP version -- : 5.3.15

I'm importing products using the CSV import option. I do NEVER include all the columns in the CSV file, only the ones that have some information.
I've noticed that when importing VARIANTS, if I do not include the column "product_tax_id" in the csv file, the value is automatically filled in with the default tax id. If I create the variants manually through the back-end, the "product_tax_id" column has value of "0". I guess this is the correct value for variants, not the default tax id.

My question: WHAT ARE THE MANDATORY FIELDS, WHEN IMPORTING CSV FILE, IN ORDER TO MAKE SURE THEY ARE NOT FILLED IN AUTOMATICALLY WITH INCORRECT VALUES?

P.S. I also noticed a little mess in the "fx904_hikashop_variant" table when importing variants with CSV file. Could you please explain about the ordering column in that table? When the values are not 0?

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

  • Posts: 52
  • Thank you received: 0
  • Hikashop Business
9 years 3 months ago #209422

I believe I figured out the "fx904_hikashop_variant" table.
The ORDERING field determines how are the characteristics groups /not values/ ordered both in the back-end and in the front end. There is dedicated option in the configuration for the characteristics values order - the values in the front-end drop down combo box.

The initial question about mandatory fields in the csv file still remains???

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

  • Posts: 13201
  • Thank you received: 2322
9 years 3 months ago #209409

Hi,

The product_tax_id field should not be a mandatory field. It takes the values set by default in Configuration > Main > Taxes.
This tax id should not be used for the variants, but get the parent tax id, is the taxed price incorrect when selecting a variant on frontend ?

Regarding the ordering, you're right that's indeed the goal.

Last edit: 9 years 3 months ago by Xavier.

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

  • Posts: 52
  • Thank you received: 0
  • Hikashop Business
9 years 3 months ago #209677

Hi Xavier,
The price on the front-end is correct in both cases. I believe there is a little bug in the code when importing CSV - the tax id field should always be zero for variants, or it should report an error message.

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
9 years 3 months ago #209683

Hi,

Thank you for the feedback.
You can add the code:

else{
			//the variants should not have a tax id.
			$product->product_tax_id = 0;
		}
after the code:
if($product->product_type=='main'){
			if(!empty($product->product_parent_id)){
				$app = JFactory::getApplication();
				$app->enqueueMessage('The product '.@$product->product_code.' should have an empty value instead of the value '.$product->product_parent_id.' in the field product_parent_id as it is a main product (not a variant) and thus doesn\'t have any parent.','error');
			}
		}
in the file administrator/components/com_hikashop/helpers/import.php and that should do it.

The following user(s) said Thank You: ydingilski

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

Time to create page: 0.070 seconds
Powered by Kunena Forum