Jump to content

Please assist with provide discount before certain date only


Jeniveve

Recommended Posts

I asked this once b4 and the answer seemed to work but now the discount is being caclulated again...I wanted the discount to stop after April 15...The below code doesn't work, can someone help???

}
       if(date("j") < 14) {
            $before = $cost*.05;
            $before = round($before,2);
            $cost = $cost-$before;
        }

 

Thank you in advance for ANY help that can be provided.  :happy-03:

Jennifer

Link to comment
Share on other sites

I just plugged this into a script and it calculates full cost. Today date("j") is '28', so I don't see why you should have any issue with that script today. Based on the code you provided the discount would start again on May 1. 

 

What do you get if you echo date("j") from your server? Could the date on the server be incorrect??

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.