Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

family 3.0 problems


sgflowers

Recommended Posts

hi i didn't see a thread for this contribution yet

 

when i click on assign families i do not have any families available in the dropdown

 

i have created 2 families

 

any ideas??

 

 

also there are a couple of errors in the install and sql

 

this gives an error in php admin:

 

CREATE TABLE `products_families` (

`family_id` SMALLINT( 3 ) NOT NULL ,

`products_id` SMALLINT( 3 ) NOT NULL ,

);

 

also

 

CREATE TABLE `Families` (

`family_id` SMALLINT( 3 ) NOT NULL AUTO_INCREMENT,

`family_name` VARCHAR( 20 ) NOT NULL ,

PRIMARY KEY ( `family_id` ) );

 

Families should be families otherwize you get errors in admin

 

 

in the install:

 

12.) Add the following code to /catalog/admin/includes/database_tables.php file:

 

define('TABLE_FAMILIES', 'families');

 

 

should also have:

 

define('TABLE_PRODUCTS_FAMILIES', 'products_families');

 

i still can't get the admin to work though...

Link to comment
Share on other sites

  • Replies 146
  • Created
  • Last Reply

Top Posters In This Topic

Ok...here are the fixes to get the admin to work:

 

In /catalog/admin/includes/functions/database.php find the following code:

 

