Skip to content

Instantly share code, notes, and snippets.

@asifsomy
Forked from redesigned/functions.php
Last active August 29, 2015 14:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save asifsomy/908f6934ee416cf9a99c to your computer and use it in GitHub Desktop.
Save asifsomy/908f6934ee416cf9a99c to your computer and use it in GitHub Desktop.
Wordpress Magento Cross Integration
/* ===================================== */
/* Add This to Wordpress's /wp-content/yourtheme/functions.php file */
define('MAGENTO_ROOT', '/Volumes/Storage/www/heartandsun/store/');
define('MAGENTO_LOADER', MAGENTO_ROOT.'app/Mage.php');
if (!class_exists('Mage')) {
require_once(MAGENTO_LOADER);
umask(0);
Mage::app("default");
};
/* ===================================== */
/* ===================================== */
/* Add This to Magento's /index.php file */
if (strpos($_SERVER['REQUEST_URI'],'admin') == false && strpos($_SERVER['REQUEST_URI'],'media') == false) {
define('WORDPRESS_ROOT', '/home/thegreet/thegreetingfarm.com/html/staging/');
define('WORDPRESS_LOADER', WORDPRESS_ROOT.'wp-load.php');
require_once(WORDPRESS_LOADER);
};
/* ===================================== */
/* ===================================== *//*
// # Copy /app/code/core/Mage/Core/functions.php to /app/code/local/Mage/Core/functions.php
// # and wrap the __() function in an if_exists to prevent conflicts between both platforms
// # translator functions.
*//* ===================================== */
if (!function_exists('__')) {
function __() { return Mage::app()->getTranslator()->translate(func_get_args()); }
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment