Importing prices through CSV file deletes variants

  • Posts: 272
  • Thank you received: 3
5 years 9 months ago #295544

-- 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?

Attachments:

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

  • Posts: 81484
  • Thank you received: 13062
  • MODERATOR
5 years 8 months ago #295571

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 following user(s) said Thank You: jameswadsworth

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

  • Posts: 272
  • Thank you received: 3
5 years 8 months ago #295576

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.

  • Posts: 272
  • Thank you received: 3
5 years 8 months ago #295616

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?

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

  • Posts: 81484
  • Thank you received: 13062
  • MODERATOR
5 years 8 months ago #295623

Hi,

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.064 seconds
Powered by Kunena Forum