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

#   Custom field Ajax image resize

##

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

Less More

- Posts: 431
- Thank you received: 22
-

6 years 4 months ago [\#320498](#320498) by [mojweb](/forum/user/5128-mojweb "View mojweb's Profile")  *[Custom field Ajax image resize](/forum/26-product-category-display/900118-custom-field-ajax-image-resize#320498 "-- HikaShop version -- : 4.3  Hello I have this code in product view  First field is custom image, second is custom text. Image is resized to 100x100. What code to use for biger image, say 150x150?")* was created by *[mojweb](/forum/user/5128-mojweb "View mojweb's Profile")*

-- HikaShop version -- : 4.3

Hello
I have this code in product view Code:

&lt;?php if(!empty($this-&gt;element-&gt;autorfoto)) { $fieldClass = hikashop_get('class.field'); $field = $fieldClass-&gt;getField('autorfoto', 'product'); echo '&lt;div class="col-sm-2 avtorphot"&gt;' . $fieldClass-&gt;show($field,$this-&gt;element-&gt;autorfoto) . '&lt;/div&gt;'; } if(!empty($this-&gt;element-&gt;autortext)) { echo '&lt;div class="col-sm-10 avtortekst"&gt;' . $this-&gt;element-&gt;autortext . '&lt;/div&gt;'; } ?&gt;

First field is custom image, second is custom text. Image is resized to 100x100. What code to use for biger image, say 150x150?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS85MDAxMTgtY3VzdG9tLWZpZWxkLWFqYXgtaW1hZ2UtcmVzaXplP3RtcGw9bWFya2Rvd24=) or [Create an account](/register) 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?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86322
- Thank you received: 14281
-
-

6 years 4 months ago [\#320505](#320505) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Custom field Ajax image resize](/forum/26-product-category-display/900118-custom-field-ajax-image-resize#320505 "-- HikaShop version -- : 4.3  Hello I have this code in product view  First field is custom image, second is custom text. Image is resized to 100x100. What code to use for biger image, say 150x150?")*

Hi,

Supposing that the type of the custom field is "ajax image", you can change the line: Code:

echo '&lt;div class="col-sm-2 avtorphot"&gt;' . $fieldClass-&gt;show($field,$this-&gt;element-&gt;autorfoto) . '&lt;/div&gt;';

to:
Code:

echo '&lt;div class="col-sm-2 avtorphot"&gt;' . str_replace(array('thumbnail_x=100','thumbnail_y=100'), array('thumbnail_x=150','thumbnail_y=150'), $fieldClass-&gt;show($field,$this-&gt;element-&gt;autorfoto)) . '&lt;/div&gt;';

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS85MDAxMTgtY3VzdG9tLWZpZWxkLWFqYXgtaW1hZ2UtcmVzaXplP3RtcGw9bWFya2Rvd24=) or [Create an account](/register) to join the conversation.

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

Less More

- Posts: 431
- Thank you received: 22
-

6 years 4 months ago [\#320563](#320563) by [mojweb](/forum/user/5128-mojweb "View mojweb's Profile")  Replied by *[mojweb](/forum/user/5128-mojweb "View mojweb's Profile")* on topic *[Custom field Ajax image resize](/forum/26-product-category-display/900118-custom-field-ajax-image-resize#320563 "-- HikaShop version -- : 4.3  Hello I have this code in product view  First field is custom image, second is custom text. Image is resized to 100x100. What code to use for biger image, say 150x150?")*

Sorry, no change.
Cleared cache, uploaded new image...

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS85MDAxMTgtY3VzdG9tLWZpZWxkLWFqYXgtaW1hZ2UtcmVzaXplP3RtcGw9bWFya2Rvd24=) or [Create an account](/register) 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?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86322
- Thank you received: 14281
-
-

6 years 4 months ago [\#320565](#320565) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Custom field Ajax image resize](/forum/26-product-category-display/900118-custom-field-ajax-image-resize#320565 "-- HikaShop version -- : 4.3  Hello I have this code in product view  First field is custom image, second is custom text. Image is resized to 100x100. What code to use for biger image, say 150x150?")*

Hi,

Try like that then, as you might have SEF on: Code:

echo '&lt;div class="col-sm-2 avtorphot"&gt;' . str_replace(array('thumbnail_x=100','thumbnail_y=100','thumbnail_x-100','thumbnail_y-100'), array('thumbnail_x=150','thumbnail_y=150','thumbnail_x-150','thumbnail_y-150'), $fieldClass-&gt;show($field,$this-&gt;element-&gt;autorfoto)) . '&lt;/div&gt;';

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS85MDAxMTgtY3VzdG9tLWZpZWxkLWFqYXgtaW1hZ2UtcmVzaXplP3RtcGw9bWFya2Rvd24=) or [Create an account](/register) to join the conversation.

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

Less More

- Posts: 431
- Thank you received: 22
-

