Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

calling code experts.........


Guest

Recommended Posts

here's what i am trying to do.

 

what i want is the manufacturers logo to appear at the top of each product page. therefore when a different product is shown the relevant manufacturer logo will appear. (this working the same as the "manufacturer_info.php" but instead of being in the right column, it would be on the main page)

 

so what i have tried to do is take the coding from the "manufacturer_info.php" file and modify it so the logo appears without the box borders and then put it in the "products_info.php" file. the modified coding is shown below:

 

 

<?php

 

//manufacturers_info begin

if (isset($HTTP_GET_VARS['products_id'])) {

$manufacturer_query = tep_db_query("select m.manufacturers_id, m.manufacturers_name, m.manufacturers_image, mi.manufacturers_url from " . TABLE_MANUFACTURERS . " m left join " . TABLE_MANUFACTURERS_INFO . " mi on (m.manufacturers_id = mi.manufacturers_id and mi.languages_id = '" . (int)$languages_id . "'), " . TABLE_PRODUCTS . " p where p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and p.manufacturers_id = m.manufacturers_id");

if (tep_db_num_rows($manufacturer_query)) {

$manufacturer = tep_db_fetch_array($manufacturer_query);

?>

<!-- manufacturer_info //-->

<?php

if (tep_not_null($manufacturer['manufacturers_image'])) {

?>

 

<table border="0" width="100%" cellspacing="0" cellpadding="0">

 

<tr>

<td align="center" class="main" colspan="2">

<img src="images/<? echo $manufacturer['manufacturers_image']; ?>" >

</td></tr>

</table>

<?php }

//manufacturers_info end

?>

 

 

i am no expert at all with coding (this is actually my first attempt). but i was confident it would work! but guess what it doesn't!

 

it keeps giving me the following error once ftp'd:

 

Parse error: parse error, unexpected $ in /home/www/deviltro/product_info.php on line 327

 

please give advice.

 

if you want the complete file please ask and i will email it to you, but its all standard apart from the coding im trying to put in.

Link to comment
Share on other sites

here's what i am trying to do.

 

what i want is the manufacturers logo to appear at the top of each product page. therefore when a different product is shown the relevant manufacturer logo will appear. (this working the same as the "manufacturer_info.php" but instead of being in the right column, it would be on the main page)

 

so what i have tried to do is take the coding from the "manufacturer_info.php" file and modify it so the logo appears without the box borders and then put it in the "products_info.php" file. the modified coding is shown below:

<?php

 

//manufacturers_info begin

  if (isset($HTTP_GET_VARS['products_id'])) {

    $manufacturer_query = tep_db_query("select m.manufacturers_id, m.manufacturers_name, m.manufacturers_image, mi.manufacturers_url from " . TABLE_MANUFACTURERS . " m left join " . TABLE_MANUFACTURERS_INFO . " mi on (m.manufacturers_id = mi.manufacturers_id and mi.languages_id = '" . (int)$languages_id . "'), " . TABLE_PRODUCTS . " p  where p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and p.manufacturers_id = m.manufacturers_id");

    if (tep_db_num_rows($manufacturer_query)) {

      $manufacturer = tep_db_fetch_array($manufacturer_query);

?>

<!-- manufacturer_info //-->

      <?php

    if (tep_not_null($manufacturer['manufacturers_image'])) {

    ?>

 

  <table border="0" width="100%" cellspacing="0" cellpadding="0">

     

  <tr>

  <td align="center" class="main" colspan="2">

  <img src="images/<? echo $manufacturer['manufacturers_image']; ?>" >

      </td></tr>

  </table>

  <?php }

  //manufacturers_info end

  ?>

i am no expert at all with coding (this is actually my first attempt). but i was confident it would work! but guess what it doesn't!

 

it keeps giving me the following error once ftp'd:

 

Parse error: parse error, unexpected $ in /home/www/deviltro/product_info.php on line 327

 

please give advice.

 

if you want the complete file please ask and i will email it to you, but its all standard apart from the coding im trying to put in.

 

Well, I'm definately no expert, but I believe that when you use an 'if' statement with a { you also have to have a matching }. In the upper portion I see two { and no } the bottom statement looks fine in that regard, except I would move the //eof to just before the <?php } ?>

 

Lori

Link to comment
Share on other sites

Your missing some closing if braces.

 

<?php

//manufacturers_info begin
if (isset($HTTP_GET_VARS['products_id'])) {
$manufacturer_query = tep_db_query("select m.manufacturers_id, m.manufacturers_name, m.manufacturers_image, mi.manufacturers_url from " . TABLE_MANUFACTURERS . " m left join " . TABLE_MANUFACTURERS_INFO . " mi on (m.manufacturers_id = mi.manufacturers_id and mi.languages_id = '" . (int)$languages_id . "'), " . TABLE_PRODUCTS . " p where p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and p.manufacturers_id = m.manufacturers_id");
if (tep_db_num_rows($manufacturer_query)) {
$manufacturer = tep_db_fetch_array($manufacturer_query);
?>
<!-- manufacturer_info //-->
<?php 
if (tep_not_null($manufacturer['manufacturers_image'])) {
?>

<table border="0" width="100%" cellspacing="0" cellpadding="0">

<tr> 
<td align="center" class="main" colspan="2"> 
<img src="images/<? echo $manufacturer['manufacturers_image']; ?>" >
</td></tr>
</table>
<?php
 }
}
}
//Two braces above here
//manufacturers_info end
?>

Link to comment
Share on other sites

i done it, that was 6 hours work! believe it or not!

I spent 3 hours trying to get javascript to work with a form array when there's only one item in it last night.

 

As they say on 'who want's to be a millionaire', the questions are only easy if you know the answer!!

Light, in the absence of eyes, illuminates nothing.

Link to comment
Share on other sites

  • 5 weeks later...

Archived

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

×
×
  • Create New...