Importing prices through CSV file deletes variants
- jameswadsworth
-
Topic Author
- Offline
Less
More
8 years 2 months ago #295544
by jameswadsworth
Importing prices through CSV file deletes variants was created by jameswadsworth
-- url of the page with the problem -- : joomla3xxx.lan
-- HikaShop version -- : 3.4.0\
-- Joomla version -- : 3.8.10
-- PHP version -- : 7.1
We have a load of products with variants loaded into hikashop. None of the variants have prices. We went to import a price using a CSV file to test for a single variant. The import went successfully. However the other product variants for which we didn't set a price have been deleted from the product table.
For example we have main product ABZ-515, and variants ABZ-515K, ABZ-151N, ABZ-151S before the import. We imported the following file:
product_code;price_value;price_access;product_type
ABZ-515K;25.00;,2,;variant
Now the variants ABZ-151N, ABZ-151S are not longer there. We've checked in the product table in the database and they have definitely been deleted. Are we missing something in the import configuration, or is that the expected behaviour. If the variant is not there, it will be deleted?
-- HikaShop version -- : 3.4.0\
-- Joomla version -- : 3.8.10
-- PHP version -- : 7.1
We have a load of products with variants loaded into hikashop. None of the variants have prices. We went to import a price using a CSV file to test for a single variant. The import went successfully. However the other product variants for which we didn't set a price have been deleted from the product table.
For example we have main product ABZ-515, and variants ABZ-515K, ABZ-151N, ABZ-151S before the import. We imported the following file:
product_code;price_value;price_access;product_type
ABZ-515K;25.00;,2,;variant
Now the variants ABZ-151N, ABZ-151S are not longer there. We've checked in the product table in the database and they have definitely been deleted. Are we missing something in the import configuration, or is that the expected behaviour. If the variant is not there, it will be deleted?
Please Log in or Create an account to join the conversation.
8 years 2 months ago #295571
by nicolas
Replied by nicolas on topic Importing prices through CSV file deletes variants
Hi,
The import area in Products>Imports is there to import whole products for big imports of data. So what you asked the import system to do is actually to update the variants of the main product of that variant so that only the variants listed in the CSV would be kept. And thus, it removed the ones not in the CSV.
If you want to update prices and not really do an import of products, it's better to use a mass action with a CSV import filter. This will handle products and variants as independent entities and will allow you to update their information without touching on the structure of the products. So with the CSV import of the mass actions, you won't be able to delete variants (for example, if you don't sell them anymore), but then, it won't remove them if you don't specify them in the CSV.
The import area in Products>Imports is there to import whole products for big imports of data. So what you asked the import system to do is actually to update the variants of the main product of that variant so that only the variants listed in the CSV would be kept. And thus, it removed the ones not in the CSV.
If you want to update prices and not really do an import of products, it's better to use a mass action with a CSV import filter. This will handle products and variants as independent entities and will allow you to update their information without touching on the structure of the products. So with the CSV import of the mass actions, you won't be able to delete variants (for example, if you don't sell them anymore), but then, it won't remove them if you don't specify them in the CSV.
The following user(s) said Thank You: jameswadsworth
Please Log in or Create an account to join the conversation.
- jameswadsworth
-
Topic Author
- Offline
8 years 2 months ago #295576
by jameswadsworth
Replied by jameswadsworth on topic Importing prices through CSV file deletes variants
All is clear. We will try with the mass actions. If we have any problems we'll come back here.
Please Log in or Create an account to join the conversation.
- jameswadsworth
-
Topic Author
- Offline
8 years 2 months ago #295616
by jameswadsworth
Replied by jameswadsworth on topic Importing prices through CSV file deletes variants
The import went fine. That data imported is correct. The only issue we saw was this warning:
Notice: Undefined property: stdClass::$price_currency_id in public_html/plugins/hikashop/massaction_product/massaction_product.php on line 531
Is this a problem with our CSV file?
Notice: Undefined property: stdClass::$price_currency_id in public_html/plugins/hikashop/massaction_product/massaction_product.php on line 531
Is this a problem with our CSV file?
Please Log in or Create an account to join the conversation.
8 years 2 months ago #295623
by nicolas
Replied by nicolas on topic Importing prices through CSV file deletes variants
Hi,
No, it's just a small warning you can ignore.
We'll fix that on our end.
No, it's just a small warning you can ignore.
We'll fix that on our end.
Please Log in or Create an account to join the conversation.
Time to create page: 0.181 seconds