View Single Post
  #1  
Old 03-09-2011, 10:13 PM
 
Kamran Khan Kamran Khan is offline
 

Newbie
  
Join Date: Mar 2011
Posts: 3
 

Default where can I add my own functions?

Hey Guys,

I'm kind of lost here.

I need to integrate the header and footer of a wordpress blog into x-cart and so far I have landed into a lot of problems despite succeeding.

So after two days I have given up and would really like someone to lead me into the right direction.

Firstly, where exactly am I supposed to add PHP codes that I can later on put into the templates inside my x-cart? I have no idea where to locate the file.

I decided to do all my coding inside smarty.php located in the main folder; and this worked, at first. However, I realised 12 hours later that this makes most things give out a 500 server error.

So, if I add this chunk of code:
Code:
define('WP_USE_THEMES', false); require('../wordpress/wp-load.php'); // TO GET THE WORDPRESS HEADER ob_start(); get_template_part( 'navigation' ); $wordpress_header = ob_get_contents(); ob_end_clean(); ob_start(); get_template_part( 'stylesheet' ); $wordpress_stylesheet = ob_get_contents(); ob_end_clean(); $smarty->assign('wordpress_header', $wordpress_header); $smarty->assign('wordpress_stylesheet', $wordpress_stylesheet);

upon calling {$wordpress_header} inside a tpl file, I get the right header, but most things break (by giving 500 internal server errors).

Is it because these extra things I need shouldn't be implemented inside smarty.php? And if not, where exactly should I do such coding for my website?

I'm using the 4.4.2 version of x-cart
__________________
4.2.4 pro
Reply With Quote