Jump to content
Sign in to follow this  
sgflowers

family 3.0 problems

Recommended Posts

As far as I know, I don't have any products assigned to more than one family. I will check to see if there are any by mistake. I hope that is the reason.

 

THanks

Moneer

Share this post


Link to post
Share on other sites

Great Contrib!

 

I get also the following error on a fresh 2.2MS installation with the family contrib

 

1064 - You have an error in your SQL syntax near ') and p.products_id = pf.products_id and p.products_id != '17' 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 != '17' limit 9

 

 

I figured out, that there is no check in the family_products.php that make's sure that the family_name_query dont return a false value. That will result in the above error.

 

To prevent that, you must put a "if ($family_id > 0)" in the corresponding place. I've dont checked this further, so correct me if I'm wrong.

Edited by fragp

Share this post


Link to post
Share on other sites

I've added four "if (tep_db_num_rows($family_name_query) > 0)"?s to the family_products.php and tested it in all variations. Worked fine.

 

Get the updated file here.

Edited by fragp

Share this post


Link to post
Share on other sites

I have tried to copy the file that you have posted to catalog/includes/modules/family_products.php .

 

But I have no luck. I am still getting the same error?

 

Thanks

Share this post


Link to post
Share on other sites

Nice work.

 

How about the ability to add a Family as an Family Product? I think, in that way its possible to get a nice accessories management.

 

But more important: Why I can add only 20 products to one family? Please, make it possible to edit an already added family, so that i dont have to mark all the products again, if chaning just one. Thanks!

Share this post


Link to post
Share on other sites

Hey again. I've tested v3.3 and get again the following error when I look at a article that doenst belong to a family:

 

1064 - You have an error in your SQL syntax near ') and p.products_id = pf.products_id and p.products_id != '28' 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 != '28' limit 9

 

My previosly mentioned fix worked, again, fine.

Share this post


Link to post
Share on other sites

I will be adding some more functionality as time permits. I know that I left out the ability to delete and/or edit families. I just wanted to get a "working" version out asap.

 

I will be adding some more features as I have the time. Please feel free to include ideas for future releases....

 

fragp - I tried your fix, and it didn't fix the problem in the code. I had to make some actual changes to how the code executes in order to get it to work.

 

You shouldn't have any errors...or anything for that matter...showing up on products that have not been assigned to a family in the admin section.

 

Thanks,

-Chris


Chris Sullivan

Share this post


Link to post
Share on other sites

I've tried to update this contribution so that I can use the Family Name instead of the default header text, but it's not working. I added the new stuff from the SQL file and I made the changes in all of the other files, but my families are still showing up with "Family Products v3.0" in the header. Chris, can you give me some idea of where I might be going wrong?

 

Also, in response to your other post, my site is kind of a mess right now but I'll be happy to let you know when it's ready for public consumption! Thank you!

Share this post


Link to post
Share on other sites

I also get the same sql error as fragp on a first install of this contrib - it works great for products that have been assigned a family but errors on products that have no family...

 

any idea where in the inclues/modules/family_products.php this error can be fixed?

Share this post


Link to post
Share on other sites

Helen - you must change the header text format in the new admin option. Have you tried this?

 

daithi and fragp - Let me check on that for you. Did you replace your old family_products.php file with the new one? I installed it 3 times on 3 new clean installs of osC last night and everything works perfectly.

 

Let me know,

-Chris


Chris Sullivan

Share this post


Link to post
Share on other sites
Hey again. I've tested v3.3 and get again the following error when I look at a article that doenst belong to a family:

 

1064 - You have an error in your SQL syntax near ') and p.products_id = pf.products_id and p.products_id != '28' 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 != '28' limit 9

 

My previosly mentioned fix worked, again, fine.

Getting same error 3.3 install familty products

 

1064 - You have an error in your SQL syntax near ') and p.products_id = pf.products_id and p.products_id != '' 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 != '' limit 9

 

 

any fix chris??

Share this post


Link to post
Share on other sites

