[Contribution] QTpro - Quantity Tracking Professional
#2001
Posted 01 September 2011 - 04:50 PM
Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ',' or ';' in C:\wamp\www\admin\products_attributes.php on line 290
#2002
Posted 05 September 2011 - 08:41 PM
demastermind, on 01 July 2011 - 04:43 PM, said:
I do have another question. On the stock report table in the prodects info page, how would I have it tell the stock when less than 10 or less are available, and have it say "more than 10 available" when there are more than 10 in stock. This is actually like what ebay does.
- Luc
This is what it looks like now:
http://www.jumbledfun.com/onstock.jpg
Hello,
I have the same error, can you tell me where is(are) the error(s) ?
Thank you.
#2003
Posted 16 September 2011 - 12:29 AM
demastermind, on 03 July 2011 - 12:33 AM, said:
- Luc
Could you please post the changes you made to correct the unexpected T_CONSTANT_ENCAPSED_STRING, expecting ',' or ';' error?
Add-Ons Installed
Header Tags SEO
Ultimate SEO URLs
Google Sitemap SEO
Easy Populate
QT Pro
Margin Report
AJAX Attribute Manager
Smart Columns
CKEditor
OSCThumb
Select Product Image Directory
Category CSS Menu
Enable Disable Categories
Contact Form Captcha
#2004
Posted 16 September 2011 - 12:48 AM
$option_name = tep_db_query("select products_options_name from " . TABLE_PRODUCTS_OPTIONS . " where products_options_id = '" . $options_values['products_options_id'] . "' and language_id = '" . $languages[$i]['id'] . "'");
And did not cause errors before QT Pro was installed.
Add-Ons Installed
Header Tags SEO
Ultimate SEO URLs
Google Sitemap SEO
Easy Populate
QT Pro
Margin Report
AJAX Attribute Manager
Smart Columns
CKEditor
OSCThumb
Select Product Image Directory
Category CSS Menu
Enable Disable Categories
Contact Form Captcha
#2005
Posted 16 September 2011 - 02:08 AM
Quote
If it is, go into the old file, and find what should come after the corresponding echo's in the new file. Paste that code after the echo.
Which echos?
There are many in that file and some are form related.
Add-Ons Installed
Header Tags SEO
Ultimate SEO URLs
Google Sitemap SEO
Easy Populate
QT Pro
Margin Report
AJAX Attribute Manager
Smart Columns
CKEditor
OSCThumb
Select Product Image Directory
Category CSS Menu
Enable Disable Categories
Contact Form Captcha
#2007
Posted 17 September 2011 - 08:51 AM
I found the root cause of the error - "unexpected T_CONSTANT_ENCAPSED_STRING, expecting ',' or ';' error?" on line 290.
Its solution is mentioned in the file - Manual_for_2.3.1.html, which has the step by step instructions. A bit of clarity is required, though.
For manual step 11.3, the section that mentions :
Find: <!-- options //-->
to <!-- options eof //--> Change all between to:
In the code given to be replaced, there are 4 unfinished "echo" statements (with no code immediately following the '). The statements are just displayed as follows:
echo '
The instruction in the manual states to add the code from your existing "admin/products_attributes.php" file to complete each of the corresponding echo statements. In my case, I was using the vanilla products_attributes.php which came default with the OSC 2.3.1 install. I have replaced the echo statements accordingly and the code works!
If you simply copy the code from step 11.3 into notepad, the unfinished echo ' statements are on Line 119, 138, 175, & 190.
The complete code for step 11.3 which worked for me is given below:
-----------------------------------------
<!-- options //-->
<?php
if ($action == 'delete_product_option') { // delete product option
$options = tep_db_query("select products_options_id, products_options_name from " . TABLE_PRODUCTS_OPTIONS . " where products_options_id = '" . (int)$HTTP_GET_VARS['option_id'] . "' and language_id = '" . (int)$languages_id . "'");
$options_values = tep_db_fetch_array($options);
?>
<tr>
<td class="pageHeading"> <?php echo $options_values['products_options_name']; ?> </td>
</tr>
<tr>
<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
<tr>
<td colspan="3"><?php echo tep_black_line(); ?></td>
</tr>
<?php
$products = tep_db_query("select p.products_id, pd.products_name, pov.products_options_values_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov, " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_DESCRIPTION . " pd where pd.products_id = p.products_id and pov.language_id = '" . (int)$languages_id . "' and pd.language_id = '" . (int)$languages_id . "' and pa.products_id = p.products_id and pa.options_id='" . (int)$HTTP_GET_VARS['option_id'] . "' and pov.products_options_values_id = pa.options_values_id order by pd.products_name");
if (tep_db_num_rows($products)) {
?>
<tr class="dataTableHeadingRow">
<td class="dataTableHeadingContent" align="center"> <?php echo TABLE_HEADING_ID; ?> </td>
<td class="dataTableHeadingContent"> <?php echo TABLE_HEADING_PRODUCT; ?> </td>
<td class="dataTableHeadingContent"> <?php echo TABLE_HEADING_OPT_VALUE; ?> </td>
</tr>
<tr>
<td colspan="3"><?php echo tep_black_line(); ?></td>
</tr>
<?php
$rows = 0;
while ($products_values = tep_db_fetch_array($products)) {
$rows++;
?>
<tr class="<?php echo (floor($rows/2) == ($rows/2) ? 'attributes-even' : 'attributes-odd'); ?>">
<td align="center" class="smallText"> <?php echo $products_values['products_id']; ?> </td>
<td class="smallText"> <?php echo $products_values['products_name']; ?> </td>
<td class="smallText"> <?php echo $products_values['products_options_values_name']; ?> </td>
</tr>
<?php
}
?>
<tr>
<td colspan="3"><?php echo tep_black_line(); ?></td>
</tr>
<tr>
<td colspan="3" class="main"><br><?php echo TEXT_WARNING_OF_DELETE; ?></td>
</tr>
<tr>
<td align="right" colspan="3" class="main"><br><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, $page_info, 'NONSSL') . '">'; ?><?php echo tep_image_button('button_cancel.gif', ' cancel '); ?></a> </td>
</tr>
<?php
} else {
?>
<tr>
<td class="main" colspan="3"><br><?php echo TEXT_OK_TO_DELETE; ?></td>
</tr>
<tr>
<td class="main" align="right" colspan="3"><br><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, 'action=delete_option&option_id=' . $HTTP_GET_VARS['option_id'] . '&' . $page_info, 'NONSSL') . '">'; ?><?php echo tep_image_button('button_delete.gif', ' delete '); ?></a> <?php echo '<a href="' . tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, $page_info, 'NONSSL') . '">'; ?><?php echo tep_image_button('button_cancel.gif', ' cancel '); ?></a> </td>
</tr>
<?php
}
?>
</table></td>
</tr>
<?php
} else {
?>
<tr>
<td colspan="3" class="pageHeading"> <?php echo HEADING_TITLE_OPT; ?> </td>
</tr>
<tr>
<td colspan="3" class="smallText" align="right">
<?php
$options = "select * from " . TABLE_PRODUCTS_OPTIONS . " where language_id = '" . (int)$languages_id . "' order by products_options_id";
$options_split = new splitPageResults($option_page, MAX_ROW_LISTS_OPTIONS, $options, $options_query_numrows);
echo $options_split->display_links($options_query_numrows, MAX_ROW_LISTS_OPTIONS, MAX_DISPLAY_PAGE_LINKS, $option_page, 'value_page=' . $value_page . '&attribute_page=' . $attribute_page, 'option_page');
?>
</td>
</tr>
<tr>
<?php
//++++ QT Pro: Begin Changed code
?>
<td colspan="4"><?php echo tep_black_line(); ?></td>
<?php
//++++ QT Pro: End Changed Code
?>
</tr>
<tr class="dataTableHeadingRow">
<td class="dataTableHeadingContent"> <?php echo TABLE_HEADING_ID; ?> </td>
<td class="dataTableHeadingContent"> <?php echo TABLE_HEADING_OPT_NAME; ?> </td>
<?php
//++++ QT Pro: Begin Changed code
?>
<td class="dataTableHeadingContent"> <?php echo TABLE_HEADING_TRACK_STOCK; ?> </td>
<?php
//++++ QT Pro: End Changed Code
?>
<td class="dataTableHeadingContent" align="center"> <?php echo TABLE_HEADING_ACTION; ?> </td>
</tr>
<tr>
<?php
//++++ QT Pro: Begin Changed code
?>
<td colspan="4"><?php echo tep_black_line(); ?></td>
<?php
//++++ QT Pro: End Changed Code
?>
</tr>
<?php
$next_id = 1;
$rows = 0;
$options = tep_db_query($options);
while ($options_values = tep_db_fetch_array($options)) {
$rows++;
?>
<tr class="<?php echo (floor($rows/2) == ($rows/2) ? 'attributes-even' : 'attributes-odd'); ?>">
<?php
if (($action == 'update_option') && ($HTTP_GET_VARS['option_id'] == $options_values['products_options_id'])) {
echo '<form name="option" action="' . tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, 'action=update_option_name&' . $page_info, 'NONSSL') . '" method="post">';
$inputs = '';
for ($i = 0, $n = sizeof($languages); $i < $n; $i ++) {
$option_name = tep_db_query("select products_options_name from " . TABLE_PRODUCTS_OPTIONS . " where products_options_id = '" . $options_values['products_options_id'] . "' and language_id = '" . $languages[$i]['id'] . "'");
$option_name = tep_db_fetch_array($option_name);
$inputs .= $languages[$i]['code'] . ': <input type="text" name="option_name[' . $languages[$i]['id'] . ']" size="20" value="' . $option_name['products_options_name'] . '"> <br>';
}
?>
<td align="center" class="smallText"> <?php echo $options_values['products_options_id']; ?><input type="hidden" name="option_id" value="<?php echo $options_values['products_options_id']; ?>"> </td>
<td class="smallText"><?php echo $inputs; ?></td>
<?php
//++++ QT Pro: Begin Changed code
?>
<td align="center" class="smallText"><input type=checkbox name=track_stock <?php echo $options_values['products_options_track_stock']?"checked":""; ?>></td>
<?php
//++++ QT Pro: End Changed Code
?>
<td align="center" class="smallText"> <?php echo tep_image_submit('button_update.gif', IMAGE_UPDATE); ?> <?php echo '<a href="' . tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, $page_info, 'NONSSL') . '">'; ?><?php echo tep_image_button('button_cancel.gif', IMAGE_CANCEL); ?></a> </td>
<?php
echo '</form>' . "\n";
} else {
?>
<td align="center" class="smallText"> <?php echo $options_values["products_options_id"]; ?> </td>
<td class="smallText"> <?php echo $options_values["products_options_name"]; ?> </td>
<?php
//++++ QT Pro: Begin Changed code
?>
<td align="center" class="smallText"> <?php echo $options_values['products_options_track_stock']?"Yes":"No"; ?></td>
<?php
//++++ QT Pro: End Changed Code
?>
<td align="center" class="smallText"> <?php echo '<a href="' . tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, 'action=update_option&option_id=' . $options_values['products_options_id'] . '&' . $page_info, 'NONSSL') . '">'; ?><?php echo tep_image_button('button_edit.gif', IMAGE_UPDATE); ?></a> <?php echo '<a href="' . tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, 'action=delete_product_option&option_id=' . $options_values['products_options_id'] . '&' . $page_info, 'NONSSL') , '">'; ?><?php echo tep_image_button('button_delete.gif', IMAGE_DELETE); ?></a> </td>
<?php
}
?>
</tr>
<?php
$max_options_id_query = tep_db_query("select max(products_options_id) + 1 as next_id from " . TABLE_PRODUCTS_OPTIONS);
$max_options_id_values = tep_db_fetch_array($max_options_id_query);
$next_id = $max_options_id_values['next_id'];
}
?>
<tr>
<?php
//++++ QT Pro: Begin Changed code
?>
<td colspan="4"><?php echo tep_black_line(); ?></td>
<?php
//++++ QT Pro: End Changed Code
?>
</tr>
<?php
if ($action != 'update_option') {
?>
<tr class="<?php echo (floor($rows/2) == ($rows/2) ? 'attributes-even' : 'attributes-odd'); ?>">
<?php
echo '<form name="options" action="' . tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, 'action=add_product_options&' . $page_info, 'NONSSL') . '" method="post"><input type="hidden" name="products_options_id" value="' . $next_id . '">';
$inputs = '';
for ($i = 0, $n = sizeof($languages); $i < $n; $i ++) {
$inputs .= $languages[$i]['code'] . ': <input type="text" name="option_name[' . $languages[$i]['id'] . ']" size="20"> <br>';
}
?>
<td align="center" class="smallText"> <?php echo $next_id; ?> </td>
<td class="smallText"><?php echo $inputs; ?></td>
<?php
//++++ QT Pro: Begin Changed code
?>
<td align="center" ><input type=checkbox name=track_stock></td>
<td align="left" class="smallText"> <?php echo tep_image_submit('button_insert.gif', IMAGE_INSERT); ?> </td>
<?php
//++++ QT Pro: End Changed Code
echo '</form>'
?>
</tr>
<tr>
<?php
//++++ QT Pro: Begin Changed code
?>
<td colspan="4"><?php echo tep_black_line(); ?></td>
<?php
//++++ QT Pro: End Changed Code
?>
</tr>
<?php
}
}
?>
</table></td>
<!-- options eof //-->
--------------------------------
Hope that helps solve your error too! Good luck.
SagarJ
#2008
Posted 17 September 2011 - 10:51 PM
SagarJ, on 17 September 2011 - 08:51 AM, said:
I found the root cause of the error - "unexpected T_CONSTANT_ENCAPSED_STRING, expecting ',' or ';' error?" on line 290.
Its solution is mentioned in the file - Manual_for_2.3.1.html, which has the step by step instructions. A bit of clarity is required, though.
For manual step 11.3, the section that mentions :
Find: <!-- options //-->
to <!-- options eof //--> Change all between to:
In the code given to be replaced, there are 4 unfinished "echo" statements (with no code immediately following the '). The statements are just displayed as follows:
echo '
The instruction in the manual states to add the code from your existing "admin/products_attributes.php" file to complete each of the corresponding echo statements. In my case, I was using the vanilla products_attributes.php which came default with the OSC 2.3.1 install. I have replaced the echo statements accordingly and the code works!
If you simply copy the code from step 11.3 into notepad, the unfinished echo ' statements are on Line 119, 138, 175, & 190.
The complete code for step 11.3 which worked for me is given below:
-----------------------------------------
--------------------------------
Hope that helps solve your error too! Good luck.
SagarJ
Awesome!
Thank you for clarifying that and my install works now!
Add-Ons Installed
Header Tags SEO
Ultimate SEO URLs
Google Sitemap SEO
Easy Populate
QT Pro
Margin Report
AJAX Attribute Manager
Smart Columns
CKEditor
OSCThumb
Select Product Image Directory
Category CSS Menu
Enable Disable Categories
Contact Form Captcha
#2009
Posted 18 September 2011 - 01:33 AM
1136 - Column count doesn't match value count at row 1
insert into products_attributes values (null, '30', '1', '1', '0', '+')
[TEP STOP]
What do I do?
#2010
Posted 18 September 2011 - 02:34 AM
I found this line in products_attributes.php, guess this has something to do with it?
(Line 62)
tep_db_query("insert into " . TABLE_PRODUCTS_ATTRIBUTES . " values (null, '" . (int)$products_id . "', '" . (int)$options_id . "', '" . (int)$values_id . "', '" . (float)tep_db_input($value_price) . "', '" . tep_db_input($price_prefix) . "')");
Or this (Line 116):
tep_db_query("update " . TABLE_PRODUCTS_ATTRIBUTES . " set products_id = '" . (int)$products_id . "', options_id = '" . (int)$options_id . "', options_values_id = '" . (int)$values_id . "', options_values_price = '" . (float)tep_db_input($value_price) . "', price_prefix = '" . tep_db_input($price_prefix) . "' where products_attributes_id = '" . (int)$attribute_id . "'");
?
Edited by slugg0, 18 September 2011 - 02:40 AM.
#2011
Posted 19 September 2011 - 12:28 PM
-I'm completely stuck here....
#2012
Posted 19 September 2011 - 05:36 PM
slugg0, on 19 September 2011 - 12:28 PM, said:
-I'm completely stuck here.... [img]http://forums.oscommerce.com//public/style_emoticons/default/sad.png[/img]
Did you verify that all your changes are correct AND that you did not remove needed code from any other add-ons when doing the install?
Add-Ons Installed
Header Tags SEO
Ultimate SEO URLs
Google Sitemap SEO
Easy Populate
QT Pro
Margin Report
AJAX Attribute Manager
Smart Columns
CKEditor
OSCThumb
Select Product Image Directory
Category CSS Menu
Enable Disable Categories
Contact Form Captcha
#2013
Posted 20 September 2011 - 10:14 PM
Tried to restore from my previosly functioning state, but that caused yet another error... So I ended up with deleting my entire catalog and database and now, i'm trying to restore the entire site...
We'll see if it'll work next time.....
#2014
Posted 27 September 2011 - 12:57 AM
I now have about 700 sick products and each product has multiple attributes with more than 6 choices per attribute so at least 12 stock quantities per product.
That's 8400 stock quantities i need to manually enter!!!! GAA IM BLINDED
Add-Ons Installed
Header Tags SEO
Ultimate SEO URLs
Google Sitemap SEO
Easy Populate
QT Pro
Margin Report
AJAX Attribute Manager
Smart Columns
CKEditor
OSCThumb
Select Product Image Directory
Category CSS Menu
Enable Disable Categories
Contact Form Captcha
#2015
Posted 27 September 2011 - 01:20 AM
color - 8 choices
size - 6 choices
6 x 8 is 48
48 x 700 = 33600
So I only have to enter 33600 stock quantities manually and those products are not available but are on the site since customers cannot pick a size or quantity till the quantities are added so I have dead product on my site
Add-Ons Installed
Header Tags SEO
Ultimate SEO URLs
Google Sitemap SEO
Easy Populate
QT Pro
Margin Report
AJAX Attribute Manager
Smart Columns
CKEditor
OSCThumb
Select Product Image Directory
Category CSS Menu
Enable Disable Categories
Contact Form Captcha
#2016
Posted 05 October 2011 - 11:26 AM
has anyone encountered problems with the attributes no longer appearing at the checkout_confirmation.php stage?
i havent got a huge amount of mods on my site, and QTPro is the only one i can see mentioned on any of the files used by the checkout process
shows item model and item name, price info etc
but attributes field is blank, i am in process of revertting files back to standard to see if i can identify on which one the problem is
#2017
Posted 05 October 2011 - 11:30 AM
#2018
Posted 11 October 2011 - 01:12 PM
velvetpixel, on 27 September 2011 - 12:57 AM, said:
I now have about 700 sick products and each product has multiple attributes with more than 6 choices per attribute so at least 12 stock quantities per product.
That's 8400 stock quantities i need to manually enter!!!! GAA IM BLINDED [img]http://forums.oscommerce.com//public/style_emoticons/default/smile.png[/img]
I'm writing up a PHP script to do this, not sure when I'll finish it - it has to fit between real work!
Thanks SagarJ for that revised products_attribute.php file - the state of the current contribution is crappy with this kind of work being required to get it going. The help file with it's 'echo '<NOTHING' code leaves alot to be desired quality wise - so much so I'd say unless you're au fait with PHP/MySQL I wouldn't both with it. Shame because it's a great mod.
At the same time, remember we are bolting on something osc wasn't at all designed for, so attributes stock handling with this package is always going to be tedious/difficult.
Note to people considering this mod (and those posting 'Help Please' in this thread) : you will in all likelihood require some PHP coding to get it going. If you're not up to it ie. all you know is how to parrot-like copy code, I seriously wouldn't bother with it till you've learnt coding. Slugg0 you might want to think about this before you waste a few weeks of frustration.
Edited by p2409, 11 October 2011 - 01:13 PM.
"I can add modules to OSC" = I can search, cut and paste. But not well, or I wouldn't be here.
"I start my posting with 'works like a charm' = I'm letting you down gently, nothing works and I have no idea why
"I finish postings with "plzzzz....hlp" = My installation is buggered and I know I'm going to have to pay someone, but I really, really don't want to.
#2019
Posted 11 October 2011 - 01:47 PM
I've put it here if you ready to just go ahead with it:
Change
//++++ QT Pro: Begin Changed code JOC qtpro_doctor_amputate_all_from_product($product_id); //++++ QT Pro: End Changed code
To
//++++ QT Pro: Begin Changed code JOC if ($products_id!=null) qtpro_doctor_amputate_all_from_product($product_id); //++++ QT Pro: End Changed code
The QTPro for 2.3 addon page has this on it now.
"I can add modules to OSC" = I can search, cut and paste. But not well, or I wouldn't be here.
"I start my posting with 'works like a charm' = I'm letting you down gently, nothing works and I have no idea why
"I finish postings with "plzzzz....hlp" = My installation is buggered and I know I'm going to have to pay someone, but I really, really don't want to.
#2020
Posted 12 October 2011 - 11:05 AM
p2409, on 11 October 2011 - 01:47 PM, said:
I've put it here if you ready to just go ahead with it:
Change
//++++ QT Pro: Begin Changed code JOC qtpro_doctor_amputate_all_from_product($product_id); //++++ QT Pro: End Changed code
To
//++++ QT Pro: Begin Changed code JOC if ($products_id!=null) qtpro_doctor_amputate_all_from_product($product_id); //++++ QT Pro: End Changed code
The QTPro for 2.3 addon page has this on it now.
The above if statement must be like this:
if (tep_not_null($products_id)) {qtpro_doctor_amputate_all_from_product($product_id);}
Sara
http://addons.oscommerce.com/info/8010 http://addons.oscommerce.com/info/8204 http://addons.oscommerce.com/info/8681









