Products after import

  • Posts: 30
  • Thank you received: 1
4 years 4 months ago #325722

-- HikaShop version -- : 4.4.0
-- Joomla version -- : 3.9.22

Hello,

I've a problem with export and import products.

When i export products and use the exact same file as import, the product characteristics are messed up.
These are suddenly shown with an image (which is not linked to it) and a description) that is not there.
These are then taken over from the product itself. This does not happen with all products and characteristics

Kind regards,
Matthijs

Attachments:

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

  • Posts: 83404
  • Thank you received: 13498
  • MODERATOR
4 years 4 months ago #325727

Hi,

Do you see the images linked to the variants in the backend too when you edit a variant under the variants tab of the product edition screen ?
And we would also need a copy of the CSV as well as a link to the page where you made that screenshot to check on the situation.

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

  • Posts: 30
  • Thank you received: 1
4 years 4 months ago #325749

HI,

No, these are not visible in the back-end.
In the appendix the export.
I can give the link to the site, but it is not "open" to the public yet because we have to solve this first.
Can I provide data to you somewhere without everyone being able to see it?

Kind Regards,
Matthijs

Attachments:

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

  • Posts: 83404
  • Thank you received: 13498
  • MODERATOR
4 years 4 months ago #325760

Hi,

If the images are not in the variants in the backend, then it's not an import issue.
Normally, there is a mechanism on the product details page to check if the variants have different images and if they do, the images column is displayed on the variants listing, and for variants without images, the system uses the images of the main product on the fly.
So what that means is that you must have at least one variant with an image, or that there is a problem in the view displaying the variants listing. It might come from an old view override.
So we'll need a backend access to check the variants and a link to a product page with the issue to check the situation.
You can provide that in private along with a link to this thread via our contact form:
www.hikashop.com/support/contact-us.html

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

  • Posts: 30
  • Thank you received: 1
4 years 4 months ago #325781

Hi ,

It happens after the import, before the import the data was right/

I have emailed login details via the contact form.
You can try it yourself by exporting the product S1402-D and then importing it again.
I've made a backup, so you can try whatever you want :)

Kind regards,
Matthijs

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

  • Posts: 83404
  • Thank you received: 13498
  • MODERATOR
4 years 4 months ago #325798

Hi,

I've run some tests on your website and as I expected the issue is with the mechanism on the product details page to check if the variants have different images.
After the import, you end up in an edge case of that algorithm for one of the variant.
So I made a patch to it so that it properly handle that edge case.
I've added the patch on your website and on our end.
So I can confirm it now displays fine on your website after the import, and we'll have that patch on our end for the next version of HikaShop too.

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

  • Posts: 30
  • Thank you received: 1
4 years 3 months ago #326018

HI,

That works!!! Thank you very much!!!

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

  • Posts: 30
  • Thank you received: 1
4 years 3 months ago #327196

HI,

The problem is back. Can you provide the patch, so I can install it?

Greetz

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

  • Posts: 83404
  • Thank you received: 13498
  • MODERATOR
4 years 3 months ago #327208

Hi,

You need to change the code:

foreach($this->element->variants as $variant) {
				foreach($display as $k => $v) {
					if(isset($variant->$k) && !is_array($variant->$k) && !empty($variant->$k))
						$display[$k] = true;
				}
				$variant_images = '';
				if(!empty($this->element->main->images) && !empty($variant->images)) {
					foreach($variant->images as $image) {
						$variant_images .= '|' . $image->file_path;
					}
				}
				if($variant_images != $main_images)
					$display['images'] = true;
				$variant_prices = '';
				if(!empty($variant->prices)) {
					foreach($variant->prices as $price) {
						$variant_prices .= '|' . $price->price_value . '_' . $price->price_currency_id;
					}
				}
				if($variant_prices!=$main_prices)
					$display['prices'] = true;
			}
to:
foreach($this->element->variants as $variant) {
				if(!empty($variant->variant_name))
					$display['variant_name'] = true;

				if(!empty($variant->product_description) && $variant->product_description != $this->element->main->product_description)
					$display['product_description'] = true;

				if(!empty($variant->images)) {
					$variant_images = '';
					foreach($variant->images as $image) {
						$variant_images .= '|' . $image->file_path;
					}
					if($variant_images != $main_images)
						$display['images'] = true;
				}
				if(!empty($variant->prices)) {
					$variant_prices = '';
					foreach($variant->prices as $price) {
						$variant_prices .= '|' . $price->price_value . '_' . $price->price_currency_id;
					}
					if($variant_prices!=$main_prices)
						$display['prices'] = true;
				}
			}
in components/com_hikashop/views/product/view.html.php

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

Time to create page: 0.076 seconds
Powered by Kunena Forum