Jump to content

Resolved - Post Restore - Featured Item Problem


mitchellds

Recommended Posts

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?

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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;

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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++.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...