Jon Posted January 25, 2016 Share Posted January 25, 2016 Hello, I seem to have having a problem the save hook. I would like to field value based another field during the save process. But my values are not updating 13 seems to be enter no matter what and $vessels doesn't save updates. The code I am using is the following. <?php $this->pages->addHookAfter('saveReady', null, 'cruiseSpaces'); function cruiseSpaces($event) { $page = $event->arguments[0]; if($page->template != 'cruise-dates') return; $vessel = $page->cruise_vessel; if($vessel = 2) { $page->set("cruise_spaces", 13); }else{ $page->set("cruise_spaces", 10); } } Any ideas where Iam going wrong? Link to comment Share on other sites More sharing options...
matjazp Posted January 25, 2016 Share Posted January 25, 2016 if($vessel == 2) { 3 Link to comment Share on other sites More sharing options...
Jon Posted January 25, 2016 Author Share Posted January 25, 2016 Ah Thank you very much! Iam such a PHP newbie! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now