mitchellds Posted October 5, 2012 Share Posted October 5, 2012 Since performing a restore operation yesterday, I've run into a problem with featured items. I have turned off the "Include in Latest Products" for every single item in my store except ONE. Now (post backup recover phase), when you visit http://XebraParts.com, a "bunch of junk" text appears at the top of the screen that seems to be correlated to the one featured item in my store (the only item that has the green "Include in Latest Products" check mark). This "event" only happens on the home page of my store. Click on any link in the store and the "bunch of junk" text disappears. I am reasonably sure that this problem is a direct result of the "restore" operation I performed yesterday. Any ideas? Quote Link to comment Share on other sites More sharing options...
bsmither Posted October 6, 2012 Share Posted October 6, 2012 I'm thinking this is not a fault of a malfunctioning restore. This very much resembles the output of PHP's print_r() function. While trying to figure out a previous misbehavior, did you pepper your code with print_r($products), perhaps in the cubecart.class.php file, displayHomepage() function? Quote Link to comment Share on other sites More sharing options...
mitchellds Posted October 6, 2012 Author Share Posted October 6, 2012 There's been no "peppering" on my end. I don't even know how to "pepper" code! I found only one instance of the "print_r" function in the code below. I would have attached my cubecart.class.php file but it appears that I have run out of attachment space! Here is [a portion of] my cubecart.class.php file: if ($latestProducts) { print_r($latestProducts); foreach ($latestProducts as $product) { $category_data = $GLOBALS['catalogue']->getCategoryStatusByProductID($product['product_id']); $category_status = false; if (is_array($category_data)) { foreach ($category_data as $trash => $data) { if ($data['status'] == 1) { $category_status = true; Quote Link to comment Share on other sites More sharing options...
bsmither Posted October 6, 2012 Share Posted October 6, 2012 Somebody put print_r($latestProducts); in the file. Please remove it if you haven't already. Quote Link to comment Share on other sites More sharing options...
mitchellds Posted October 6, 2012 Author Share Posted October 6, 2012 OK, that did the trick. I did not insert that print_r function (or whatever it is called). More likely than not, it was either Al or someone on his team who inserted it while trying to figure out the duplicate Custom SEO URL problem. Only one more little glitch: if you check out http://XebraParts.com, at the very top of the screen, there appears to be a blank line that has mysteriously shown up (after I removed the print_r function). This blank line is throwing off the vertical size of the search box. Again, I made no changes to cubecart.class.php so I am guessing that whatever change was made by the CubeCart Jedi warriors has caused this little problem. Quote Link to comment Share on other sites More sharing options...
bsmither Posted October 6, 2012 Share Posted October 6, 2012 I think that wasn't happening before, so maybe what you used to make the edit to that file is what caused this. What program did you use to make the edit to remove the print_r() line? If you used Notepad, then we need to re-edit the file using a different editor. If you use Windows, find, download, and install the free programmer's editor Notepad++. Quote Link to comment Share on other sites More sharing options...
mitchellds Posted October 6, 2012 Author Share Posted October 6, 2012 OK, now that was cool! I've never used Notepad++ until today. Why in the world did Notepad++ work while Notepad did not? You gotta know, bsmither, that you've been a HUGE help! I sincerely appreciate it! Quote Link to comment Share on other sites More sharing options...
bsmither Posted October 6, 2012 Share Posted October 6, 2012 Notepad is a "quick and dirty" editor, meant to simply type up something that would exist in no defined environment. As such, Notepad is free to add what is called a Byte-Order-Mark (BOM) as the very first 2 or 3 bytes at the beginning of the file to indicate what kind of character set is being used. But to PHP, whatever is not within <?php ?> tags is to be sent to the web browser, including the BOM, and doing that without being under tight control creates some really weird results. Notepad++, being a programmer's editor, knows to not put anything in the file without the user's knowledge and permission. Quote Link to comment Share on other sites More sharing options...
mitchellds Posted October 6, 2012 Author Share Posted October 6, 2012 OK, got it. Thanks very much! Right now, I can't find any other problems that jumped up on the radar after my last database restore operation. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.