Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

family 3.0 problems


sgflowers

Recommended Posts

  • Replies 146
  • Created
  • Last Reply

Top Posters In This Topic

INFOPAGES UNLIMITED / WYSIWYG mod help

 

Hi,

 

I must be dumb as bricks but I have copied and pasted the information_manager.php and infomation_form.php and I still get the regular text box. I even added to the database a fields for it like other areas like email etc.

 

What am I doing wrong?

 

Any help is greatly appreciated.

 

Thanks

Link to comment
Share on other sites

Hallo Snopy23,

 

welche Fragen hast Du denn?

 

Gru?, Michael

Hi Michael,

 

ich w?rde gerne wissen wie die Contri allgeimein Funktioniert.

Habe Sie eingebaut, kann im Admin BEreich auch einiges einstellen, aber irgendwie bie Bez?ge fehlen mir.

Ich kann irgendwie keine Familien gr?nden.

 

gru?

snopy23

Link to comment
Share on other sites

  • 3 weeks later...

By uploading the revised family_products.php that was listed earlier (to get rid of the SQL error) - I was successful in seeing the error go away.

 

However, I am still getting this one error, and no listing of a family "box":

 

Parse error: parse error, unexpected T_VARIABLE in

......./includes/modules/family_products.php on line 21

 

any ideas?

Rick Weiss

Link to comment
Share on other sites

  • 2 weeks later...

To remove items is not impossible. It just take a little MySQL knowhow. You can manually go into the table Product_Family and remove the items you do not want in the family anymore. But you are likely to hose things up if you are not carefull so this is not something for the timid.

 

If you have an understanding of MySQL in the least is should be something that can be done with great ease.

 

As with any contribution, this one is a good one. But before you muck with your database tables. BACKUP BACKUP BACKUP!

Link to comment
Share on other sites

  • 3 weeks later...

General Question:

 

is it possible with Family Products 3.3 to create "Subfamilys"...

 

 

Exemple:

 

 

In Product Family A_products

 

I have products A_prod1, A_prod2, A_prod3

 

 

Now I have an accessories family for the product family A_products called A_accessories

 

I have following accessories A_acc1, A_acc2, A_acc3 and so on...

 

 

 

Now is it possible not to show family products under A_prod1 but to show the accessories available for the Product Family A_products?

 

 

I think thats very interesting, because I couldn't find any contribution yet that could help me with this issue, but I think Family Products is very close to that respectively it already is able to do that?

 

 

 

 

:blink:

Link to comment
Share on other sites

I installed the latest version family products ver(3.3)...it appeared to work, until I went into the database to delete some items, seeing there was no way to delete or update families from admin.

 

Now, I get this error in a product info page that is not assigned to a family:

 

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

 

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

 

 

I deleted the databases and tried again, but still get this, so I assume no other databases are touched other than the tables added in the mod.

Any help on this?

 

thanks

Link to comment
Share on other sites

  • 1 month later...

Hi

 

Thanks for a very useful contribution. I installed 3.3 and had no problems so thanks to the author.

 

I was wondering if anyone has made an infobox for the families. What I would like to do is have an extra box, very similar to the categories box but showing the families instead, and linking to a product listing page showing the items in a family.

 

If anyone has done this already I'd appreciate it if they would share their code. If not, well I'll give it a go myself (but I fear it may be beyond me).

 

Tim

Link to comment
Share on other sites

This is just a QUiCK response to your request:

 

Create a file in your main directory and call it 'families.php' and insert this code:

<?php
/*
 $Id: products_new.php,v 1.27 2003/06/09 22:35:33 hpdl Exp $

 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License
*/

 require('includes/application_top.php');

 require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_PRODUCTS_NEW);

 $breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_PRODUCTS_NEW));
?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<title><?php echo TITLE; ?></title>
<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
<link rel="stylesheet" type="text/css" href="stylesheet.css">
</head>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">
<!-- header //-->
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->

<!-- body //-->
<table border="0" width="100%" cellspacing="3" cellpadding="3">
 <tr>
   <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">
<!-- left_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
<!-- left_navigation_eof //-->
   </table></td>
<!-- body_text //-->
   <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0">
     <tr>
       <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
         <tr>
           <td class="pageHeading"><?php $fam_name = tep_db_query("select family_name from " . TABLE_FAMILIES . " where family_id = '" . (int)$_GET['fam_id'] . "'"); $fam_name_results = tep_db_fetch_array($fam_name); echo $fam_name_results['family_name']; ?></td>
           <td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_products_new.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
         </tr>
       </table></td>
     </tr>
     <tr>
       <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
     </tr>
<?php
 $products_new_array = array();

 $products_new_query_raw = "select p.products_id, pd.products_name, p.products_image, p.products_price, p.products_tax_class_id, p.products_date_added, m.manufacturers_name from " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on (p.manufacturers_id = m.manufacturers_id), " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_FAMILIES . " pf where p.products_status = '1' and p.products_id = pd.products_id and pd.products_id = pf.products_id and pf.family_id = '" . (int)$_GET['fam_id'] . "' and pd.language_id = '" . (int)$languages_id . "' order by p.products_date_added DESC, pd.products_name";
 $products_new_split = new splitPageResults($products_new_query_raw, MAX_DISPLAY_PRODUCTS_NEW);

 if (($products_new_split->number_of_rows > 0) && ((PREV_NEXT_BAR_LOCATION == '1') || (PREV_NEXT_BAR_LOCATION == '3'))) {
?>
     <tr>
       <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
         <tr>
           <td class="smallText"><?php echo $products_new_split->display_count(TEXT_DISPLAY_NUMBER_OF_PRODUCTS); ?></td>
           <td align="right" class="smallText"><?php echo TEXT_RESULT_PAGE . ' ' . $products_new_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?></td>
         </tr>
       </table></td>
     </tr>
     <tr>
       <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
     </tr>
<?php
 }
?>
     <tr>
       <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
<?php
 if ($products_new_split->number_of_rows > 0) {
   $products_new_query = tep_db_query($products_new_split->sql_query);
   while ($products_new = tep_db_fetch_array($products_new_query)) {
     if ($new_price = tep_get_products_special_price($products_new['products_id'])) {
       $products_price = '<s>' . $currencies->display_price($products_new['products_price'], tep_get_tax_rate($products_new['products_tax_class_id'])) . '</s> <span class="productSpecialPrice">' . $currencies->display_price($new_price, tep_get_tax_rate($products_new['products_tax_class_id'])) . '</span>';
     } else {
       $products_price = $currencies->display_price($products_new['products_price'], tep_get_tax_rate($products_new['products_tax_class_id']));
     }
?>
         <tr>
           <td width="<?php echo SMALL_IMAGE_WIDTH + 10; ?>" valign="top" class="main"><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products_new['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $products_new['products_image'], $products_new['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a>'; ?></td>
           <td valign="top" class="main"><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products_new['products_id']) . '"><b><u>' . $products_new['products_name'] . '</u></b></a><br>' . TEXT_DATE_ADDED . ' ' . tep_date_long($products_new['products_date_added']) . '<br>' . TEXT_MANUFACTURER . ' ' . $products_new['manufacturers_name'] . '<br><br>' . TEXT_PRICE . ' ' . $products_price; ?></td>
           <td align="right" valign="middle" class="main"><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCTS_NEW, tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $products_new['products_id']) . '">' . tep_image_button('button_in_cart.gif', IMAGE_BUTTON_IN_CART) . '</a>'; ?></td>
         </tr>
         <tr>
           <td colsp?an="3"><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
         </tr>
<?php
   }
 } else {
?>
         <tr>
           <td class="main"><?php echo TEXT_NO_NEW_PRODUCTS; ?></td>
         </tr>
         <tr>
           <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
         </tr>
<?php
 }
?>
       </table></td>
     </tr>
<?php
 if (($products_new_split->number_of_rows > 0) && ((PREV_NEXT_BAR_LOCATION == '2') || (PREV_NEXT_BAR_LOCATION == '3'))) {
?>
     <tr>
       <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
         <tr>
           <td class="smallText"><?php echo $products_new_split->display_count(TEXT_DISPLAY_NUMBER_OF_PRODUCTS); ?></td>
           <td align="right" class="smallText"><?php echo TEXT_RESULT_PAGE . ' ' . $products_new_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?></td>
         </tr>
       </table></td>
     </tr>
<?php
 }
?>
   </table></td>
<!-- body_text_eof //-->
   <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">
<!-- right_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_right.php'); ?>
<!-- right_navigation_eof //-->
   </table></td>
 </tr>
</table>
<!-- body_eof //-->

<!-- footer //-->
<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
<!-- footer_eof //-->
<br>
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

 

And create a file in your /catalog/includes/boxes/ directory and call it 'famillies.php' and insert this code:

<?php
/*
 $Id: whats_new.php,v 1.31 2003/02/10 22:31:09 hpdl Exp $

 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License
*/

$families_query = tep_db_query("select * from " . TABLE_FAMILIES . " order by family_name desc");
if (tep_db_num_rows($families_query) > '0') {
?>
<!-- whats_new //-->
         <tr>
           <td>
<?php

   $info_box_contents = array();
   $info_box_contents[] = array('text' => 'Families');

   new infoBoxHeading($info_box_contents, false, false, tep_href_link('families.php'));

while ($families = tep_db_fetch_array($families_query)) {
$text .= '<a href="' . tep_href_link('families.php', 'fam_id=' . $families['family_id']) . '">' . $families['family_name'] . '</a><br>';
}
   $info_box_contents = array();
   $info_box_contents[] = array('align' => 'left',
                                'text' => $text);
   new infoBox($info_box_contents);

?>
           </td>
         </tr>
<!-- whats_new_eof //-->
<?php
 }
?>

 

And add this line to your column_left.php or column_right.php file:

  require(DIR_WS_BOXES . 'families.php');

 

 

Hope this helps someone,

-Chris

Chris Sullivan

Link to comment
Share on other sites

Chris

 

Thankyou very much. That is exactly what I was after. A few visual tweaks and I'm in business.

 

If you release another families contribution that would be ideal to be included as an optional extra.

 

Thanks again

 

Tim

Link to comment
Share on other sites

No problem. I will tell you that what I included is not up to par with osC standards, and code will need to be changed should you choose to utilize the standards in the coding process.

 

I want to make a newer version of family products. I'm just really busy right now.....but keep an eye out for it.

 

Thanks,

-Chris

Chris Sullivan

Link to comment
Share on other sites

Just wanted to say this is a brilliant contribution... really a must-have.

 

Quick question: as far as I can tell, Select Family Display is just a shortcut to the configuration group, yes? Or does it do something else I'm missing?

 

Traveling for a week, but when I get back, I'll look into adding some admin muscle to this fantastic contribution. Things I'll need/work on:

 

+ better assign family interface (I'll probably use this Javascript)

 

+ edit/remove products from previously created families

 

+ show family links on Admin product info page

Link to comment
Share on other sites

oldmoney

 

That form swapper looks like a really good way of doing it. I have been working on a better admin side as well but I think your version will be far better if you utilise that.

 

One very quick mod I can share with you is this. To display the "view families" information in the "modify families" page (effectively making the view families page obsolete) do this:

 

Changes to modify_families.php

-------------------------------------

Find:

        break;
     case 'assign_product':

Just BEFORE this add:

            $heading1[] = array('text' => TEXT_CONTENTS);
     $family_products_query = tep_db_query("select distinct products_id from " . TABLE_PRODUCTS_FAMILIES . " where family_id = '" . $f_Info->family_id . "'");
    while ($family_products = tep_db_fetch_array($family_products_query)) {
   $contents1[] = array('align' => 'left', 'text' => tep_get_products_name($family_products['products_id']));
    }

 

Find:

        break;
    case 'delete_family':

Just BEFORE it add:

            $heading1[] = array('text' => TEXT_CONTENTS);
     $family_products_query = tep_db_query("select distinct products_id from " . TABLE_PRODUCTS_FAMILIES . " where family_id = '" . $f_Info->family_id . "'");
    while ($family_products = tep_db_fetch_array($family_products_query)) {
   $contents1[] = array('align' => 'left', 'text' => tep_get_products_name($family_products['products_id']));
    }

 

Find:

      $box = new box;
     echo $box->infoBox($heading, $contents);

And add AFTER it:

      $box1 = new box;
     echo $box1->infoBox($heading1, $contents1);

 

Changes to admin/languages/english/modify_families.php

-------------------------------------------------------------------

Add:

define('TEXT_CONTENTS', '<b>Contents</b>');

 

Hope this works.

Link to comment
Share on other sites

  • 1 month later...

Any chance of a latest version (package) which is "complete" ?

 

I somehow managed to mess up the installatoin even though it's only two update files.

 

Also because there are so many include folders and so on, it would be great to have a true mirror of the file structure for where these files go.

 

And as I'm such a dummy, are there any more detailed instructions on the database part.

I ran the family.sql query and it said it had done what it should.

(What shoud I be looking for in the database to confirm installation?)

 

But when I ran my cart I got lots of No field type alerts.

Sorry fo rthe vagueness, but when it didn't work I decided to restore and wait till I knew more about what I was doing.

 

I'm not normaly such a moron :huh: but I could do with a little hand holding here ;-)

 

It seems exactly what I need so it would be great to sort this out!

Link to comment
Share on other sites

  • 1 month later...

I feel really dumb here, everything went in ok, no sql errors, no php errors.

 

I did a clean install of osc ms2 and just copied over the files in your last updated contribution. Which from what I understand was all you needed to do. Updated the sql.

 

Everything runs great ..... but...... here it comes

 

when you click on a product the family product has made everything between head and foot shift left and leave a big space on the right after the right column. This is on my test server so I can't show you it. Any clues as to why? Like I said this is clean install I have done nothing but copy over the files and update the sql.

 

Kel

I live in my own little world. But it's OK. They know me here.

Link to comment
Share on other sites

any one have a clue as to what this means and how I fix it......looked through the thread and didn't find anything about it.

 

 

Warning: Failed opening 'includes/modules/FAMILY_PRODUCTS' for inclusion (include_path='.;C:\IBserver\php\includes;C:\IBserver\php\pear') in c:\ibserver\www\product_info.php on line 269

 

Kel

I live in my own little world. But it's OK. They know me here.

Link to comment
Share on other sites

I got it to work :) :D

 

After 3 days, and fiddeling around I got it to work in both list and box format. I even got the top of the info box to say "Don't forget about these" .

 

This is on my test server...so here is crossing my fingers, toes and eyes that it works when I update to my live store.

 

Thank You so Much Chris for this really great contribution. I look forward to any updates you have time to crank out.

 

Kel

I live in my own little world. But it's OK. They know me here.

Link to comment
Share on other sites

After a few days of working with this contribution I thought it would be really nice to have more than 10 items assigned to the family. As limited as I am with php and sql I played around a bit and discovered that it was very easy to tweek the

 

admin/assign_families.php

 

to give you more item imput.

 

1. Look for this section of code it will be at the top of the page after the copyright stuff

 

require('includes/application_top.php');

 

  $action = (isset($HTTP_GET_VARS['action']) ? $HTTP_GET_VARS['action'] : '');

 

  if (tep_not_null($action)) {

    switch ($action) {

      case 'update_family':

        if (isset($HTTP_POST_VARS['family_id'])) $family_id = tep_db_prepare_input($HTTP_GET_VARS['family_id']);

 

    for ($i=1; $i < '11'; $i++) {

    if ($HTTP_GET_VARS['prod_selected' . $i] != '')

 

You see this line

 

for ($i=1; $i < '11'; $i++)

 

The big blue number is the one you want to change to match how many inserts you want.

 

Next

 

To make more pull downs to insert the added items find the section that has a list of code like this

 

echo "     " . tep_get_product_list('prod_selected1') . '<br>';

 

just past that line in below the last one which is prod-select10 for how many more you want and correct the number and save, And you now can have more items in your family.

 

Kel

I live in my own little world. But it's OK. They know me here.

Link to comment
Share on other sites

  • 2 weeks later...

I don't have SEF URLs turned on and it still doesn't show any family products - it is blank. So I put my backup copy back on (catalog with family_products 2....) cause I really don't have time to mess with this right now, and it still doesn't show any.

Any idea where the problem might be? This is family_products_3_3 that I'm trying to work with.

Link to comment
Share on other sites

I've actually got a newer, MUCH BETTER, version of this. The admin is SO much easier to use (all changes happen in one page). You can have as many products assigned to the main product as you'd like, and you can select the "family products" via product name or model number (model # shown in pic). The database modifications have been cleaned up as well.

fam4.png

Unfortunately, due to client contracts, I can not release it to the community as a contribution. If anyone is interested, however, you can email me directly and we can work something out.

 

I know that the current version released in the contributions section has some problems, and for that I'm sorry.

 

kincht-as for your problem, I'm not sure why they aren't showing. I would suggest you check your database to ensure that the families actually exist as you've set them up, and then I would probably suggest reinstalling the product_info part of the contribution. Let me know what happens.

 

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