Google Chart over ssl in magento admin

Share

Turning on ssl in magento admin pages requires extra effort.

Magento uses google chart to generate order diagrams making requests to http://chart.apis.google.com/chart.

Up until now google apis can’t use ssl, but now there is a possibility – https://chart.googleapis.com/chart. So all we have to do is to overwrite Mage_Adminhtml_Block_Dashboard_Graph class, which is responsible for charts generation.

Touching core files is a very bad practice, so we copy some files:

1
2
3
cp \
app/code/core/Mage/Adminhtml/Block/Dashboard/Graph.php \
app/code/local/Mage/Adminhtml/Block/Dashboard/

Here we use old hack where local files have higher priorities than core ones.
Finally we edit app/code/local/Mage/Adminhtml/Block/Dashboard/Graph.php:

1
const API_URL = '//chart.googleapis.com/chart';

Comments are closed.