Latest News: (loading..)
KiLLaH

[Contribution] Extra Fields

226 posts in this topic

Hello everyone,

 

I have currently made an fresh install of Extra Fields.

 

URL: http://www.oscommerce.com/community/contri...ll/search,extra

 

Version: 1.3c

 

Everything went fine until i got this error when i tried to view the product (http://www.url.com/shop/admin/categories.php?cPath=28_30_119&pID=368&action=new_product_preview&read=only)

 

This problem is obviously why i cannot save the data in the fields on each product.

 

Case:

---

 

Error:

 

Warning: Invalid argument supplied for foreach() in /www/url.com/shop/admin/categories.php on line 1492

 

Line 1492 in admin/categories.php:

 

foreach ($extra_fields_array as $key=>$val) {

 

Entire code:

 

         <?php 
// START: Extra Fields Contribution
         $extra_fields_names_query = tep_db_query("SELECT * FROM " . TABLE_PRODUCTS_EXTRA_FIELDS);
         while ($extra_fields_names = tep_db_fetch_array($extra_fields_names_query)) {
           $extra_field_name[$extra_fields_names['products_extra_fields_id']] = $extra_fields_names['products_extra_fields_name'];
         }

         if ($HTTP_GET_VARS['read'] == 'only') {
           $products_extra_fields_query = tep_db_query("SELECT * FROM " . TABLE_PRODUCTS_TO_PRODUCTS_EXTRA_FIELDS . " WHERE products_id=" . (int)$HTTP_GET_VARS['pID']);
           while ($products_extra_fields = tep_db_fetch_array($products_extra_fields_query)) {
//v1.3b       echo "Hi";
             $extra_fields_array[$products_extra_fields['products_extra_fields_id']] = $products_extra_fields['products_extra_fields_value'];
           }
         }
         else {
           $extra_fields_array = $HTTP_POST_VARS['extra_field'];
         }

//v1.3b          if ($HTTP_POST_VARS['extra_field']) { // Check to see if there are any need to update extra fields.
           foreach ($extra_fields_array as $key=>$val) {
           ?>
             <b><? echo $extra_field_name[$key];?>:</b> <? echo $val;?><br />
           <?
           }
//v1.3b          } // Check to see if there are any need to update extra fields.
         // END: Extra Fields Contribution
//   echo "<br />" . $pInfo->products_description;
        ?>

Share this post


Link to post
Share on other sites

Hi,

 

I suppose the error comes because there is no extra fields defined for the product you want to preview (fields are empty), and the foreach loop does not like empty arrays => you can try to replace the foreach loop by this one:

 

reset ($extra_fields_array);
while (list ($key, $val) = each ($extra_fields_array)) {

 

Chris

Share this post


Link to post
Share on other sites

Hi,

 

Just the Contribution I was looking for but I have many languages to deal with :'(

 

How complexe is it to add language capabilities ? Do I just need to add language files, or is it more complexe than that... Could you possibly direct me for the basic idea of the way to do it ?

 

Thanx.

Share this post


Link to post
Share on other sites

There is no language files for this contribution as all informations are in database.

 

The best way, for me, would be to add a language dropdown box in the admin part, so for each extra field we could choose the corresonding language or "all languages" if the field name and values are same in all the languages of the shop (for example: forum - http://forum.oscommerce.com.....).

 

It means one more field in the products_extra_fields table, modifying the categories.php for editing and updating the fields, modifying product_info.php to retrieve the correct language fields.

 

That's it.

 

This is something I can do but not today...

 

Chris

Share this post


Link to post
Share on other sites
Hi,

 

I suppose the error comes because there is no extra fields defined for the product you want to preview (fields are empty), and the foreach loop does not like empty arrays => you can try to replace the foreach loop by this one:

 

reset ($extra_fields_array);
while (list ($key, $val) = each ($extra_fields_array)) {

 

Chris

 

Hello Chris,

 

I tried replacing the line:

 

         <?php 
// START: Extra Fields Contribution
         $extra_fields_names_query = tep_db_query("SELECT * FROM " . TABLE_PRODUCTS_EXTRA_FIELDS);
         while ($extra_fields_names = tep_db_fetch_array($extra_fields_names_query)) {
           $extra_field_name[$extra_fields_names['products_extra_fields_id']] = $extra_fields_names['products_extra_fields_name'];
         }

         if ($HTTP_GET_VARS['read'] == 'only') {
           $products_extra_fields_query = tep_db_query("SELECT * FROM " . TABLE_PRODUCTS_TO_PRODUCTS_EXTRA_FIELDS . " WHERE products_id=" . (int)$HTTP_GET_VARS['pID']);
           while ($products_extra_fields = tep_db_fetch_array($products_extra_fields_query)) {
//v1.3b       echo "Hi";
             $extra_fields_array[$products_extra_fields['products_extra_fields_id']] = $products_extra_fields['products_extra_fields_value'];
           }
         }
         else {
           $extra_fields_array = $HTTP_POST_VARS['extra_field'];
         }

//          if ($HTTP_POST_VARS['extra_field']) { // Check to see if there are any need to update extra fields.
//            foreach ($extra_fields_array as $key=>$val) {
             reset ($extra_fields_array);
             while (list ($key, $val) = each ($extra_fields_array)) {
           ?>
             <b><? echo $extra_field_name[$key];?>:</b> <? echo $val;?><br />
           <?
           }
//         } // Check to see if there are any need to update extra fields.
         // END: Extra Fields Contribution
//   echo "<br />" . $pInfo->products_description;
        ?>

 

I got this error when i viewed a product again:

 

Warning: reset(): Passed variable is not an array or object in /www/url.com/shop/admin/categories.php on line 1493

 

Warning: Variable passed to each() is not an array or object in /www/url.com/shop/admin/categories.php on line 1494

 

Although i also noticed something else that when i typed in a value when editing a product it shows the value on the viewing page where you can click "update", but it doesnt save the value of the extra field? I think the problem is still because of this?

 

Thanks for the reply.

Share this post


Link to post
Share on other sites

Sounds like the extra fields parameters are not going from preview page to database. Values are probably not posted correctly: $HTTP_POST_VARS['extra_field'] is empty and therefore values are not saved to database and you get the error message when trying to view it as preview "read only" (preview from product list).

 

The code to check is in categories.php of course, chapter 1.6 of the installation procedure. The location of the modification is maybe confusing in the doc, try to find the comment /* Re-Post all POST'ed variables */ and some lines more down you find the code that the chapter 1.6 speaks about.

 

My code looks like that:

<?php
/* Re-Post all POST'ed variables */
     reset($HTTP_POST_VARS);
     while (list($key, $value) = each($HTTP_POST_VARS)) {
       if (!is_array($HTTP_POST_VARS[$key])) {
         echo tep_draw_hidden_field($key, htmlspecialchars(stripslashes($value)));
       }
     }
      $languages = tep_get_languages();
     for ($i=0, $n=sizeof($languages); $i<$n; $i++) {
       echo tep_draw_hidden_field('products_name[' . $languages[$i]['id'] . ']', htmlspecialchars(stripslashes($products_name[$languages[$i]['id']])));
       echo tep_draw_hidden_field('products_description[' . $languages[$i]['id'] . ']', htmlspecialchars(stripslashes($products_description[$languages[$i]['id']])));
       echo tep_draw_hidden_field('products_url[' . $languages[$i]['id'] . ']', htmlspecialchars(stripslashes($products_url[$languages[$i]['id']])));
     }
     echo tep_draw_hidden_field('products_image', stripslashes($products_image_name));
   // START: Extra Fields Contribution (chapter 1.6)
     if ($HTTP_POST_VARS['extra_field']) { // Check to see if there are any need to update extra fields.
       foreach ($HTTP_POST_VARS['extra_field'] as $key=>$val) {
         echo tep_draw_hidden_field('extra_field['.$key.']', stripslashes($val));
       }
     } // Check to see if there are any need to update extra fields.
     // END: Extra Fields Contribution

     echo tep_image_submit('button_back.gif', IMAGE_BACK, 'name="edit"') . '  ';

 

Good luck

Share this post


Link to post
Share on other sites

The code you mention is added as you say:

 

<?php
/* Re-Post all POST'ed variables */
     reset($HTTP_POST_VARS);
     while (list($key, $value) = each($HTTP_POST_VARS)) {
       if (!is_array($HTTP_POST_VARS[$key])) {
         echo tep_draw_hidden_field($key, htmlspecialchars(stripslashes($value)));
       }
     }
     $languages = tep_get_languages();
     for ($i=0, $n=sizeof($languages); $i<$n; $i++) {
       echo tep_draw_hidden_field('products_name[' . $languages[$i]['id'] . ']', htmlspecialchars(stripslashes($products_name[$languages[$i]['id']])));
       echo tep_draw_hidden_field('products_info[' . $languages[$i]['id'] . ']', htmlspecialchars(stripslashes($products_info[$languages[$i]['id']])));
       echo tep_draw_hidden_field('products_description[' . $languages[$i]['id'] . ']', htmlspecialchars(stripslashes($products_description[$languages[$i]['id']])));
       echo tep_draw_hidden_field('products_url[' . $languages[$i]['id'] . ']', htmlspecialchars(stripslashes($products_url[$languages[$i]['id']])));
     }
         // START: Extra Fields Contribution
     if ($HTTP_POST_VARS['extra_field']) { // Check to see if there are any need to update extra fields.
     foreach ($HTTP_POST_VARS['extra_field'] as $key=>$val) {
// reset ($extra_fields_array);
// while (list ($key, $val) = each ($extra_fields_array)) {
         echo tep_draw_hidden_field('extra_field['.$key.']', stripslashes($val));
       }
     } // Check to see if there are any need to update extra fields.
     // END: Extra Fields Contribution
................................ and so on..

Share this post


Link to post
Share on other sites

So problem should be with the update of fields in database.

In the switch ($action) near begining of categories.php, find case 'update_product':

and add this right after:

 

var_dump ($HTTP_POST_VARS);

 

and comment the last line of this case, just before the break:

// tep_redirect (...

 

Try to insert or update a product having extra fields. The var_dump instruction will display on the screen the variables that have been posted. Extra fields should be there. If they are, check the extra fields code for the update (chapter 1.2). If they are not, problem is with the re-posted values that we discussed previously.

Share this post


Link to post
Share on other sites
So problem should be with the update of fields in database.

In the switch ($action) near begining of categories.php, find case 'update_product':

and add this right after:

 

var_dump ($HTTP_POST_VARS);

 

and comment the last line of this case, just before the break:

// tep_redirect (...

 

Try to insert or update a product having extra fields. The var_dump instruction will display on the screen the variables that have been posted. Extra fields should be there. If they are, check the extra fields code for the update (chapter 1.2). If they are not, problem is with the re-posted values that we discussed previously.

 

 

This is what it writes on the top when i click the "update" and go back to the product list in admin.

 

array(55) { ["products_status"]=> string(1) "1" ["products_date_available"]=> string(0) "" ["manufacturers_id"]=> string(0) "" ["products_tax_class_id"]=> string(1) "1" ["products_price"]=> string(8) "255.2000" ["products_price_gross"]=> string(3) "319" ["products_quantity"]=> string(1) "0" ["products_model"]=> string(5) "12124" ["products_previous_image"]=> string(9) "12124.jpg" ["products_previous_image_sm_1"]=> string(0) "" ["products_previous_image_xl_1"]=> string(0) "" ["products_previous_image_sm_2"]=> string(0) "" ["products_previous_image_xl_2"]=> string(0) "" ["products_previous_image_sm_3"]=> string(0) "" ["products_previous_image_xl_3"]=> string(0) "" ["products_previous_image_sm_4"]=> string(0) "" ["products_previous_image_xl_4"]=> string(0) "" ["products_previous_image_sm_5"]=> string(0) "" ["products_previous_image_xl_5"]=> string(0) "" ["products_previous_image_sm_6"]=> string(0) "" ["products_previous_image_xl_6"]=> string(0) "" ["products_qty_blocks"]=> string(1) "1" ["products_price1"]=> string(8) "232.0000" ["products_price1_qty"]=> string(2) "22" ["products_price2"]=> string(9) "2323.0000" ["products_price2_qty"]=> string(3) "222" ["products_price3"]=> string(9) "2323.0000" ["products_price3_qty"]=> string(2) "22" ["products_price4"]=> string(9) "2323.0000" ["products_price4_qty"]=> string(3) "222" ["products_weight"]=> string(5) "0.130" ["products_sort_order"]=> string(1) "0" ["products_date_added"]=> string(19) "2004-07-27 23:23:20" ["x"]=> string(2) "60" ["y"]=> string(1) "7" ["products_name"]=> array(1) { [4]=> string(45) "Product name here" } ["products_info"]=> array(1) { [4]=> string(0) "" } ["products_description"]=> array(1) { [4]=> string(1221) "Product description: blah blah " } ["products_url"]=> array(1) { [4]=> string(0) "" } ["extra_field"]=> array(1) { [2]=> string(4) "Testing extra" } ["products_image"]=> string(9) "12124.jpg" ["products_image_med"]=> string(0) "" ["products_image_lrg"]=> string(0) "" ["products_image_sm_1"]=> string(0) "" ["products_image_xl_1"]=> string(0) "" ["products_image_sm_2"]=> string(0) "" ["products_image_xl_2"]=> string(0) "" ["products_image_sm_3"]=> string(0) "" ["products_image_xl_3"]=> string(0) "" ["products_image_sm_4"]=> string(0) "" ["products_image_xl_4"]=> string(0) "" ["products_image_sm_5"]=> string(0) "" ["products_image_xl_5"]=> string(0) "" ["products_image_sm_6"]=> string(0) "" ["products_image_xl_6"]=> string(0) "" }

 

And yet it doesnt add the extrafields..

Share this post


Link to post
Share on other sites

Heres how i added according to your description:

 

      case 'update_product':
     var_dump ($HTTP_POST_VARS);
       if (isset($HTTP_POST_VARS['edit_x']) || isset($HTTP_POST_VARS['edit_y'])) {
         $action = 'new_product';

 

And commented out the tep_redirect line which was in this case.

Share this post


Link to post
Share on other sites

I am having this problem too. I have tried all this and its still not working. any other thoughts or ideas?

 

Crystal

Share this post


Link to post
Share on other sites
I am having this problem too.  I have tried all this and its still not working.  any other thoughts or ideas?

 

Crystal

 

Im trying to figure out myself but rather lost right now.. :)

Share this post


Link to post
Share on other sites

I did everything like the instructions.......This bites! I have a clothing store and am trying to put in the garment measurements, like Bust, Waist, etc.... and it looks fine in preview, but I don't know. If you figure it out, let me know. I have to go run some errands......

 

Will have hubby look when he comes home and see if he can find it.

 

Crystal

Share this post


Link to post
Share on other sites

General board says its in product_info.php somewhere. I think I found an error, but I am not sure, since I am new to this. It is an error in instructions if it really is an error. Will let you know if I get anywhere with it today.

 

Crystal

Share this post


Link to post
Share on other sites
and it looks fine in preview, but I don't know.  If you figure it out, let me know.  I have to go run some errands......

 

 

Don' think I've figured it out, but the contribution works fine for me, I don't see anything in the preview but on the product page it works... Could that be something to do with it... Are you editing the right files in the right folder ?

 

PS : Any news about Multi-Lingual version ?

Thanx.

Edited by mat123slade

Share this post


Link to post
Share on other sites

To KiLLah:

 

In your $HTTP_POST_VARS listing, you can see that there is one extra field:

["extra_field"]=> array(1) { [2]=> string(4) "Testing extra". If it is not in database, error is in the switch ($action), case 'update_product'.

 

Here is the code I have in this section:

 

        // START: Extra Fields Contribution (Chapter 1.2)
         $extra_fields_query = tep_db_query("SELECT * FROM " . TABLE_PRODUCTS_TO_PRODUCTS_EXTRA_FIELDS . " WHERE products_id = " . (int)$products_id);
         while ($products_extra_fields = tep_db_fetch_array($extra_fields_query)) {
           $extra_product_entry[$products_extra_fields['products_extra_fields_id']] = $products_extra_fields['products_extra_fields_value'];
         }

         if ($HTTP_POST_VARS['extra_field']) { // Check to see if there are any need to update extra fields.
           foreach ($HTTP_POST_VARS['extra_field'] as $key=>$val) {
             if (isset($extra_product_entry[$key])) { // an entry exists
               if ($val == '') tep_db_query("DELETE FROM " . TABLE_PRODUCTS_TO_PRODUCTS_EXTRA_FIELDS . " where products_id = " . (int)$products_id . " AND  products_extra_fields_id = " . $key);
               else tep_db_query("UPDATE " . TABLE_PRODUCTS_TO_PRODUCTS_EXTRA_FIELDS . " SET products_extra_fields_value = '" . tep_db_input($val) . "' WHERE products_id = " . (int)$products_id . " AND  products_extra_fields_id = " . $key);
             }
             else { // an entry does not exist
               if ($val != '') tep_db_query("INSERT INTO " . TABLE_PRODUCTS_TO_PRODUCTS_EXTRA_FIELDS . " (products_id, products_extra_fields_id, products_extra_fields_value) VALUES ('" . (int)$products_id . "', '" . $key . "', '" . tep_db_input($val) . "')");
             }
           }
         } // Check to see if there are any need to update extra fields.
         // END: Extra Fields Contribution

 

Try to 'echo' some values inside this code, to see what is really processed (and keep the tep_redirect commented).

 

I have started the multi-language version, ready soon...

Share this post


Link to post
Share on other sites

I've just posted version 2.0 of this contribution, which finally supports multi languages.

You now have the choice to display the fields in all languages, like before, or only in one. (I mean that each field can be separately configured).

 

Update is quite easy. Post here if any problem.

Share this post


Link to post
Share on other sites
To KiLLah:

 

In your $HTTP_POST_VARS listing, you can see that there is one extra field:

["extra_field"]=> array(1) { [2]=> string(4) "Testing extra". If it is not in database, error is in the switch ($action), case 'update_product'.

 

Here is the code I have in this section:

 

        // START: Extra Fields Contribution (Chapter 1.2)
         $extra_fields_query = tep_db_query("SELECT * FROM " . TABLE_PRODUCTS_TO_PRODUCTS_EXTRA_FIELDS . " WHERE products_id = " . (int)$products_id);
         while ($products_extra_fields = tep_db_fetch_array($extra_fields_query)) {
           $extra_product_entry[$products_extra_fields['products_extra_fields_id']] = $products_extra_fields['products_extra_fields_value'];
         }

         if ($HTTP_POST_VARS['extra_field']) { // Check to see if there are any need to update extra fields.
           foreach ($HTTP_POST_VARS['extra_field'] as $key=>$val) {
             if (isset($extra_product_entry[$key])) { // an entry exists
               if ($val == '') tep_db_query("DELETE FROM " . TABLE_PRODUCTS_TO_PRODUCTS_EXTRA_FIELDS . " where products_id = " . (int)$products_id . " AND  products_extra_fields_id = " . $key);
               else tep_db_query("UPDATE " . TABLE_PRODUCTS_TO_PRODUCTS_EXTRA_FIELDS . " SET products_extra_fields_value = '" . tep_db_input($val) . "' WHERE products_id = " . (int)$products_id . " AND  products_extra_fields_id = " . $key);
             }
             else { // an entry does not exist
               if ($val != '') tep_db_query("INSERT INTO " . TABLE_PRODUCTS_TO_PRODUCTS_EXTRA_FIELDS . " (products_id, products_extra_fields_id, products_extra_fields_value) VALUES ('" . (int)$products_id . "', '" . $key . "', '" . tep_db_input($val) . "')");
             }
           }
         } // Check to see if there are any need to update extra fields.
         // END: Extra Fields Contribution

 

Try to 'echo' some values inside this code, to see what is really processed (and keep the tep_redirect commented).

 

I have started the multi-language version, ready soon...

 

I have tried the diffrent stuff but yet still backed with the same errors and problems i cant really see what is what right now. Would you like to check the categories.php source to see if you can see anything wrong setup?

 

Thanks in advance.

Share this post


Link to post
Share on other sites

The new multilmingual version of this contribution works brilliantly... I can now get everything working beautfully, I'm really happy, thanx ever so much... There is a but... a very small one... Is it possible to change the code slightly to allow use of html... I cannot seam to be able to use iframes which I would need to use in nearly all product descriptions to enable Flash animations and othe content from other websites.

 

Is it simple to change ?

 

thanx again.

Share this post


Link to post
Share on other sites

Ok, I sorted that problem out myself... Wasn't to complex...

In Step 6 of the readme, here is what to paste if you want to insert iframes or other that need " character.

 

	     // START: Extra Fields Contribution

$extra_fields_query = tep_db_query("

SELECT pef.products_extra_fields_name as name, ptf.products_extra_fields_value as value

FROM ". TABLE_PRODUCTS_EXTRA_FIELDS ." pef

LEFT JOIN ". TABLE_PRODUCTS_TO_PRODUCTS_EXTRA_FIELDS ." ptf

ON ptf.products_extra_fields_id=pef.products_extra_fields_id

WHERE ptf.products_id=".$products_id." and ptf.products_extra_fields_value<>'' and (pef.languages_id='0' or pef.languages_id='".$languages_id."')

ORDER BY products_extra_fields_order");

 

while ($extra_fields = tep_db_fetch_array($extra_fields_query)) {

echo stripslashes('<b>'.$extra_fields['name'].': </b>');

echo stripslashes($extra_fields['value'].'<BR>');

}

// END: Extra Fields Contribution

Share this post


Link to post
Share on other sites

Hi,

 

I added Products Extra Fields v2.0 (9 Nov 2004) to my shop. Everything seems to work fine except for the folowing error message in my product_info.php

 

1064 - You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'and ptf.products_extra_fields_value<>'' and (pef.languages_id='

 

SELECT pef.products_extra_fields_name as name, ptf.products_extra_fields_value as value FROM products_extra_fields pef LEFT JOIN products_to_products_extra_fields ptf ON ptf.products_extra_fields_id=pef.products_extra_fields_id WHERE ptf.products_id= and ptf.products_extra_fields_value<>'' and (pef.languages_id='0' or pef.languages_id='2') ORDER BY products_extra_fields_order

 

As my product_info is heavily modified I added right beneath

 

<td class="productInfo" valign="top"><p><?php echo stripslashes($product_info['products_description']); ?>

 

the following code:

 

<?php

// START: Extra Fields Contribution

$extra_fields_query = tep_db_query("

SELECT pef.products_extra_fields_name as name, ptf.products_extra_fields_value as value

FROM ". TABLE_PRODUCTS_EXTRA_FIELDS ." pef

LEFT JOIN ". TABLE_PRODUCTS_TO_PRODUCTS_EXTRA_FIELDS ." ptf

ON ptf.products_extra_fields_id=pef.products_extra_fields_id

WHERE ptf.products_id=".$products_id." and ptf.products_extra_fields_value<>'' and (pef.languages_id='0' or pef.languages_id='".$languages_id."')

ORDER BY products_extra_fields_order");

 

while ($extra_fields = tep_db_fetch_array($extra_fields_query)) {

echo '<b>'.$extra_fields['name'].': </b>';

echo $extra_fields['value'].'<BR>';

}

// END: Extra Fields Contribution

?>

 

I have Master Products installed, so I`m not sure if it has something to do with that.

 

I'd appreciate your help ;-) thanks

Share this post


Link to post
Share on other sites

Hi,

 

Are you using A template system ? If so, you have to put the info in the template file nammed after the product-info page... For example with bts template contribution, the step 6 in the readme has to go into catalog/templates/product_info.tpl.php instead of in catalog/product_info.php

 

Your error as you say seams to be to do with a stripslashe problem :

 

Try adding the striplashes in this bit of code :

 echo '<b>'.$extra_fields['name'].': </b>';
echo $extra_fields['value'].'<BR>';

 

so it looks like :

 

 echo stripslashes('<b>'.$extra_fields['name'].': </b>');
echo stripslashes($extra_fields['value'].'<BR>');

 

I don't know much, but that might help... When does the problem occur ? Is it when the text you put in your new extra fields contains " or ' characters ?

Edited by mat123slade

Share this post


Link to post
Share on other sites

Thanks for your quick reply Mathew. Unfotunately that didn`t resolve my problem. I changed the code in my product_info.php to

 

<?php    
// START: Extra Fields Contribution
 $extra_fields_query = tep_db_query("
                     SELECT pef.products_extra_fields_name as name, ptf.products_extra_fields_value as value
                     FROM ". TABLE_PRODUCTS_EXTRA_FIELDS ." pef
            LEFT JOIN  ". TABLE_PRODUCTS_TO_PRODUCTS_EXTRA_FIELDS ." ptf
           ON ptf.products_extra_fields_id=pef.products_extra_fields_id
           WHERE ptf.products_id=".$products_id." and ptf.products_extra_fields_value<>'' and (pef.languages_id='0' or pef.languages_id='".$languages_id."')
           ORDER BY products_extra_fields_order");

 while ($extra_fields = tep_db_fetch_array($extra_fields_query)) {
echo stripslashes('<b>'.$extra_fields['name'].': </b>');
echo stripslashes($extra_fields['value'].'<BR>'); 
 }
// END: Extra Fields Contribution
?>

 

but I still get the SQL Syntax error.

 

It appears as soon as I click on a product in my product listing (so when visiting product_info).

 

In admin I added a text field with no special characters. The values I enter i.e. green, yellow also have no special characters. The error occurs regardless for which language I create the text field.

 

I`m not using a template system. All design modifications are in the core files!

 

Do you have another idea, perhaps?

Share this post


Link to post
Share on other sites

I also tested this with an unmodified product_info.php MS2 file, in order of ruling out that it has something to do with previous modifications I made to my product_info.php (from other contributions)

 

But the same error occurs. Hmm, strange.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now