0

I'm trying to set up a conditional action for shipping quotes in Ubercart. I need check the hour of day as a condition. I'm using the execute custom PHP condition. If the php returns true I just want the predicate to continue onto the actions. If it returns false I want it to stop. I tried:

    if (date('G') >14 && date('G') < 18){
       return true;
    }
    else{
       return false;
    }

When I tried this the shipping estimator just never delivered a quote.

Any ideas?

Charles
  • 50,943
  • 13
  • 104
  • 142
Eric
  • 17
  • 6
  • Have you checked to make sure that `date('G')` indeed returns a number between 15 and 17 inclusive? – Andreas Wong May 22 '12 at 02:23
  • I did, thank you. I manually set my timezone in php.ini . I ran a php file with just this code that would return some text to indicate that it was working. – Eric May 22 '12 at 05:28

1 Answers1

0

This code is correct. Problem must be somewhere else.

user1365013
  • 106
  • 4
  • You were right. The problem was in some of the other fine tunings. Once I knew that returning true or false was the proper method, it was easy to track down the real source. Thank you very much. I will say, it is strange that I could not find this documentation anywhere else. I hope others find this helpful. – Eric May 22 '12 at 05:49