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

#   Understand how product images get updated

##

- **[PeterChain](/forum/user/570-peterchain "View PeterChain's Profile")**
- [![PeterChain's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar570.png)](/forum/user/570-peterchain "View PeterChain's Profile") Topic Author
- [ Offline](/forum/user/570-peterchain)

Less More

- Posts: 640
- Thank you received: 16
-
-

8 years 9 months ago [\#288500](#288500) by [PeterChain](/forum/user/570-peterchain "View PeterChain's Profile")  *[Understand how product images get updated](/forum/23-market-how-to/893901-understand-how-product-images-get-updated#288500 "-- HikaShop version -- : 3.3 -- HikaMarket version -- : 2.0.1 -- Joomla version -- : 3.8.5 -- PHP version -- : 7.1  I am developing a way to handle duplicated images with different names in a product.  I made some algorithm that executes after clicking Save or Apply in the hikamarket product form.  I run this code on the event trigger OnAfterUpdate but I apparently find that any change in the images box where images can be deleted, uploaded or reordered is not yet reflected at that point  so my code is processing images not under the changes the user has made but on how images were before entering to edit the product.  At least this is how it looks to me, is like the reordering, deletion and creation of images in the table ' hikashop&#95;files' is made after the execution of trigger OnAfterUpdate.  Am I right?  Victor.")* was created by *[PeterChain](/forum/user/570-peterchain "View PeterChain's Profile")*

-- HikaShop version -- : 3.3
-- HikaMarket version -- : 2.0.1
-- Joomla version -- : 3.8.5
-- PHP version -- : 7.1

I am developing a way to handle duplicated images with different names in a product.

I made some algorithm that executes after clicking Save or Apply in the hikamarket product form.

I run this code on the event trigger OnAfterUpdate but I apparently find that any change in the images box where images can be deleted, uploaded or reordered is not yet reflected at that point

so my code is processing images not under the changes the user has made but on how images were before entering to edit the product.

At least this is how it looks to me, is like the reordering, deletion and creation of images in the table ' hikashop_files' is made after the execution of trigger OnAfterUpdate.

Am I right?

Victor.

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

- **[Jerome](/forum/user/80-jerome "View Jerome's Profile")**
- [![Jerome's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar80.png)](/forum/user/80-jerome "View Jerome's Profile")
- [ Offline](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26401
- Thank you received: 4081
-
- [](http://obsi.dev)
-

8 years 9 months ago [\#288510](#288510) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Understand how product images get updated](/forum/23-market-how-to/893901-understand-how-product-images-get-updated#288510 "-- HikaShop version -- : 3.3 -- HikaMarket version -- : 2.0.1 -- Joomla version -- : 3.8.5 -- PHP version -- : 7.1  I am developing a way to handle duplicated images with different names in a product.  I made some algorithm that executes after clicking Save or Apply in the hikamarket product form.  I run this code on the event trigger OnAfterUpdate but I apparently find that any change in the images box where images can be deleted, uploaded or reordered is not yet reflected at that point  so my code is processing images not under the changes the user has made but on how images were before entering to edit the product.  At least this is how it looks to me, is like the reordering, deletion and creation of images in the table ' hikashop&#95;files' is made after the execution of trigger OnAfterUpdate.  Am I right?  Victor.")*

Hello,

The way that HikaMarket handle the product is the same than HikaShop is handling the products.
Using the HikaShop trigger "onAfterProductUpdate", you will get the same content from HikaShop than from HikaMarket ; but depending the HikaMarket ACL, the product could have less data (for what the vendor cannot access).
Regarding the images ; they are processed after the trigger by the HikaShop core (same for HikaMarket).
You can see the code in "backSaveForm" or "frontSaveForm" (depending if you're in HikaShop or HikaMarket).
First will call : Code:

$this-&gt;updateFiles($product, $status, 'images', $product-&gt;imagesorder);

And the second will call : Code:

$productClass-&gt;updateFiles($product, $status, 'images', $product-&gt;imagesorder);

(where productClass is the HikaShop product class ; so the exact same function is called).

Regards,

---

Jerome - Obsidev.com
HikaMarket &amp; HikaSerial developer / HikaShop core dev team.

The following user(s) said Thank You: [PeterChain](/forum/user/570-peterchain "View PeterChain's Profile")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzIzLW1hcmtldC1ob3ctdG8vODkzOTAxLXVuZGVyc3RhbmQtaG93LXByb2R1Y3QtaW1hZ2VzLWdldC11cGRhdGVkP3RtcGw9bWFya2Rvd24=) 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?

Moderators: [Obsidev](/forum/user/7040-obsidev "View Obsidev's Profile")

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

Time to create page: 0.054 seconds

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