Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Recommended Posts

Posted

I entered in manufacturer.php module under /catalog/includes/modules/manufacturers.php to create a manufacturer page. This is from "Deep Inside osCommerce: The Cookbook: Ready-to-use recipes to customize and extend your e-commerce website" by Monika Mathé which I purchased from Amazon.com

 

After hours of tweaking, guessing, and looking at similar code in the Contributions sections, I am asking for help.

 

I keep getting this error but cannot locate the problem with the code on that line as well as before or after it:

 

Parse error: syntax error, unexpected T_STRING in /mnt/w0008/d33/s28/b006a8d1/www/lyonstudiojewelry.com/store/catalog/includes/modules/manufacturers.php on line 23

 

Here is the code of the file: I marked what should be the offending code in red. If you count the lines here, it is different that what I see in my editor (notepad++)

 

<?php

/*

$Id: manufacturers.php,v 1.00 2009

 

Copyright © 2003 osCommerce

 

Released under the GNU General Public License

*/

 

?>

<!-- manufacturers //-->

<?php

$info_box_contents = array();

$info_box_contents[] = array('text' => TEXT_BOX_ALL_MANUFACTURERS);

 

new contentBoxHeading($info_box_contents);

 

$manufacturers_query = tep_db_query("select distinct m.manufacturers_id, m.manufacturers_name, m.manufacturers_image from " . TABLE_MANUFACTURERS . " m where manufacturers_name <> '' order by manufacturers_name);

$row = 0;

$col = 0;

$info_box_contents = array ();

while ($manufacturers = tep_db_fetch_array($manufacturers_query)) {

$info_box_contents[$row][$col] = array('align' => 'center','params' => 'class="smallText" width="33%" valign="middle"',

'text' => '<a href="' .

tep_href_link(FILENAME_DEFAULT, 'manufacturers_id=' .

$manufacturers['manufacturers_id']) . '">' .

tep_image(DIR_WS_IMAGES .

$manufacturers['manufacturers_image'],

$manufacturers['manufacturers_name'],

SMALL_IMAGE_WIDTH,

SMALL_IMAGE_HEIGHT) . '</a>'));

 

$col ++;

if ($col > 2) {

$col = 0;

$row ++;

}

}

 

new contentBox($info_box_contents);

?><!-- manufacturers_eof //-->

 

 

The book is from 2006. Is it a php compatibility issue or some change in osc coding or is it just a simple syntax error that I cannot see?

 

Any help would be greatly appreciated.

 

Sincerely,

Lyonstudio

Posted

possibly a single vs double quote issue at line 24 here after href ?

KEEP CALM AND CARRY ON

I do not use the responsive bootstrap version since i coded my responsive version earlier, but i have bought every 28d of code package to support burts effort and keep this forum alive (albeit more like on life support).

So if you are still here ? What are you waiting for ?!

 

Find the most frequent unique errors to fix:

grep "PHP" php_error_log.txt | sed "s/^.* PHP/PHP/g" |grep "line" |sort | uniq -c | sort -r > counterrors.txt

Posted

the " is missing at the end of your query ... you typed the code, right?

 

you have

$manufacturers_query = tep_db_query("select distinct m.manufacturers_id, m.manufacturers_name, m.manufacturers_image from " . TABLE_MANUFACTURERS . " m where manufacturers_name <> '' order by manufacturers_name);

 

 

should be

$manufacturers_query = tep_db_query("select distinct m.manufacturers_id, m.manufacturers_name, m.manufacturers_image from " . TABLE_MANUFACTURERS . " m where manufacturers_name <> '' order by manufacturers_name");

:-)

Monika

 

addicted to writing code ... can't get enough of databases either, LOL!

 

my toolbox: Textpad - Compare and Merge - phpMyAdmin - WS_FTP - Photoshop - How to search the forum

 

Interactive Media Award July 2007 ~ category E-Commerce

my advice on the forum is for free, PMs where you send me work are considered consultation which I charge for ...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
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...