Chris, I changed the Family Header Format setting from "Family Text" to "Family Name" in the Admin Configuration and Families menus. I also removed any text from the Header Text field, but the heading is still showing up as "Family Products v3.0" instead of "Test Family". Thanks again for helping, Chris!

Share this post


Link to post
Share on other sites

if was a first install for me so didn't have to replace the family_products.php.

 

the fix that frap posted on the previous page worked for me.

Also, is this supposed to replace the also purchased all together - it doesn't show up an any of my pages including those withut a family anymore?

Share this post


Link to post
Share on other sites

helen- Let me check it out today for you.

 

daithi - Yes, it does replace the Also Purchased box.

 

I really don't understand why it all works perfect for me, and not for you guys, but I will get to the bottom of it.

 

Thanks,

-Chris


Chris Sullivan

Share this post


Link to post
Share on other sites

I am getting the same error if setting is set to "random" in admin, error only shows on items that are not in a family. Works ok if setting in admin is set to "seperate".

 

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 != '88' 

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 != '88' limit 9

 

i think the problem is on line 33 of modules/family_products.php

 

But i not that knowedgable with php to find code errors.

 

Many Thanks

 

Carl

Share this post


Link to post
Share on other sites

Okay, I'm an idiot. Again, I have no idea what happened but I installed 3.3 from scratch and it worked. It's now working perfectly for me.

Share this post


Link to post
Share on other sites

Hi Chris,

 

I have two problems. One is new to this thread and the other is not. I am on a VERY custom version of osc but had absolutely no problems getting it installed and even tweaking it since I use a special version of dynamic mo pics... anyways, here are my 2 issues:

 

1- in the admin console, when I choose "Select Display" I get a javascript error. What this does is completely shifts the right hand column with the "edit" button off the screen so I can edit any values.... have you seen before of have any ideas?

 

2- I get the sql error others are getting when selecting a product that is not part of a family. now since the code defaults to a random display format, this supports the theory of one of the previous poster. I would like to test his theory by selecting the "seperate" display format to see of this works around the issue and possibly help troubleshoot but getting back to error #1, i can't change the display settings. Where are these values saved in the db? I looked in the configuration_gorup table but could not find where these configuration values were saved.

 

Just for reference, I have almost 40 contributions and much custom code working in a live store for over 6 months so I guess I am not what you would call "new" to this club! ;)

 

Any help would be greatly appreciated as I would love to move this off my test store and into production! Very cool and appropriate mod for my business!

 

B)

Share this post


Link to post
Share on other sites

I have just installed the Family Products v3.3 and all went well except for the admin section where i was not able to see the assign family option i received the error below

 

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

select family_id, family_name from TABLE_FAMILIES order by family_name ASC

[TEP STOP]

 

I have managed to fix this error by add the following code in the Admin/includes/application_top.php file..

  define('TABLE_FAMILIES', 'families');
 define('TABLE_PRODUCTS_FAMILIES', 'products_families');

 

Hope this helps anyone having trouble like had...

 

Otherwise Great Contribute.

thanks Chris.

Share this post


Link to post
Share on other sites

DId i Speak too soon.... :(

 

The Admin side works Fine with now but when i delete a Family group, it gets deleted in the admin section but in my catalog i still see the family group.. Seems like it does not delete from the database in the products_families table..

 

Can anyone assist me on this.

Share this post


Link to post
Share on other sites

any word on a resolution of this error:

 

CODE

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 != '88'

 

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 != '88' limit 9

Share this post


Link to post
Share on other sites

Could anyone assist me with the function to delete the family produts from the products_family TABLE.. As the products still show in my products info page.. I think it's got to do with the function in that admin/include/functions/database.php

// This deletes a family.
 function tep_remove_family($family_id) {
   tep_db_query("delete from " . TABLE_FAMILIES . " where family_id = '" . (int)$family_id . "'");
 }

 

I am no expert in php but i think this line above is just deleting the product family group rather than the product in the products_families table...

 

any help is much appreciate.

thanks

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
Sign in to follow this  

×