OSCOMMERCE SUPPORT CALL 702-453-3332

 

Help - Search - Members - Calendar
Full Version: Discount Coupon Contrib Error
osCommerce Community Support Forums > osCommerce Online Merchant v2.x > Contributions / Add-Ons > Order Total Modules
tjmedeiros
Just installed the Coupon Contrib and checked all my entries. I am getting the following error when I go into my admin panel to set up the coupons:

Parse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ')' in /home/content/v/a/n/vantaggiocomp/html/catalog/admin/includes/boxes/reports.php on line 28

This error shows above the rest of the admin panel and seems to imply there is a ) missing in the code. But I checked it all out and it seems to be right. Has anyone else seen this or have a clue why I'm getting this error.

Thanks,

Tom Medeiros
Vantaggio Design, LLC
tjmedeiros
QUOTE (tjmedeiros @ Oct 18 2007, 04:04 PM) *
Just installed the Coupon Contrib and checked all my entries. I am getting the following error when I go into my admin panel to set up the coupons:

Parse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ')' in /home/content/v/a/n/vantaggiocomp/html/catalog/admin/includes/boxes/reports.php on line 28

This error shows above the rest of the admin panel and seems to imply there is a ) missing in the code. But I checked it all out and it seems to be right. Has anyone else seen this or have a clue why I'm getting this error.

Thanks,

Tom Medeiros
Vantaggio Design, LLC



Solved via another forum:


I was able to figure it out.

In the admin/includes/boxes/catalog.php there is a missing dot at the end of the line:
'<a href="' . tep_href_link(FILENAME_PRODUCTS_EXPECTED, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CATALOG_PRODUCTS_EXPECTED . '</a><br>'.

In the admin/includes/boxes/reports.php there is a missing dot at the end of the line:
'<a href="' . tep_href_link(FILENAME_STATS_CUSTOMERS, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_REPORTS_ORDERS_TOTAL . '</a><br>'.
detailer
I too had this problem. However, when I changed what you changed in the first line, I got another error message for the same php:

Parse error: parse error, unexpected $ in /home/detailer/public_html/osCommerce/catalog/admin/includes/boxes/catalog.php on line 43

I looked at the code, and there isn't anything typed in line 43. It's completely blank. Can someone help me out?
--------------------------
EDIT: OKay, so I deleted that line, 43, and now I get the same error message for line 42. Line 42 does have something typed in it however:

<!-- catalog_eof //-->

HELP!
detailer
OKay, after a little research, I guess that somewhere in that file, there is a $ that shouldn't be there or something.

QUOTE
<?php
/*
$Id: catalog.php,v 1.21 2003/07/09 01:18:53 hpdl Exp $

osCommerce, Open Source E-Commerce Solutions
http://www.oscommerce.com

Copyright © 2002 osCommerce

Released under the GNU General Public License
*/
?>
<!-- catalog //-->
<tr>
<td>
<?php
$heading = array();
$contents = array();

$heading[] = array('text' => BOX_HEADING_CATALOG,
'link' => tep_href_link(FILENAME_CATEGORIES, 'selected_box=catalog'));

if ($selected_box == 'catalog') {
$contents[] = array('text' => '<a href="' . tep_href_link(FILENAME_CATEGORIES, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CATALOG_CATEGORIES_PRODUCTS . '</a><br>' .
'<a href="' . tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CATALOG_CATEGORIES_PRODUCTS_ATTRIBUTES . '</a><br>' .
'<a href="' . tep_href_link(FILENAME_MANUFACTURERS, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CATALOG_MANUFACTURERS . '</a><br>' .
'<a href="' . tep_href_link(FILENAME_REVIEWS, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CATALOG_REVIEWS . '</a><br>' .
'<a href="' . tep_href_link(FILENAME_SPECIALS, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CATALOG_SPECIALS . '</a><br>' .
//kgt - discount coupons
'<a href="' . tep_href_link(FILENAME_PRODUCTS_EXPECTED, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CATALOG_PRODUCTS_EXPECTED . '</a><br>' .
'<a href="' . tep_href_link(FILENAME_DISCOUNT_COUPONS, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CATALOG_DISCOUNT_COUPONS . '</a>' );
/***************
'<a href="' . tep_href_link(FILENAME_PRODUCTS_EXPECTED, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CATALOG_PRODUCTS_EXPECTED . '</a>' );
***************/
//end kgt - discount coupons

$box = new box;
echo $box->menuBox($heading, $contents);
?>
</td>
</tr>
<!-- catalog_eof //-->


Anybody see one that doens't belong? I couldn't.

And the thing that really sucks about this error message, is that I can't go and restore my cart to the way it used to be. All that comes up on that page in the admin section is the error message.

HELP ME!
minkoilman
tjmedeiros - Thank you for posting you solution of adding the "." to the end of those two lines. That fixed it for me!
cfisupply
Hi, I can't exactly help you with your problem, but I can offer how I discovered a few errors with woking with scripting.
It was all 'trial and error'. I copied the file into Notepad, my text editor. If you have problems with square boxes instead of line feeds and you have microsoft word, you can copy the text into word, then copy back into notepad. Word should change the boxes into line feeds. After I got a clean copy I would to to the specified problem line, in your case #42, then delete an empty line above that line, save as php and upload to the server, note the error line number again. If it now says line 41, the your problem is below that line. If it still says 42, the it is above this line. I always replaced the empty lines and progressed through the page unitll I found the bad line. Then it was fairly easy to figure out what was wrong. The one main thing I have found with this script, is even though the error shows up on line #42, doesn't mean that (by line counting) that's where it is. The problem may be on line 45 or 50 ect. I know this may take ahile but it worked for me. Hope It Helps.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.