Image gallery problem

  • Posts: 28
  • Thank you received: 0
13 years 3 months ago #23030

My image gallery in product page is working fine, but when i change size for a product, gallery is messed up.

masina-shop.co.rs/index.php/product/show/261-cocaine

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

  • Posts: 82906
  • Thank you received: 13378
  • MODERATOR
13 years 3 months ago #23036

That's because you modified the CSS of the image generation code only for the main variant in the show file of the view product. You should also do them in the variants block of code near the middle of the file.

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

  • Posts: 28
  • Thank you received: 0
13 years 3 months ago #23054

I have fixed thumb display, but now i have another problem.

I used code from this thread www.hikashop.com/en/support/forum/4-how-...n-product-image.html to hide first thumb and replace it with second thumb. That is working fine, but when i change variant, the first thumb comes back again.

I also tried this code but that doesn't help.

For the variants, you need to add the line:
$variant->images = array_shift($variant->images);

after the line:
foreach($this->element->variants as $variant){

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

  • Posts: 82906
  • Thank you received: 13378
  • MODERATOR
13 years 3 months ago #23067

You should use
array_shift($variant->images);
and not
$variant->images = array_shift($variant->images);

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

  • Posts: 28
  • Thank you received: 0
13 years 3 months ago #24089

Now i started adding some variants to my products, but variants wont update. I found that the problem is modifications that i made in the show file.

This is the code that is causing problem:
array_shift($variant->images);

When i delete this line variations are displaying fine.

Is there a way to fix this.

Thanks

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

  • Posts: 82906
  • Thank you received: 13378
  • MODERATOR
13 years 3 months ago #24108

I don't know. That modification shouldn't produce any error. Are you sure that you didn't modify something else in the file ?
Do you have two images for your products/variants ?

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

  • Posts: 18
  • Thank you received: 0
13 years 2 weeks ago #29490

Last edit: 13 years 2 weeks ago by sdce. Reason: I moved the question. Wrong post thread.

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

Time to create page: 0.077 seconds
Powered by Kunena Forum