I have a table in the database which contains some dates. I want to disable those dates in magento default calendar. The calendar is in front-end checkout process (used to add delivery date for the order). Any suggestions will be appreciated.
I'm using Magento CE 1.7
Best Answer
Have not done this myself, so this is a guide to get you in the right direction.
the calendar used by magento is located here : /js/calendar/calendar.js, and from its header comments, you will find it is done by http://www.dynarch.com/, and the docs is located here : http://www.dynarch.com/jscal
You will see there is built in functionality (via a callback) to disable dates. (http://www.dynarch.com/jscal/#sec8)
(sound just like what you want/have ;) )
To extend magento calendar creation, you need to create your own class, which extends the core
Varien_Data_Form_Element_Date
class, which will allow you to adjust the setup for the calendar, and include your dates. You will need to override thegetElementHtml()
method, which contains the calandar setup script code.and include the callback and dates you have, as per the calendar docs.
I am not sure how you are displaying the calendars in your site, but one way to use the custom class in a form is to create a custom form element as such:
Hope this helps you in the right direction.