6 years 2 months ago [\#322821](#322821) by [mojweb](/forum/user/5128-mojweb "View mojweb's Profile")  Replied by *[mojweb](/forum/user/5128-mojweb "View mojweb's Profile")* on topic *[Custom field Ajax image resize](/forum/26-product-category-display/900118-custom-field-ajax-image-resize#322821 "-- HikaShop version -- : 4.3  Hello I have this code in product view  First field is custom image, second is custom text. Image is resized to 100x100. What code to use for biger image, say 150x150?")*

Sory still no change.
With inspector I see html Code:

&lt;img class="" src="/zc/order/download/field_table-product/field_namekey-YXV0b3Jmb3Rv/name-a2V6ZWxlLmpwZWc=/thumbnail_x-190/thumbnail_y-190" alt="keze.jpeg"&gt;

But image is 100px.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS85MDAxMTgtY3VzdG9tLWZpZWxkLWFqYXgtaW1hZ2UtcmVzaXplP3RtcGw9bWFya2Rvd24=) or [Create an account](/register) 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?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86322
- Thank you received: 14281
-
-

6 years 2 months ago [\#322826](#322826) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Custom field Ajax image resize](/forum/26-product-category-display/900118-custom-field-ajax-image-resize#322826 "-- HikaShop version -- : 4.3  Hello I have this code in product view  First field is custom image, second is custom text. Image is resized to 100x100. What code to use for biger image, say 150x150?")*

Hi,

Then it means that the image itself is smaller than 190*190. The system will only resize down the uploaded image if it is bigger than the size specified in the parameters of the URL. OR, the image is actually resized to 190*190 and you have CSS on that area which has the browser resize the image to 100*100 dynamically when displaying the image.
I can't say for sure without looking at the page itself and checking myself with the inspector of my browser.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS85MDAxMTgtY3VzdG9tLWZpZWxkLWFqYXgtaW1hZ2UtcmVzaXplP3RtcGw9bWFya2Rvd24=) or [Create an account](/register) to join the conversation.

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

Less More

- Posts: 431
- Thank you received: 22
-

6 years 2 months ago -  6 years 2 months ago [\#322831](#322831) by [mojweb](/forum/user/5128-mojweb "View mojweb's Profile")  Replied by *[mojweb](/forum/user/5128-mojweb "View mojweb's Profile")* on topic *[Custom field Ajax image resize](/forum/26-product-category-display/900118-custom-field-ajax-image-resize#322831 "-- HikaShop version -- : 4.3  Hello I have this code in product view  First field is custom image, second is custom text. Image is resized to 100x100. What code to use for biger image, say 150x150?")*

I uploaded 600px image. So must be some resize problem.

Last edit: 6 years 2 months ago by [mojweb](/forum/user/5128-mojweb "View mojweb's Profile"). Reason: link removal

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS85MDAxMTgtY3VzdG9tLWZpZWxkLWFqYXgtaW1hZ2UtcmVzaXplP3RtcGw9bWFya2Rvd24=) or [Create an account](/register) 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?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86322
- Thank you received: 14281
-
-

6 years 2 months ago [\#322859](#322859) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Custom field Ajax image resize](/forum/26-product-category-display/900118-custom-field-ajax-image-resize#322859 "-- HikaShop version -- : 4.3  Hello I have this code in product view  First field is custom image, second is custom text. Image is resized to 100x100. What code to use for biger image, say 150x150?")*

Hi,

Thanks for the link. I think I've found the problem.
The thumbnail size parameters in the URL of custom ajax image fields where not properly taken into account.
Please download again the install package of HikaShop on our website and install it on yours and it will add a patch which should make it work properly.

The following user(s) said Thank You: [mojweb](/forum/user/5128-mojweb "View mojweb's Profile")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS85MDAxMTgtY3VzdG9tLWZpZWxkLWFqYXgtaW1hZ2UtcmVzaXplP3RtcGw9bWFya2Rvd24=) or [Create an account](/register) to join the conversation.

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

Less More

- Posts: 431
- Thank you received: 22
-

6 years 2 months ago [\#323110](#323110) by [mojweb](/forum/user/5128-mojweb "View mojweb's Profile")  Replied by *[mojweb](/forum/user/5128-mojweb "View mojweb's Profile")* on topic *[Custom field Ajax image resize](/forum/26-product-category-display/900118-custom-field-ajax-image-resize#323110 "-- HikaShop version -- : 4.3  Hello I have this code in product view  First field is custom image, second is custom text. Image is resized to 100x100. What code to use for biger image, say 150x150?")*

Now is ok.
Thank you

The following user(s) said Thank You: [Philip](/forum/user/34318-philip "View Philip's Profile")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS85MDAxMTgtY3VzdG9tLWZpZWxkLWFqYXgtaW1hZ2UtcmVzaXplP3RtcGw9bWFya2Rvd24=) or [Create an account](/register) 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.134 seconds

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