Loading


Advertisement:

Author Topic: New and old item description value from database  (Read 124 times)

p206ab

  • Full Member
  • ***
  • Posts: 225
  • No one will read this text with Cameron above :)
New and old item description value from database
« on: January 11, 2017, 05:36:29 pm »
Does anyone know if there is a function or helper to bring both values when listing is edited?
I'm using More edit, which notifies me via email once a listing was edited, but it only displays new item description and I have no idea what was modified, either only price or something inside text / images etc.
And since my website is multilanguage, I need to adjust other language descriptions manually, so it would be really useful it something like this exists, so I don't need to translate the whole text again if only the price was changed etc...

Any ideas?
Thanks!

MB Themes

  • Hero Member
  • *****
  • Posts: 4063
  • Frosticek here :)
Re: New and old item description value from database
« Reply #1 on: January 11, 2017, 08:29:19 pm »
@p206ab
You could catch it via hooks before listing is edited and stored into database (so in 1 hand you have old data from database, in 2nd hand you have new data from parameters).
But you need to take a look on hooks which one will fit to this.

Liath

  • Sr. Member
  • ****
  • Posts: 478
  • #Kurt_Cobain { margin-bottom: -6.5ft; }
Re: New and old item description value from database
« Reply #2 on: January 11, 2017, 09:33:43 pm »
there is'nt any hook to catch the sended params before they are written to the database. I think you need a plugin to do the job and catch it via



Code: [Select]
$data = Params:getParamsAsArray();
$editedID = $data['fk_i_item_id'];
after this you have to get the title/descrition for this $editedID and compare it with the sended values...


not tested, just my thought

p206ab

  • Full Member
  • ***
  • Posts: 225
  • No one will read this text with Cameron above :)
Re: New and old item description value from database
« Reply #3 on: January 11, 2017, 10:19:32 pm »
Interesting thoughts, thanks, I will build on that.. :)

_CONEJO

  • Administrator
  • Hero Member
  • *****
  • Posts: 4437
Re: New and old item description value from database
« Reply #4 on: January 11, 2017, 11:45:15 pm »
Why using getPAramsAsArray if you could get the value directly by getParam? which is better and safer? as getParam will not throw any error if the key does not exists, but accessing $data['key'] could