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?

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.