Jump to content

error on product detail page


dianepep

Recommended Posts

I have an error showing up on my product detail page. At the very top of the page, before any text is some html code showing that should not be showing. This is the code: "?php $return_filenames = array_map(function($element){return $element['filename'];},$return); array_multisort($return_filenames,$return); ?>"  I do not know what file is the html for the product detail page to see why code is showing.  I'm not sure why this is suddenly showing. Can anyone lead me in the correct direction of where to look in my code for why this error is showing? It's weird because it was working fine and I had to take a break from working on the site for a couple weeks and now that I checked it I am getting that error. 

Link to comment
Share on other sites

This is PHP code, so it won't be in a skin template.

I do not find this in the classes, nor in the administrative scripts. So, it might be a code snippet (look in /includes/extra/), or a plugin hook.

When you say "product detail page", is this the View Product storefront page, or the admin's Add/Edit Inventory settings screens?

The fix is to make sure there is a left angle as the first character: <?php.

Link to comment
Share on other sites

Thanks for the reply. It's the store front page where you click on the product and it brings up the next screen with more details about the product.  This is a second store I opened and reinstalled cubecart on the new domain also and just copied the foundation. When I did that all looked good and just recently this happened even though I do not believe I made any changes. One thing I noticed that is odd is that when I installed Cubecart on this second domain it said version 5 and now when I check it has updated to the latest version. Is that something Cubecart does on its own because I did not update it, at least not intentionally. 

I didn't see anything in includes/extra the only thing under Manage Hooks is Paypal Commerce. 

Thanks again for your help

Link to comment
Share on other sites

No, CubeCart does not update itself unbidden. (Unless you have a service contract where keeping a site up to date is part of the tasks listed for that contract.)

In admin, Error Log, System Error Log tab, see if there is an entry mentioning something like "Headers already sent at..."

Here is a conversation that alludes to a code snippet:
https://forums.cubecart.com/topic/51785-resolved-product-image-order/

So, recheck in admin, Manage Hooks, Code Snippets tab.

 

Link to comment
Share on other sites

Then I must have updated it and didn't know I updated it. lol.

Okay I don't know why I didn't see this before when you suggested I look under Code Snippets but there was a Snippet for sorting the images in the gallery with that code in it and I added a < and the code at the top is gone now but the main image does not show now. Just the gallery images. I had that issue when I first started modifying Foundation but don't remember what I did to correct it. 

Thanks again. I will get these stores up and running some day soon! lol 

*edited: hmm after I got out of my website and went back into it now the image shows. So maybe the first time someone uses the sight the image wont show but it does after that?

Link to comment
Share on other sites

18 minutes ago, bsmither said:

"the first time someone [visits the site] the image won't show but it does after that"

That has been reported before. I am not sure if this has been solved.

oh that's right. I knew I had the problem before but didn't remember the outcome. 

Thanks again for your help. 

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...