0

I need to create a CMS page that will update information at specific times. E.g.: If now is 1pm, the page will display information X. If now is 2pm, the page will display information Y.

I created a PHP file with this code echo Mage::getModel('core/date')->date() that returns my current date and time, but if I try to call this via AJAX to update my page, I got a "Forbidden error".

I read that to call PHP file using AJAX in Magento I need to create a new module (references here and here), but since I never created a module before and this page will be used just for 1 day; I don't think is worthy creating a new module (I am assuming would take me some time to do that).

Any ideas of how I could dynamically get my Magento time zone to use in an HTML page?

asked Nov 11, 2016 at 18:28
0

1 Answer 1

0

I ended up just using a time API (https://timezonedb.com/) and setting my AJAX request to this API instead of using Magento functions.

answered Dec 14, 2016 at 19:17

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.