Skip to main content

Image gallery problem

More
15 years 1 month ago #23030 by bora983
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.

More
15 years 1 month ago #23036 by nicolas
Replied by nicolas on topic Re: Image gallery problem
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.

More
15 years 1 month ago #23054 by bora983
Replied by bora983 on topic Re: Image gallery problem
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.

More
15 years 1 month ago #23067 by nicolas
Replied by nicolas on topic Re: Image gallery problem
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.

More
15 years 1 month ago #24089 by bora983
Replied by bora983 on topic Re: Image gallery problem
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.

More
15 years 1 month ago #24108 by nicolas
Replied by nicolas on topic Re: Image gallery problem
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.

More
14 years 10 months ago - 14 years 10 months ago #29490 by sdce
Replied by sdce on topic Re: Image gallery problem
Last edit: 14 years 10 months 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.208 seconds
Powered by Kunena Forum