Jump to content

matjash

Members
  • Posts

    14
  • Joined

  • Last visited

Community Answers

  1. matjash's post in Help with hook - auto translate module was marked as the answer   
    I've found the error:
    $translateTxt = $page->getLanguageValue("default", "opis"); //Problematic line
  2. matjash's post in Page on save:: copy field value into (hidden) field was marked as the answer   
    Thank you guys. In the meantime I found another solution which suits my need:
    public function init() { $this->addHookAfter('Pages::saveReady', $this, 'afterSaveReady'); } public function afterSaveReady($event) { // Get the soon to be saved page object from the given event $page = $event->arguments[0]; // Sample condition and changes if($page->template == "nepremicnine-vnos" && !$page->isTrash()){ //Price $cena = $page->cena; //Old price $stara = $page->cenaStara; $znizano = $page->znizano; //Checkbox to display old price, if not checked on save copy price to oldPrice if($znizano == 0) { $page->set("cenaStara", $cena); $page->save("cenaStara"); } } } } I will look into the way of track field changes. It seems usefull for future development.
×
×
  • Create New...