lindsayanng Posted July 17, 2010 Posted July 17, 2010 So I assumed that you would include the application_top.php file and then the shopping cart file would do it.. Apparently not as I am getting errors and things are not working. I need to know which files need to be included, and in which order in order to be able to access the oscommerce functions from outside of oscommerce (i am trying to display the shopping cart box inside of the wordpress header) A great place for newbies to start Road Map to oscommerce File Structure DO NOT PM ME FOR HELP. My time is valuable, unless i ask you to PM me, please dont. You will get better help if you post publicly. I am not as good at this as you think anyways! HOWEVER, you can visit my blog (go to my profile to see it) and post a question there, i will find time to get back and answer you Proud Memeber of the CODE BREAKERS CLUB!!
lindsayanng Posted July 17, 2010 Author Posted July 17, 2010 Let me elaborate, seeing as I did not do that very well. I have added this to the header of my wordpress install: <?php chdir('/home/hugmeup/public_html/'); require('includes/application_top.php');?> This should include the proper function files to get this to work.. Then I added this to include the actual cart box: <div id="cartTop"> <?php include('includes/boxes/shopping_cart.php'); ?></div> I am at the point now where I have TWO problems 1. "headers already sent" at the top of the page (because the wordpress headers AND the oscommerce headers are trying to send together) 2. the cart contents are STILL not passing from store to blog. The cookies are clearly working, because if i go BACK to the store the cart contents are there You can test this by going to this page and adding an item to cart: LINK HERE then click on BLOG in the top nav area and see where the blog header shows the error and the no cart contents. I REALLY REALLY want to get this to work.. I feel like there is no reason this can't be done seeing as I can pull recent and updated info from wordpress to the store.. why can't it go both ways? A great place for newbies to start Road Map to oscommerce File Structure DO NOT PM ME FOR HELP. My time is valuable, unless i ask you to PM me, please dont. You will get better help if you post publicly. I am not as good at this as you think anyways! HOWEVER, you can visit my blog (go to my profile to see it) and post a question there, i will find time to get back and answer you Proud Memeber of the CODE BREAKERS CLUB!!
npn2531 Posted July 17, 2010 Posted July 17, 2010 With application_top.php in WP it might not be locating file path definitions in include/configure.php. Pasting those definitions directly into application_top.php in WP may help, or least let you know if that is one of the issues. Oscommerce site: OSC to CSS, http://addons.oscommerce.com/info/7263 -Mail Manager, http://addons.oscommerce.com/info/8120
lindsayanng Posted July 17, 2010 Author Posted July 17, 2010 You are saying create a different "application_top" file and put the configure defines in THAT file and put that file inside of wordpress?? It does not seem that application_top is missing any defines, otherwise I would have actual errors saying "call to memeber function" or "can not find file" but instead I get no errors, but the content is not being passed.. So I do not really know if that will change anything A great place for newbies to start Road Map to oscommerce File Structure DO NOT PM ME FOR HELP. My time is valuable, unless i ask you to PM me, please dont. You will get better help if you post publicly. I am not as good at this as you think anyways! HOWEVER, you can visit my blog (go to my profile to see it) and post a question there, i will find time to get back and answer you Proud Memeber of the CODE BREAKERS CLUB!!
lindsayanng Posted July 19, 2010 Author Posted July 19, 2010 Anyone else here have some thoughts and/or help on this? A great place for newbies to start Road Map to oscommerce File Structure DO NOT PM ME FOR HELP. My time is valuable, unless i ask you to PM me, please dont. You will get better help if you post publicly. I am not as good at this as you think anyways! HOWEVER, you can visit my blog (go to my profile to see it) and post a question there, i will find time to get back and answer you Proud Memeber of the CODE BREAKERS CLUB!!
npn2531 Posted July 19, 2010 Posted July 19, 2010 Search for " // include server parameters require('includes/configure.php'); near the top of application_top.php. Unless application_top.php locates that file it will not be able to parse stuff in application_top.php like: DIR_WS_FUNCTIONS . 'general.php' or HTTP_SERVER You may be able to solve this by providing a path for application_top.php that you've placed in WP to the file configure.php in OSC by changing the path stated in the 'require' command above. for example something like: require('/catalog/includes/configure.php'); or whatever. Oscommerce site: OSC to CSS, http://addons.oscommerce.com/info/7263 -Mail Manager, http://addons.oscommerce.com/info/8120
lindsayanng Posted July 19, 2010 Author Posted July 19, 2010 Yes, i have tried that and that is not the problem.. If application_top.php was not finding the configure.php file (which it is) there would be a LOT LOT LOT more errors than just the can not modify headers issue. I did, just to prove my point.. Add the require for the configure file and it has changed nothing on the page. Basically from what i gather, ALL functions are there and accessable via wordress.. I have the cookie set to remember the osc cart contents instead of dealing with the osc id .. So the only issue I can see is POSSIBLY that the cookie is just not working for the /blog directory. I don't really know enough about settings cookies to comment though. On second thought, it can't be the cookie because when you go to /blog the cart contents disappear, BUT they are still in the cart if you go BACK to the store.. A great place for newbies to start Road Map to oscommerce File Structure DO NOT PM ME FOR HELP. My time is valuable, unless i ask you to PM me, please dont. You will get better help if you post publicly. I am not as good at this as you think anyways! HOWEVER, you can visit my blog (go to my profile to see it) and post a question there, i will find time to get back and answer you Proud Memeber of the CODE BREAKERS CLUB!!
♥kymation Posted July 19, 2010 Posted July 19, 2010 What is your cookie domain set to? If it's only the catalog.... Regards Jim See my profile for a list of my addons and ways to get support.
npn2531 Posted July 19, 2010 Posted July 19, 2010 Good point, there are a several required files that would crash application_top.php. I am not familiar enough with the sequence of how the errors present, but perhaps you are getting the header error before it has a chance to get to an error related to the file required command. You could perhaps test this by changing require('includes/configure.php'); to require('includes/configurexxx.php'); If nothing changes, or if you don't get an error about it not finding configure.php, you would at least know that WP is not reading application_top.php, or at least it's not reading past the first few lines to that first file required command. Oscommerce site: OSC to CSS, http://addons.oscommerce.com/info/7263 -Mail Manager, http://addons.oscommerce.com/info/8120
lindsayanng Posted July 19, 2010 Author Posted July 19, 2010 The cookie is set to the domain so it should cover everything.. I am wondering (again i dont know much about cookies) do you think maybe wordpress is overwriting the cookie from osc? A great place for newbies to start Road Map to oscommerce File Structure DO NOT PM ME FOR HELP. My time is valuable, unless i ask you to PM me, please dont. You will get better help if you post publicly. I am not as good at this as you think anyways! HOWEVER, you can visit my blog (go to my profile to see it) and post a question there, i will find time to get back and answer you Proud Memeber of the CODE BREAKERS CLUB!!
lindsayanng Posted July 19, 2010 Author Posted July 19, 2010 yes, tampering with the configure.php filename in the application_top folder has, in fact, broken it in the typical way/. This is what I have been basically saying all along.. it seems that all of the proper files are being referenced.. it's actually SHOWING the "0 items" which is build by the shopping_cart.php file inside of the boxes directory..s o why is it on maintaining the cart contents?? A great place for newbies to start Road Map to oscommerce File Structure DO NOT PM ME FOR HELP. My time is valuable, unless i ask you to PM me, please dont. You will get better help if you post publicly. I am not as good at this as you think anyways! HOWEVER, you can visit my blog (go to my profile to see it) and post a question there, i will find time to get back and answer you Proud Memeber of the CODE BREAKERS CLUB!!
npn2531 Posted July 19, 2010 Posted July 19, 2010 PS- if WP is not reading application_top.php past require('includes/configure.php'); it's unlikely it is getting the cookie. Oscommerce site: OSC to CSS, http://addons.oscommerce.com/info/7263 -Mail Manager, http://addons.oscommerce.com/info/8120
lindsayanng Posted July 19, 2010 Author Posted July 19, 2010 I just did a bunch of tests all the way down to the bottom of application_top - it is, in fact, reading the whole damn file... I do not know what is going on here! A great place for newbies to start Road Map to oscommerce File Structure DO NOT PM ME FOR HELP. My time is valuable, unless i ask you to PM me, please dont. You will get better help if you post publicly. I am not as good at this as you think anyways! HOWEVER, you can visit my blog (go to my profile to see it) and post a question there, i will find time to get back and answer you Proud Memeber of the CODE BREAKERS CLUB!!
♥kymation Posted July 19, 2010 Posted July 19, 2010 The problem may be that Wordpress is trying to output part of the page before application_top.php gets loaded. Try moving the include for application_top to the very top of the page, before any of the Wordpress code. Regards Jim See my profile for a list of my addons and ways to get support.
npn2531 Posted July 19, 2010 Posted July 19, 2010 Actually you sound really far along. My guess would be then that the queries that build the shopping cart (the ones in the files you have moved over to WP), specifically the conditional statements at the end of the database queries, need attention somehow to make sure they are finding the OSCommerce database tables. Perhaps in that case you should be getting an error msg, but maybe you can test this by taking off the conditions at the end of some queries see if you get 'something'. To build the cart takes a bit of referencing the keys across a number of tables in the OSCommerce database, and perhaps in moving the files to WP you have broken the 'chain of reference' from table to table. Oscommerce site: OSC to CSS, http://addons.oscommerce.com/info/7263 -Mail Manager, http://addons.oscommerce.com/info/8120
npn2531 Posted July 19, 2010 Posted July 19, 2010 Just to cover your bases, you may want to check you don't have any whitespace top or bottom of the pages you see in the error msgs. I'm getting this error msg after I add the bib and click blog: Warning: Cannot modify header information - headers already sent by (output started at /home/hugmeup/public_html/blog/wp-content/themes/twentyten/header.php:12) in /home/hugmeup/public_html/includes/functions/general.php on line 1227 Maybe try commenting out whatever you have in includes/functions/general.php on line 1227 Oscommerce site: OSC to CSS, http://addons.oscommerce.com/info/7263 -Mail Manager, http://addons.oscommerce.com/info/8120
lindsayanng Posted July 19, 2010 Author Posted July 19, 2010 @ kymation - the call for application_top is all the way at as the very first line in header.php in wordpress @ npn2531 - I am not sure what you are saying here.. I have no actually moved any files over to wordpress, I have simply called for the already existing file in the store directory from within wordpress.. So just like as if i were working with a file in a sub directory of the store, I am working in the wordpress directory. I am not duplicating any files at all. The headers already sent is being caused by this line: function tep_setcookie($name, $value = '', $expire = 0, $path = '/', $domain = '', $secure = 0) { setcookie($name, $value, $expire, $path, (tep_not_null($domain) ? $domain : ''), $secure); } and has nothing really to do with white space.. it clearly has to be something to do with the cookies possibiliy interferring with each other, but as I have said.. i do not know a lot about cookies.. i wouldnt know how to merge them if i tried. A great place for newbies to start Road Map to oscommerce File Structure DO NOT PM ME FOR HELP. My time is valuable, unless i ask you to PM me, please dont. You will get better help if you post publicly. I am not as good at this as you think anyways! HOWEVER, you can visit my blog (go to my profile to see it) and post a question there, i will find time to get back and answer you Proud Memeber of the CODE BREAKERS CLUB!!
npn2531 Posted July 19, 2010 Posted July 19, 2010 The cookies and sessions id are both mysteries to me. I suspect cookies are simple. The text '0 items' is 'BOX_SHOPPING_CART_EMPTY' from english.php. Not an actual count, and is on the 'else' side of an conditional 'if registered' statement in the shopping cart infobox. Perhaps you could test the cookies issue by having the cart contents on both sides of that if/else statement. If you pasted: $cart_contents_string .= $products[$i]['name']; just below: $cart_contents_string .= BOX_SHOPPING_CART_EMPTY; You would have the cart contents on both sides of that conditional statement. Oscommerce site: OSC to CSS, http://addons.oscommerce.com/info/7263 -Mail Manager, http://addons.oscommerce.com/info/8120
lindsayanng Posted July 19, 2010 Author Posted July 19, 2010 npn2531 - i tested using your suggestion and it has not made any difference in the code on either the shop or the store.. I have a feeling that string you are asking me to type will do nothing if the cart is empty because there is no product to echo. Adding a simple <?php echo "Hello World!"; ?> after the if statement of cart empty, it echos "hello world" with the "items 0" If i place that within the if cart contents > 0 then I see it in the store but not in the blog.. because when we go to the blog it thinks that the cart contents are 0 I didn't really learn anything from this test, i just figured I would share.. Basically learned what I already knew.. it is setting the cart contents to 0 which nulls all of the functions for if cart contents > 0 A great place for newbies to start Road Map to oscommerce File Structure DO NOT PM ME FOR HELP. My time is valuable, unless i ask you to PM me, please dont. You will get better help if you post publicly. I am not as good at this as you think anyways! HOWEVER, you can visit my blog (go to my profile to see it) and post a question there, i will find time to get back and answer you Proud Memeber of the CODE BREAKERS CLUB!!
lindsayanng Posted July 19, 2010 Author Posted July 19, 2010 Ok another test.. npn, there was a flaw in your logic and coding.. it hought about it some more.. I needed to add this to the cart after the else statement $cart_contents_string = '<table class="infobox-cart" border="0">'; $products = $cart->get_products(); Sticking that code after the else "CART_BOX_EMPTY" gives me a list of the products on the shop but NOT on the blog.. Again,i'm not sure what this tells me except that it's not nessecarily a 0 items thing, but instead it is just not registering the function to see the products.. A great place for newbies to start Road Map to oscommerce File Structure DO NOT PM ME FOR HELP. My time is valuable, unless i ask you to PM me, please dont. You will get better help if you post publicly. I am not as good at this as you think anyways! HOWEVER, you can visit my blog (go to my profile to see it) and post a question there, i will find time to get back and answer you Proud Memeber of the CODE BREAKERS CLUB!!
♥kymation Posted July 19, 2010 Posted July 19, 2010 The problem could be cookies. The Wordpress cookie could be overwriting the one from osCommerce. Use a cookie viewer to look at the cookies that your browser has stored, or use LiveHTTP |Headers in Firefox to see what's being passed to the site. Regards Jim See my profile for a list of my addons and ways to get support.
lindsayanng Posted July 19, 2010 Author Posted July 19, 2010 Well i looked at the cookies earlier, and i didn't see anything that jumped out at me.. I can see cookies from the store AND from wordpress.. A great place for newbies to start Road Map to oscommerce File Structure DO NOT PM ME FOR HELP. My time is valuable, unless i ask you to PM me, please dont. You will get better help if you post publicly. I am not as good at this as you think anyways! HOWEVER, you can visit my blog (go to my profile to see it) and post a question there, i will find time to get back and answer you Proud Memeber of the CODE BREAKERS CLUB!!
lindsayanng Posted July 19, 2010 Author Posted July 19, 2010 I did a quick test by clearing all cookies and then browsing the site.. Obviously there were other cookies in there from osc and wordpress because I was logged in as admin.. So i could remove the all the cookies and didn't log in to admin and just browsed.. I can see on the osc side I get two cookies Then when you go onto the blog you see these two additional cookies: So the only curious thing is the php session id from wordpress and the osc session id from osc.. I dont know if one over writes the other though.. because again, i dont know a lot about cookies. A great place for newbies to start Road Map to oscommerce File Structure DO NOT PM ME FOR HELP. My time is valuable, unless i ask you to PM me, please dont. You will get better help if you post publicly. I am not as good at this as you think anyways! HOWEVER, you can visit my blog (go to my profile to see it) and post a question there, i will find time to get back and answer you Proud Memeber of the CODE BREAKERS CLUB!!
♥kymation Posted July 19, 2010 Posted July 19, 2010 That tells me the cookies are not being overwritten. Well, it was a long shot anyway. Do you have PHP set to display all errors? That might give you a hint of what's going wrong with the cart class. Otherwise you'll just have to track it through the code. Regards Jim See my profile for a list of my addons and ways to get support.
lindsayanng Posted July 19, 2010 Author Posted July 19, 2010 yep.. i have it to show all errors.. There has to be someone out there who can look at this and get a grasp as to where this is coming from.. I don't even know where to start with "going through the code" Also, just because both cookies are there doesn't mean that one might not be interfering with the other, correct? A great place for newbies to start Road Map to oscommerce File Structure DO NOT PM ME FOR HELP. My time is valuable, unless i ask you to PM me, please dont. You will get better help if you post publicly. I am not as good at this as you think anyways! HOWEVER, you can visit my blog (go to my profile to see it) and post a question there, i will find time to get back and answer you Proud Memeber of the CODE BREAKERS CLUB!!
Recommended Posts
Archived
This topic is now archived and is closed to further replies.