Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Need help with a php snippet please


jdballenger

Recommended Posts

Hi all - embarrassing post from a newbie. If I should be asking about this in a different forum please let me know - apologies in advance.

 

I have installed the following contribution (for adding new product fields) - http://www.oscommerce.com/community/contributions,1158 and while it works just fine on the admin side of the house, I'm having problems with pages loading. Not sure if the problem is with product_info.php in the /catalog dir or what - the page loads up to a point then I get the following error:

 

"Error!

 

Unable to determine the page link!"

 

Problem seems to be related to a snippet of code I need to insert around about line 117, but before the following line:

<p><?php echo stripslashes($product_info['products_description']); ?></p>

 

Here's what I think is the relevant section of code from /catalog/product_info.php as it sits at the moment

 

<script language="javascript"><!--
document.write('<?php echo '<a href="java script:popupWindow(\\\'' . tep_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $product_info['products_id']) . '\\\')">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], addslashes($product_info['products_name']), SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?>');
//--></script>
<noscript>
<?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_image']) . '" target="_blank">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], $product_info['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?>
</noscript>
             </td>
           </tr>
         </table>
<?php
//sandalwood
if (tep_not_null($product_info['products_isbn_10'])) {
echo TEXT_PRODUCTS_ISBN_10.' '.$product_info['products_isbn_10'];
} 
//end of sandalwood
?>
         <p><?php echo stripslashes($product_info['products_description']); ?></p>
<?php
   $products_attributes_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)$languages_id . "'");
   $products_attributes = tep_db_fetch_array($products_attributes_query);
   if ($products_attributes['total'] > 0) {
?>

 

If you want to see for yourself head to - http://www.rathminesbooks.com/catalog/index.php and then click on any of the categories... you'l see what I mean.

 

I have a feeling this is not a massive problem, and that I have klutzed something crucial. Any help greatly appreciated.

 

Thanks,

Jeremy

Link to comment
Share on other sites

Sounds as if one of the includes functions has not been done 100% correct...

 

Follow the instructions again, ticking every step you take... If this fails, check on a default install and see if the same problem persists, this might give you an answer...

Link to comment
Share on other sites

Sounds as if one of the includes functions has not been done 100% correct...

 

Follow the instructions again, ticking every step you take... If this fails, check on a default install and see if the same problem persists, this might give you an answer...

 

Thanks Riaan but have ticked all the steps a few times already. The includes functions are one line edits to both admin/includes/languages/english/categories.php and catalog/includes/languages/english/products_info.php where the new field is defined.

 

Don't quite know where to look on this one because as mentioned, works just fine on the back end through the admin panel, trouble is in loading product_info pages at the front end. Any suggestions that could save me a re-install greatly appreciated,

 

Thanks again,

Jeremy

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...