for ($i=0, $n=sizeof($products_name); $i<$n; $i++) {

 

Change it to:

 

for ($i=0, $n=sizeof($families_name); $i<$n; $i++) {

 

As far as the SQL fix...yes. Change 'Families' to 'families' and add this to to bottom of your /catalog/admin/includes/database_tables.php

 

define('TABLE_PRODUCTS_FAMILIES', 'products_families');

 

Once you guys work this out...let me know how you like it.

 

*I have uploaded v3.1 which has all of this fixed in the documentation.

 

-Chris

Chris Sullivan

Link to comment
Share on other sites

......it's running, but I get this error message only at products with no attached family product:

 

1064 - You have an error in your SQL syntax near ') and p.products_id = pf.products_id and p.products_id != '27' limit 9' at line 1

 

select distinct p.products_id, p.products_image, p.products_tax_class_id, if(s.status, s.specials_new_products_price, p.products_price) as products_price from products_families pf, products p left join specials s on p.products_id = s.products_id where p.products_status = '1' and () and p.products_id = pf.products_id and p.products_id != '27' limit 9

 

Any ideas?

 

Torsten

Link to comment
Share on other sites

Any idea about the error

 

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 p.products_id = pf.products_id and p.products_id != '1726

select distinct p.products_id, p.products_image, p.products_tax_class_id, if(s.status, s.specials_new_products_price, p.products_price) as products_price from products_families pf, products p left join specials s on p.products_id = s.products_id where p.products_status = '1' and () and p.products_id = pf.products_id and p.products_id != '17263'

 

 

????

Link to comment
Share on other sites

I am using box.

Header Text    
Display Product Image 1   
Family Display Type Box   
Display Product Manufacturer Name 0   
Family Display Format Random   
Display Product Model 2   
Display Product Price 5   
Display Product Name 4   
Display Product Name 4   
Display Product Quantity 0   
Display Product Weight 0   
Display Buy Now column 6   
Location of Prev/Next Navigation Bar (1-top, 2-bottom, 3-both) 3   
Header Text 


The text that will appear as the header of the Family Products v3.0 module. 

Date Added:  
Last Modified: 09/09/2003

 

Thanks

Link to comment
Share on other sites

Well, the first thing I will say is, "Wow. You have a lot of products." :)

 

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 p.products_id = pf.products_id and p.products_id != '1726

 

select distinct p.products_id, p.products_image, p.products_tax_class_id, if(s.status, s.specials_new_products_price, p.products_price) as products_price from products_families pf, products p left join specials s on p.products_id = s.products_id where p.products_status = '1' and () and p.products_id = pf.products_id and p.products_id != '17263'

 

The problem is occuring when the additional params are called in the $where_clause variable. This part of the code (listed below) basically states that if there is more than 1 family, then it should select random products from the database where the product belongs to the first OR second OR third (and so on) family. This way all products have a fair chance of being shown no matter what family it belongs to.

 

if (tep_db_num_rows($family_name_query) == '1') {
$family_query = tep_db_query("select distinct p.products_id, p.products_image, p.products_tax_class_id, if(s.status, s.specials_new_products_price, p.products_price) as products_price from " . TABLE_PRODUCTS_FAMILIES . " pf, " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_status = '1' and pf.family_id = '" . (int)$family_results['family_id'] . "' and p.products_id = pf.products_id and p.products_id != '" . $products_id . "' order by p.products_date_added desc limit " . MAX_DISPLAY_NEW_PRODUCTS);
} else {
$where_clause = '';
$where_clause2 = '';
for ($i=0; $i < tep_db_num_rows($family_name_query); $i++) {
$family_results = tep_db_fetch_array($family_name_query);
if ($i < $num_of_rows_less_one) {
$where_clause .= "(pf.family_id = '" . $family_results['family_id'] . "') OR ";
} else {
$where_clause .= "(pf.family_id = '" . $family_results['family_id'] . "')";
}
}
$family_query = tep_db_query("select distinct p.products_id, p.products_image, p.products_tax_class_id, if(s.status, s.specials_new_products_price, p.products_price) as products_price from " . TABLE_PRODUCTS_FAMILIES . " pf, " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_status = '1' and (" . $where_clause . ") and p.products_id = pf.products_id and p.products_id != '" . $products_id . "' limit " . MAX_DISPLAY_NEW_PRODUCTS);
}

 

I don't understand why you are getting that error though. It looks as though it is calling the query which uses the OR statement, but it's not filling the $where_clause variable.

 

I want to get this figured out ASAP...as people are having problems. Just to clairfy, my version on a clean install of both Family Products v3.1 and MS2 works great. No problems.

 

 

On the product with an ID of '17263'....how many families does that product currently belong to?

 

-Chris

Chris Sullivan

Link to comment
Share on other sites

ok also i am not clear on how to use this contrib

 

i assigned a bunch of accessories to a family called "accessories"

 

what is the next step...

Once you create a family....you must also include a product. Once this "product" is clicked on and the products_info.php file is called, the family of products will show below.

 

With what you have set up now....you would simply need to click on an accessory already found in the family, and you will see the family show up below.

 

HTH,

-Chris

Chris Sullivan

Link to comment
Share on other sites

still:

 

1064 - You have an error in your SQL syntax near ') and p.products_id = pf.products_id and p.products_id != '31' limit 9' at line 1

 

select distinct p.products_id, p.products_image, p.products_tax_class_id, if(s.status, s.specials_new_products_price, p.products_price) as products_price from products_families pf, products p left join specials s on p.products_id = s.products_id where p.products_status = '1' and () and p.products_id = pf.products_id and p.products_id != '31' limit 9

 

 

I got the message for products with no family. So what to do?

 

Torsten

Link to comment
Share on other sites

To be perfectly honest guys....not really sure. I have tried it on a clean MS2.2 install and everything works fine for me. I have also tried it on a modified install and that also works.

 

 

Give me some time to try and figure it out.

-Chris

Chris Sullivan

Link to comment
Share on other sites

I am getting this error when I try to run family_products_3.sql:

SQL-query : 

 

CREATE TABLE `products_families` (

 

`family_id` SMALLINT( 3 ) NOT NULL ,

 

`products_id` SMALLINT( 3 ) NOT NULL ,

 

)

 

MySQL said:

 

 

You have an error in your SQL syntax near ')' at line 4

 

I am using the corrected 3.1 version, and running 2.2 MS2. Thanks!

Link to comment
Share on other sites

I am getting this error when I try to run family_products_3.sql:
SQL-query :?

 

CREATE TABLE `products_families` (

 

`family_id` SMALLINT( 3 ) NOT NULL ,

 

`products_id` SMALLINT( 3 ) NOT NULL ,

 

)

 

MySQL said:

 

 

You have an error in your SQL syntax near ')' at line 4

 

I am using the corrected 3.1 version, and running 2.2 MS2. Thanks!

Just tried it again and the .sql file works just fine. Make sure you are using the most current version of phpMyAdmin

Chris Sullivan

Link to comment
Share on other sites

1064 - You have an error in your SQL syntax near ') and p.products_id = pf.products_id and p.products_id != '31' limit 9' at line 1

select distinct p.products_id, p.products_image, p.products_tax_class_id, if(s.status, s.specials_new_products_price, p.products_price) as products_price from products_families pf, products p left join specials s on p.products_id = s.products_id where p.products_status = '1' and () and p.products_id = pf.products_id and p.products_id != '31' limit 9

 

Could the problem be with how many products are avaliable? It doesn't look like it should but I can't figure out what is wrong. I will try to install it over again and see if that fixs the problem.

 

Please keep us up to date concerning any fixes.

 

Thank you

Moneer

Link to comment
Share on other sites

Thanks, Chris. I went ahead and manually added that table. Now I'm getting some other errors. First, when I click on "Families" in the Admin section, the link is to "FILENAME_MODIFY_FAMILIES" instead of modify_families.php, and the same thing for assign_families.php, select_family_display.php, and view_families.php.

 

Secondly, when I manually change the link to assign_families.php I get this error:

 

1146 - Table 'catdb.TABLE_FAMILIES' doesn't exist

 

select family_id, family_name from TABLE_FAMILIES order by family_name ASC

 

[TEP STOP]

 

When I look at my database, however, both tables, 'families' and 'products_families' are there.

 

Help! Thanks!

Link to comment
Share on other sites

Okay, nevermind. I fixed it -- the error was due to placement of some un-related code in application_top.php. I have no idea why Families was affected, because I didn't even touch that file, but anyway it's working beautifully now! Thanks so much for your help, Chris! This is a great mod and you're very kind to respond to questions here!

Link to comment
Share on other sites

1064 - You have an error in your SQL syntax near ') and p.products_id = pf.products_id and p.products_id != '31' limit 9' at line 1

select distinct p.products_id, p.products_image, p.products_tax_class_id, if(s.status, s.specials_new_products_price, p.products_price) as products_price from products_families pf, products p left join specials s on p.products_id = s.products_id where p.products_status = '1' and () and p.products_id = pf.products_id and p.products_id != '31' limit 9

 

Could the problem be with how many products are avaliable? It doesn't look like it should but I can't figure out what is wrong. I will try to install it over again and see if that fixs the problem.

 

Please keep us up to date concerning any fixes.

 

Thank you

Moneer

This is only going to be an issue if you have a product assigned to more than 1 family.

 

Is this what you are currently working with?

 

Thanks,

-Chris

Chris Sullivan

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

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...