[Skip to main content](#vessel-content)

#   Image gallery problem

##

- **[bora983](/forum/user/1981-bora983 "View bora983's Profile")**
- [![bora983's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/1981-bora983 "View bora983's Profile") Topic Author
- [ Offline](/forum/user/1981-bora983)

Less More

- Posts: 28
- Thank you received: 0
-
-

15 years 2 months ago [\#23030](#23030) by [bora983](/forum/user/1981-bora983 "View bora983's Profile")  *[Image gallery problem](/forum/4-how-to/23030-image-gallery-problem#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")* was created by *[bora983](/forum/user/1981-bora983 "View bora983's Profile")*

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](http://masina-shop.co.rs/index.php/product/show/261-cocaine)

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzIzMDMwLWltYWdlLWdhbGxlcnktcHJvYmxlbT90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86315
- Thank you received: 14274
-
-

15 years 2 months ago [\#23036](#23036) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Image gallery problem](/forum/4-how-to/23030-image-gallery-problem#23036 "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")*

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](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzIzMDMwLWltYWdlLWdhbGxlcnktcHJvYmxlbT90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[bora983](/forum/user/1981-bora983 "View bora983's Profile")**
- [![bora983's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/1981-bora983 "View bora983's Profile") Topic Author
- [ Offline](/forum/user/1981-bora983)

Less More

- Posts: 28
- Thank you received: 0
-
-

15 years 2 months ago [\#23054](#23054) by [bora983](/forum/user/1981-bora983 "View bora983's Profile")  Replied by *[bora983](/forum/user/1981-bora983 "View bora983's Profile")* on topic *[Re: Image gallery problem](/forum/4-how-to/23030-image-gallery-problem#23054 "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")*

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](http://www.hikashop.com/en/support/forum/4-how-to/15893-different-image-for-thumbnail-than-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-&gt;images = array_shift($variant-&gt;images);

after the line:
foreach($this-&gt;element-&gt;variants as $variant){

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzIzMDMwLWltYWdlLWdhbGxlcnktcHJvYmxlbT90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86315
- Thank you received: 14274
-
-

15 years 2 months ago [\#23067](#23067) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Image gallery problem](/forum/4-how-to/23030-image-gallery-problem#23067 "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")*

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

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzIzMDMwLWltYWdlLWdhbGxlcnktcHJvYmxlbT90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[bora983](/forum/user/1981-bora983 "View bora983's Profile")**
- [![bora983's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/1981-bora983 "View bora983's Profile") Topic Author
- [ Offline](/forum/user/1981-bora983)

Less More

- Posts: 28
- Thank you received: 0
-
-

15 years 2 months ago [\#24089](#24089) by [bora983](/forum/user/1981-bora983 "View bora983's Profile")  Replied by *[bora983](/forum/user/1981-bora983 "View bora983's Profile")* on topic *[Re: Image gallery problem](/forum/4-how-to/23030-image-gallery-problem#24089 "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")*

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-&gt;images);

When i delete this line variations are displaying fine.

Is there a way to fix this.

Thanks

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzIzMDMwLWltYWdlLWdhbGxlcnktcHJvYmxlbT90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86315
- Thank you received: 14274
-
-

15 years 2 months ago [\#24108](#24108) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Image gallery problem](/forum/4-how-to/23030-image-gallery-problem#24108 "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")*

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](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzIzMDMwLWltYWdlLWdhbGxlcnktcHJvYmxlbT90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[sdce](/forum/user/4494-sdce "View sdce's Profile")**
- [![sdce's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/4494-sdce "View sdce's Profile")
- [ Offline](/forum/user/4494-sdce)

Less More

- Posts: 18
- Thank you received: 0
-
-

14 years 11 months ago -  14 years 11 months ago [\#29490](#29490) by [sdce](/forum/user/4494-sdce "View sdce's Profile")  Replied by *[sdce](/forum/user/4494-sdce "View sdce's Profile")* on topic *[Re: Image gallery problem](/forum/4-how-to/23030-image-gallery-problem#29490 "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")*

Last edit: 14 years 11 months ago by [sdce](/forum/user/4494-sdce "View sdce's Profile"). Reason: I moved the question. Wrong post thread.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzIzMDMwLWltYWdlLWdhbGxlcnktcHJvYmxlbT90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop- Install &amp; Update- Product &amp; Category Display- Content Creation- Sales and Orders- - Orders management- - Reports &amp; Statistics- Customers- Checkout- Payment Methods- Shipping Methods- Import &amp; Export (CSV, XLS…)- Specific Features- - Affilation- - Taxes- - Wishlist- - Vote- - Carousel &amp; Slider- - Mass Actions- - Filters &amp; Search- - Discount &amp; Coupon- - Feature Request- Integrations- Showcase- General Talk about HikaShop- Development- - HikaShop 3.0 Beta- Translation- Commercial Jobs HikaShop Components- HikaMarket- - Market: Feature requests- - Market: How to?- - Market: Bug Report- HikaSerial- - General talk about HikaSerial- - Serial: Bug Report- - Serial: How to?- - Support en Français de HikaSerial (French Support)- - HikaSubscription- HikaAuction- - Auction: Feature requests- - Auction: How to?- - Auction: Bug report Hikashop around the world- Support en Français (French Support)- Russian- - FAQ. Курс выживания с Hikashop. Частые вопросы и о- - Расширения Hikashop- - Наши сайты на Hikashop- 日本語版サポート(Japanese Support)- Thai- German Archives- Bug Report- How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.144 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)

[](#top)
