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
  • Select an option

  • Save asifsomy/908f6934ee416cf9a99c to your computer and use it in GitHub Desktop.

Select an option

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 */
define('WORDPRESS_ROOT', '/Volumes/Storage/www/heartandsun/');
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()); }
};
Truncate table dataflow_batch_export;
Truncate table dataflow_batch_import;
Truncate table log_customer;
Truncate table log_quote;
Truncate table log_summary;
Truncate table log_summary_type;
Truncate table log_url;
Truncate table log_url_info;
Truncate table log_visitor;
Truncate table log_visitor_info;
Truncate table log_visitor_online;
Truncate table report_viewed_product_index;
Truncate table report_compared_product_index;
Truncate table report_event;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment