Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Contribution] Family Products-MS2


Guest

Recommended Posts

Matti-

 

I wanted to ask you.....does you current version allow products to be in more than one family?

 

Thanks,

-Chris

 

No it does not - that is something I have considered - I think it would be useful for many people.

Link to comment
Share on other sites

  • Replies 96
  • Created
  • Last Reply

Top Posters In This Topic

After I install this contribuition, I'm receiving errors.

 

I added a product that has attributes, so it goes to page "What's In My Cart?" but when I click in the image or in the link to see the description of the product, show te error below:

 

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 '{1}1' at line 1

 

select products_family from products where products_id = 1{1}1

 

[TEP STOP]

 

What can I do to correct this problem?

Link to comment
Share on other sites

What can I do to correct this problem?

 

Ok - you have found a bug :?

 

Here is the fix 8)

 

In product_info.php replace:

 

$currentid = $HTTP_GET_VARS['products_id'];

$family_query = tep_db_query("select products_family from " . TABLE_PRODUCTS . " where products_id = " . $currentid . "");

 

with:

 

 

$family_query = tep_db_query("select products_family from " . TABLE_PRODUCTS . " where products_id =  '" . (int)$HTTP_GET_VARS['products_id'] . "'");

 

....and in family_products.php from line 19 replace:

 

$currentid = $HTTP_GET_VARS['products_id'];

$family_query = tep_db_query("select products_family from " . TABLE_PRODUCTS . " where products_id = " . $currentid);

 

with:

 

$family_query = tep_db_query("select products_family from " . TABLE_PRODUCTS . " where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "'");

 

and on line 66 replace:

 

      $family_sql = "select p.products_id,  p.manufacturers_id, p.products_model, p.products_image, p.products_tax_class_id, pd.products_name, s.specials_new_products_price, s.status, p.products_price, p.products_family, m.manufacturers_name from ". TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_id = pd.products_id and p.products_family = '" . $thisquery['products_family'] . "' and p.products_id = pd.products_id  and p.manufacturers_id = m.manufacturers_id and p.products_status = '1' and pd.language_id = '" . (int)$languages_id . "'";

 

with:

 

      $family_sql = "select p.products_id,  p.manufacturers_id, p.products_model, p.products_image, p.products_tax_class_id, pd.products_name, s.specials_new_products_price, s.status, p.products_price, p.products_family, m.manufacturers_name from ". TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_id !=" . (int)$HTTP_GET_VARS['products_id'] . " and p.products_id = pd.products_id and p.products_family = '" . $thisquery['products_family'] . "' and p.manufacturers_id = m.manufacturers_id and p.products_status = '1' and pd.language_id = '" . (int)$languages_id . "'";

 

I will update the contribution files today :wink:

Link to comment
Share on other sites

Thanks, now is perfect.

 

Did you that the prase: Displaying 1 to 1 (of 1 products) Result Pages: 1 display twice in the product info?

 

Family Products:

Displaying 1 to 1 (of 1 products) Result Pages: 1

Model Product Name+ Price Buy Now

MG400-32MB Matrox G400 32MB $499.99

Displaying 1 to 1 (of 1 products) Result Pages: 1

Link to comment
Share on other sites

Thanks, now is perfect.

 

Did you that the prase: Displaying 1 to 1 (of 1 products) Result Pages: 1 display twice in the product info?

 

Family Products:

Displaying 1 to 1 (of 1 products) Result Pages: 1

Model Product Name+ Price Buy Now

MG400-32MB Matrox G400 32MB $499.99

Displaying 1 to 1 (of 1 products) Result Pages: 1

 

You can configure it in admin>configuration>Family Products>Location of Previous/Next Navigation Bar - set it to 1 to display it at the top, 2 at the bottom, and 3 for both

Link to comment
Share on other sites

You can configure it in admin>configuration>Family Products>Location of Previous/Next Navigation Bar - set it to 1 to display it at the top, 2 at the bottom, and 3 for both

 

Thank you :D

Link to comment
Share on other sites

It seems that the "TEXT_NO_PRODUCTS" issue has not been solved yet. As previously mentionned by others, I do not see the familiy listing in the product_info.php page...

 

Please HELP

 

(MS2)

 

Are you using the latest updated files?

 

Please make sure that your installation has the trans_sid settings found the .htaccess file in the package

Link to comment
Share on other sites

and I am still getting the problem. I don't understand, there's not a lot of code to pour over and yet I can't find any discrepencies.

 

There is a bit of redundant code that *should* be passed over when parsed, but in some installations there seems to be a problem. I will update the files this weekend, removing any excess fat and see if this may help.

 

Aezalpha has in fact solved the problem, but has not posted the solution as yet.

Link to comment
Share on other sites

OS MS2 from July 2003

I have installed Family Products Update2

I do have the .htaccess mentionned

 

-> still have the TEXT_NO_PRODUCT mentionned

 

I have tried a lot of things :

- changing the script position in the product_info.php page

- reduced the number of search results from 20 to 2

- changed the family name as a category name

- checked that it was inserted in my DB

- ...

 

-> still have the TEXT_NO_PRODUCT mentionned

 

 

I believe that a lot of us share the same problem issue.

 

Any fix ?

Link to comment
Share on other sites

Hi peeps,

 

I'm not sure if I have a solid solution to the TEXT_NO_PRODUCTS problem. I had some time one night and decided to look further into the problem. I suspect that it might have been the order of the things that were installed. For the initial setup, I did things in this order:

 

1. Installed MS2

2. Installed Family Products mod

3. Added sample products

4. Added Traditional Chinese mod

 

At some point osC must have gotten confused, and gave me the TEXT_NO_PRODUCTS error.

 

Anyway, when I went back to look at it after Matti made his lastest updates, I went through each file and did a "diff" to manually go through it to see what was updated. Here's what I did...

 

1. Uploaded new files and renamed them

2. Cross-checked new SQL file and fields from last install...no changes.

3. Did "diff" on old and new PHP files. Put in new updates. Took out some "^M" that snuck into some of the files.

4. Tested and Family Products didn't work with original sample products.

5. Deleted original family and original sample products.

6. Added new sample products and new family.

7. Attached new sample products to new family.

8. The mod magically worked! :)

 

So, like I said, I don't have any solid fix for the problem (I didn't change any important code in any of the files). But maybe this would help in giving a little direction. :D Feel free to post or send me a PM if you're still stuck...I'll try to help the best I can.

 

Thanks,

aezalpha

Link to comment
Share on other sites

I have found that $family_sql in catalog/includes/modules/family_products.php needs to be modified to fit your business. I don't use the manufacturer's fields or any references to it because it's not important for what I do. Upon taking those out, the query started to work. I believe the problem lies in the manufacturer's data pull, but can't be sure. I stopped trying to figure out what went wrong when it started to work for me. But it definitely is within the following:

 

$family_sql = "select p.products_id, p.manufacturers_id, p.products_model, p.products_image, p.products_tax_class_id, pd.products_name, s.specials_new_products_price, s.status, p.products_price, p.products_family, m.manufacturers_name from ". TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_id !=" . (int)$HTTP_GET_VARS['products_id'] . " and p.products_id = pd.products_id and p.products_family = '" . $thisquery['products_family'] . "' and p.manufacturers_id = m.manufacturers_id and p.products_status = '1' and pd.language_id = '" . (int)$languages_id . "'";

 

Hope this helps isolate the problem.

 

Kepa

Link to comment
Share on other sites

You're right ! It works now. The manufacturer sql was miessing up the whole query.

 

family_product.php -> just replace the old $family_sql query by :

 

$family_sql = "select p.products_id, p.products_model, p.products_image, p.products_tax_class_id, pd.products_name, s.specials_new_products_price, s.status, p.products_price, p.products_family from ". TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_id !=" . (int)$HTTP_GET_VARS['products_id'] . " and p.products_id = pd.products_id and p.products_family = '" . $thisquery['products_family'] . "' and p.products_status = '1' and pd.language_id = '" . (int)$languages_id . "'";

 

Thankx again

Link to comment
Share on other sites

Hi,

 

Anyone knows why do i get:

 

Family Products:

 

Warning: main(includes/modules/FILENAME_FAMILY_PRODUCTS): failed to open stream: No such file or directory in /home/ss/public_html/product_info.php on line 215

 

Warning: main(): Failed opening 'includes/modules/FILENAME_FAMILY_PRODUCTS' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/ss/public_html/product_info.php on line 215

 

 

??

 

Thanks in advance

Link to comment
Share on other sites

Antonio,

You need to specify the: FILENAME_FAMILY_PRODUCTS in your. includes/filenames.php

 

This is what you should add (or upload the file Matti supplied HOWEVER ONLY IN A FRESH INSTALL!)

 

// Family Products

 define('FILENAME_FAMILY_LISTING', 'family_listing.php');

 define('FILENAME_FAMILY_PRODUCTS', 'family_products.php');

// Family Products EOF

 

You can see the relation...PHP doesn't know what file to open unless you specify the definiton.

Link to comment
Share on other sites

Hi,

 

 

I solved the previous item.

 

Now i have an error message:

 

Fatal error: Cannot pass parameter 3 by reference in /home/ss/public_html/includes/modules/family_listing.php on line 17

 

Can anyone help me?

 

I?m not a php expert, and runnig 2.2CVS

 

Regards,

Fonseca

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