chineseboy Posted October 13, 2009 Share Posted October 13, 2009 ]Hi. I have my store within a 'store' subdirectory. I want to include certain things like the shopping cart on all of the pages on my site, including those outside of the 'store' directory. I've tried doing this as a server side include but it doesn't work. I've included the config.inc.php and the init. php in the head of the page and the file I've included in the body is the cart.php. Are these the correct files? What is it that I'm actually doing wrong? I've tried using an iframe and that hasn't worked either. I would really appreciate help with this because I cant seem to find any information on it anywhere. Thanks in advance.Daniel Link to comment Share on other sites More sharing options...
Iamcaptain Posted October 14, 2009 Share Posted October 14, 2009 I'm fairly sure you can't have the cart working outside of the root directory of it, if you want the shopping cart outside of 'store', you need to install it outside of 'store'. Link to comment Share on other sites More sharing options...
chineseboy Posted October 14, 2009 Author Share Posted October 14, 2009 Thanks for the tip. Do you know how i would go about maintaining the session id of the customer as they move around the pages of my site outside of the 'store'? Also do you know which files need to be installed outside of the 'store' for the shopping cart to work on other pages? Thanks Link to comment Share on other sites More sharing options...
ruilong Posted October 14, 2009 Share Posted October 14, 2009 if you mean the small little cart block then that would be modules/blockcart, but i think you need to initialize the entire class system also to get that to work.. Link to comment Share on other sites More sharing options...
chineseboy Posted October 14, 2009 Author Share Posted October 14, 2009 Yeah, basically i want the customer to be able to view how many items they have in their basket on any page in the site, even outside of the actual store. Sorry to be a nuisance but how i go about initialising the class system? Sorry if i'm being dumb! Nice pic btw ruilong! Link to comment Share on other sites More sharing options...
A-Z Hosting Posted October 20, 2010 Share Posted October 20, 2010 Looks like it has been awhile since you were interested in this, but I will bump it just for more feedback on it. I created this little "minicart.php" which seems to work ok. Can't yet get the ajax smooth up down portion to work yet but haven't given that arrow much thought. It's a very rough option but it does work. <?php require_once(dirname(__FILE__).'/config/config.inc.php'); require_once(dirname(__FILE__).'/init.php'); ?> [removed] var baseDir = ''; var static_token = ''; var token = ''; [removed] <? include(_PS_MODULE_DIR_.'/blockcart/blockcart-ajax.php'); ?> <? $smarty->display(dirname(__FILE__).'/modules/blockcart/blockcart.tpl'); ?> Would love to add those baseDir, static_token and token variables but just having them declared gets rid of any errors. Like I said "rough" but bare with me I have only been working with prestashop code for about a week now off and on.FYI the removed portions in the code above were the opening and closing script tags. Link to comment Share on other sites More sharing options...
Recommended Posts