Product Id Automatically Set During Product Importing

Hi,

When I import products, I have added a column for Product ID. I have also added unique number for product as product ID. But when I import, instead of given ID, CS Cart automatically set another number as product id.

After importing products, I have to import product combinations. To import product combinations, I want to know the products ID. How I can manually set the products ID when I import products?

Thanks in advance...

app/schemas/exim/products.functions.php

Find the fn_import_unset_product_id function and replace:

    unset($object['product_id']);

with:

//    unset($object['product_id']);

Thanks @eComLabs for your help.

But it did not works.

I comment out that line and there is no any difference. Still my product IDs are different from CSV sheet.

I have attached my CSV file.

output_products_general.csv

Thanks @eComLabs for your help.

But it did not works.

I comment out that line and there is no any difference. Still my product IDs are different from CSV sheet.

I have attached my CSV file.

In russian thread support team advised to make the Product code column empty for all products in the feed. Try to test this solution. Note in this case you will not be able to import product codes

Hi;

Thank you @eComLabs for your great support.

I have contacted CS Cart support team and generated a ticket. It was 1 week ago. They said same solution.

So I have empty few Products Code in my csv sheet.. But that not works.

This is a part of default product import feature. I don't know how others do import on product variation in such cases because product ID is necessary for variation import.

output_products_general(1).csv

What was the answer of support team? Usually store owners use product code instead of product ID

Hi,

Last they replied that your first solution.

But that solution works now!. I don't know the reason. I have tried your solution first few times and I got error on the product ID.

Then I have generated a ticket and replied to you.

I don't know the issue. But I have tried and failed.

Any way, you are the real hero and you solved the issue.

We have to comment the following line in the app/schemas/exim/products.functions.php file:
unset($object['product_id']);

Thanks for your great support and I like to say sorry if I have wasted your valuable time. Please consider it as a beginner mistake.

Thank you for keeping us updated

Now I got a new database error on variation importing. The main products are importing with out any issues.

Variation product start to importing and automatically finish without completing. I have attached my csv sheet also.

Database (error)
error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '= ''' at line 1 (1064)
Query: SELECT company_id FROM cscart_products WHERE = ''

This is error from my log screen.

I have tried same CSV sheet on a fresh CS CART installation and there is no error. I believe that it may be issue with version.

So I have updated my store to latest cs cart version. But again I got same error.

Administration-Logs.png

output_variation_general.csv

Hi,

I have solved this issue.

The error due to updated function (fn_import_check_product_combination_company_id) in app/schemas/exim/product_combinations.functions.php.

I have updated this function by checking the new version of CS Cart and now the variation importing works with out any issue.