Jump to content
kymation

[Contribution] Products Specifications

Recommended Posts

In English is everything ok because reviews is only adding in polish language but change the language to Polish and click below links

http://www.sklep.emcmoda.pl/plaszcz-damski-k1045-p-30.html?language=pl

Edited by emcmoda

Share this post


Link to post
Share on other sites

Hi this works Jupi nice work

http://www.sklep.emcmoda.pl/products_filter.php?f5=50&sort=products_name

 

How select and add new files (panel admin)to sort Use Existing Database Field: example product atributes (size color etc)

 

BR

Michał

Edited by emcmoda

Share this post


Link to post
Share on other sites

Another bug. Looks like I put the wrong file in the distribution. For now, add the following to the bottom of includes/functions/products_specifications.php just before the last ?>

 

////
// Fill the table data fields in a comparison or category page with data from the existing osC fields
 function tep_fill_existing_fields( $products_id, $languages_id ) {
 	global $currencies, $cPath, $PHP_SELF;

   $columns_query_raw = "
             select
               p.products_id,
               pd.products_name,
               pd.products_description,
               p.products_quantity,
               p.products_model,
               p.products_image,
               p.products_price,
               p.products_weight,
               p.products_tax_class_id,
               m.manufacturers_name,
               IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price,
               IF(s.status, s.specials_new_products_price, p.products_price) as final_price
             from
               " . TABLE_PRODUCTS . " p
               join " . TABLE_PRODUCTS_DESCRIPTION . " pd
                 on (pd.products_id = p.products_id)
               left join " . TABLE_SPECIALS . " s
                 on (p.products_id = s.products_id)
               left join " . TABLE_MANUFACTURERS . " m
                 on (p.manufacturers_id = m.manufacturers_id)
             where
               p.products_id = '" . (int) $products_id . "'
               and pd.language_id = '" . (int) $languages_id . "'
           ";
   // print $columns_query_raw . "<br>\n";
   $columns_query = tep_db_query($columns_query_raw);
   $columns_array = tep_db_fetch_array($columns_query);

   $field_array = array();
   // Quantities may be used in columns or combination column
   $field_array['products_quantity'] = ($columns_array['products_quantity'] == '') ? TEXT_NOT_AVAILABLE : $columns_array['products_quantity'];

   $field_array['products_model'] = ($columns_array['products_model'] == '') ? TEXT_NOT_AVAILABLE : $columns_array['products_model'];

   $field_array['products_index_description'] = ($columns_array['products_index_description'] == '') ? TEXT_NOT_AVAILABLE : $columns_array['products_index_description'];

   $field_array['products_description'] = ($columns_array['products_description'] == '') ? TEXT_NOT_AVAILABLE : $columns_array['products_description'];

   $link_array = tep_get_link_data( $columns_array['products_id'] );
   $cPath_new = $link_array['cPath'];
   $category_name = $link_array['categories_name'];

   $parameters = 'cPath=' . $cPath_new . '&products_id=' . $columns_array['products_id'];
   $product_link = tep_href_link( FILENAME_PRODUCT_INFO, $parameters, 'NONSSL', true, true, $category_name, $columns_array['products_name'] );

   $field_array['products_image'] = '<a href="' . $product_link . '">' . tep_image(DIR_WS_IMAGES . $columns_array['products_image'], $columns_array['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a>';

   $field_array['products_name'] = ($columns_array['products_name'] == '') ? TEXT_NOT_AVAILABLE : '<a href="' . $product_link . '">' . $columns_array['products_name'] . '</a>';

   if (tep_not_null($columns_array['specials_new_products_price'])) {
     $field_array['products_price'] = '<s>' . $currencies->display_price($columns_array['products_price'], tep_get_tax_rate($columns_array['products_tax_class_id'])) . '</s><br><span class="productSpecialPrice">' . $currencies->display_price($columns_array['specials_new_products_price'], tep_get_tax_rate($columns_array['products_tax_class_id'])) . '</span>';
   } else {
     $field_array['products_price'] = $currencies->display_price($columns_array['products_price'], tep_get_tax_rate($columns_array['products_tax_class_id']));
   }

   $field_array['final_price'] = $currencies->display_price($columns_array['final_price'], tep_get_tax_rate($columns_array['products_tax_class_id']));

   if( $columns_array['price_in_cart_only'] == '1' ) {
     $field_array['products_price'] = '                <span class="smalltext">';

     $field_array['products_price'] .= '<script language="javascript"><!--' . "\n";
     $field_array['products_price'] .= 'document.write(\'' . '<a href="javascript:popupWindow(\\\'' . tep_href_link( FILENAME_POPUP_PRICE_IN_CART ) . '\\\')">' . TEXT_WHY_HIDE_PRICE . '</a>\');' . "\n";
     $field_array['products_price'] .= '//--></script>' . "\n";
     $field_array['products_price'] .= '<noscript>';
     $field_array['products_price'] .= '<a href="' . tep_href_link( FILENAME_POPUP_PRICE_IN_CART ) . '" target="_new">' . TEXT_WHY_HIDE_PRICE . '</a>';
     $field_array['products_price'] .= '</noscript>';
     $field_array['products_price'] .= '                </span>';

     $field_array['final_price'] = $field_array['products_price'];
   }

   $raw_weight = number_format($columns_array['products_weight'], 1);
   if ($raw_weight -floor($raw_weight) == 0) {
     $raw_weight = number_format($columns_array['products_weight'], 0);
   }
   $field_array['products_weight'] = ($raw_weight == 0.0) ? TEXT_NOT_AVAILABLE : $raw_weight;

   $field_array['manufacturers_name'] = ($columns_array['manufacturers_name'] == '') ? TEXT_NOT_AVAILABLE : $columns_array['manufacturers_name'];

   $field_array['buy_now'] = '              <div class="buttonSet" style="margin-left:10px;">
               <span class="buttonAction">' . tep_draw_hidden_field('products_id', $columns_array['products_id']) . tep_draw_button(IMAGE_BUTTON_IN_CART, 'cart', null, 'primary') . '</span>
             </div>';

   // Show Option/Attribute values if there are any
   $field_array['products_options'] =' ';
   $options_array = tep_get_products_attributes ($columns_array['products_id'], (int)$languages_id, $columns_array['products_tax_class_id']);
   if (is_array ($options_array) && count ($options_array) > 0) {
     $field_array['products_options'] = '';
     foreach( $options_array as $options ) {
       $field_array['products_options'] .= tep_select_attributes( $columns_array['products_id'], $options, $languages_id, $columns_array['products_tax_class_id'] );
     }
   }

   $field_array['popup_image'] = TEXT_NOT_AVAILABLE;
   $popup_query_raw = "
     select
       image
     from
       " . TABLE_PRODUCTS_IMAGES . "
     where
       products_id = '" . (int) $products_id . "'
   ";
   // print $popup_query_raw . "<br>\n";
   $popup_query = tep_db_query( $popup_query_raw );
   $popup_array = tep_db_fetch_array( $popup_query );

   if( tep_not_null( $popup_array[ 'image' ] ) ) {
     $field_array['popup_image'] = '<script language="javascript"><!--' . "\n";
     $field_array['popup_image'] .= 'document.write(\'<a href="javascript:popupWindow(\\\'' . tep_href_link (FILENAME_POPUP_IMAGE, 'pID=' . $columns_array['products_id']) . '\\\')">' . TEXT_POPUP . '</a>\');' . "\n";
     $field_array['popup_image'] .= '//--></script>' . "\n";
     $field_array['popup_image'] .= '<noscript>' . "\n";
     $field_array['popup_image'] .= '<a href="' . tep_href_link (DIR_WS_IMAGES . $columns_array['image']) . '" target="_blank">' . TEXT_POPUP . '</a>' . "\n";
     $field_array['popup_image'] .= '</noscript>' . "\n";
   }

   $discount_price_query_raw = "
     select
       pd.products_price,
       dd.discount
     from
       " . TABLE_PRODUCTS_DISCOUNT . " pd
       join " . TABLE_DISCOUNTS . " dd
         on dd.discounts_id = pd.discounts_id
     where
       pd.products_id = '" . (int) $products_id . "'
     order by
       dd.sort_order
   ";
   // print $discount_price_query_raw . "<br>\n";
   $discount_price_query = tep_db_query( $discount_price_query_raw );

   if( tep_db_num_rows( $discount_price_query ) > 0 ) {
   	$discount_price_id = 1;
     while( $discount_price = tep_db_fetch_array( $discount_price_query ) ) {
       $field_array['products_price' . $discount_price_id] = TEXT_NOT_AVAILABLE;
       $field_array['products_discount' . $discount_price_id] = 1;

       if( $discount_price[ 'products_price' ] != 0.0 && tep_not_null( $discount_price[ 'discount' ] ) ) {
         $field_array['products_price' . $discount_price_id] = $currencies->display_price($discount_price['products_price'], tep_get_tax_rate($columns_array['products_tax_class_id']));
         $field_array['products_discount' . $discount_price_id] = $discount_price[ 'discount' ];
       }

       $discount_price_id++;
     }
   }

   return $field_array;
 }

////
// Draw a table cell in a comparison table or alternate category page
 function tep_specification_table_cell( $specs_id, $products_id, $languages_id, $field_array, $specs_data ) {
   $products_specifications_query_raw = "
     select
       specification
     from
       " . TABLE_PRODUCTS_SPECIFICATIONS . "
     where
       specifications_id = '" . (int) $specs_id . "'
       and language_id = '" . (int) $languages_id . "'
       and products_id = '" . (int) $products_id . "'
     limit 1
    ";
    // print $products_specifications_query_raw . "<br>\n";
    $products_specifications_query = tep_db_query($products_specifications_query_raw);

    $products_specifications = tep_db_fetch_array($products_specifications_query);

    if ($products_specifications['specification'] == '') {
      $specs_data['specification'] = TEXT_NOT_AVAILABLE;
    } else {
      $specs_data['specification'] = $products_specifications['specification'];
    }

    // Get the data for the table cell, either from an existing column or from the specification
    switch ($specs_data['column_name']) {
      // If an existing column was selcted, use that data
      case 'products_quantity' :
                 $box_text = $field_array['products_quantity'];
                 $box_align = 'center';
                 break;

      case 'products_model' :
                 $box_text = $field_array['products_model'];
                 $box_align = 'center';
                 break;

      case 'products_image' :
                 $box_text = $field_array['products_image'];
                 $box_align = 'center';
                 break;

      case 'products_price' :
                 $box_text = $field_array['products_price'];
                 $box_align = 'right';
                 break;

      case 'final_price' :
                 $box_text = $field_array['final_price'];
                 $box_align = 'right';
                 break;

      case 'products_weight' :
                 $box_text = $field_array['products_weight'];
                 $box_align = 'center';
                 break;

      case 'products_options' :
                 $box_text = $field_array['products_options'];
                 $box_align = 'center';
                 break;

      case 'manufacturers_id' :
                 $box_text = $field_array['manufacturers_name'];
                 $box_align = 'center';
                 break;

      case 'products_name' :
                 $box_text = $field_array['products_name'];
                 $box_align = 'center';
                 break;

      case 'products_description' :
                 $box_text = stripslashes( stripslashes( $field_array['products_description'] ) );
                 break;

      case 'products_index_description' :
                 $box_text = stripslashes( stripslashes( $field_array['products_index_description'] ) );
                 break;

      case 'buy_now' :
                 $box_text = '<span style="font-size:0.8em;">' . $field_array['buy_now'] . '</span>';
                 $box_align = 'center';
                 break;

      case 'combi' : // Contents of this column are set globally in the Admin Config
                 $combi_components = array ();
                 if (SPECIFICATIONS_COMBO_MODEL > 0)
                   $combi_components[sPECIFICATIONS_COMBO_MODEL] = $field_array['products_model'];
                 if (SPECIFICATIONS_COMBO_IMAGE > 0)
                   $combi_components[sPECIFICATIONS_COMBO_IMAGE] = $field_array['products_image'];
                 if (SPECIFICATIONS_COMBO_PRICE > 0)
                   $combi_components[sPECIFICATIONS_COMBO_PRICE] = $field_array['products_price'];
                 if (SPECIFICATIONS_COMBO_WEIGHT > 0)
                   $combi_components[sPECIFICATIONS_COMBO_WEIGHT] = $field_array['products_weight'];
                 if (SPECIFICATIONS_COMBO_MFR > 0)
                   $combi_components[sPECIFICATIONS_COMBO_MFR] = $field_array['manufacturers_name'];
                 if (SPECIFICATIONS_COMBO_NAME > 0)
                   $combi_components[sPECIFICATIONS_COMBO_NAME] = $field_array['products_name'];
                 if (SPECIFICATIONS_COMBO_BUY_NOW > 0)
                   $combi_components[sPECIFICATIONS_COMBO_BUY_NOW] = $field_array['buy_now'];
                 ksort($combi_components);
                 $box_text = implode('<br>', $combi_components);
                 $box_align = 'center';
                 break;

      case '' : // No existing column, so use specification data
      default :
                 $box_text = $specs_data['prefix'] . ' ' . PHP_EOL;

                 if ($specs_data['display'] == 'image' || $specs_data['display'] == 'multiimage' || $specs_data['enter'] == 'image' || $specs_data['enter'] == 'multiimage') {
                   $box_text .= tep_image(DIR_WS_IMAGES . $specs_data['specification'], $specs_data['column_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . PHP_EOL;
                 } else {
                   $box_text .= $specs_data['specification'] . ' ' . PHP_EOL;
                 }

                 if ($specs_data['suffix'] != '' && SPECIFICATIONS_COMP_SUFFIX != 'True') {
                   $box_text .= ' ' . $specs_data['suffix'] . PHP_EOL;
                 }

                 $box_align = $specs_data['column_justify'];
                 break;
   } // switch ($specs_data['column_name']

   return array( 'box_text' => $box_text, 'box_align' => $box_align );
 }

 

Thanks for the bug report. I'll add this to the next release.

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

Hi this works Jupi nice work

http://www.sklep.emcmoda.pl/products_filter.php?f5=50&sort=products_name

 

How select and add new files (panel admin)to sort Use Existing Database Field: example product atributes (size color etc)

 

Why some otions in the range are gray and inactive?

 

BR

Michał

Attributes are currently not supported as Existing Fields. I plan to add this to a future release, whenever I can get it coded.

 

Filters are greyed out when they would not return any products. You can change this if you want; see the Filters section of the User's Manual for instructions.

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

If any categories or sub categories don't have filters and filters linked to all categories i have this bug

1054 - Nieznana kolumna 'products_name' w where clause

select count(p.products_id) as count from (products p) join (products_to_categories p2c) on (p.products_id = p2c.products_id) left join (specials s) on (p.products_id = s.products_id) where p.products_status = '1' AND products_name <=> 'Apaszka' 

Share this post


Link to post
Share on other sites

Attributes are currently not supported as Existing Fields. I plan to add this to a future release, whenever I can get it coded.

 

Filters are greyed out when they would not return any products. You can change this if you want; see the Filters section of the User's Manual for instructions.

 

Regards

Jim

 

Thanks

Share this post


Link to post
Share on other sites

If any categories or sub categories don't have filters and filters linked to all categories i have this bug

That shouldn't be possible. Can you give me a link to the page that gives that error?

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

Another bug. Looks like I put the wrong file in the distribution. For now, add the following to the bottom of includes/functions/products_specifications.php just before the last ?>

 

////
// Fill the table data fields in a comparison or category page with data from the existing osC fields
 function tep_fill_existing_fields( $products_id, $languages_id ) {
 	global $currencies, $cPath, $PHP_SELF;

   $columns_query_raw = "
             select
               p.products_id,
               pd.products_name,
               pd.products_description,
               p.products_quantity,
               p.products_model,
               p.products_image,
               p.products_price,
               p.products_weight,
               p.products_tax_class_id,
               m.manufacturers_name,
               IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price,
               IF(s.status, s.specials_new_products_price, p.products_price) as final_price
             from
               " . TABLE_PRODUCTS . " p
               join " . TABLE_PRODUCTS_DESCRIPTION . " pd
                 on (pd.products_id = p.products_id)
               left join " . TABLE_SPECIALS . " s
                 on (p.products_id = s.products_id)
               left join " . TABLE_MANUFACTURERS . " m
                 on (p.manufacturers_id = m.manufacturers_id)
             where
               p.products_id = '" . (int) $products_id . "'
               and pd.language_id = '" . (int) $languages_id . "'
           ";
   // print $columns_query_raw . "<br>\n";
   $columns_query = tep_db_query($columns_query_raw);
   $columns_array = tep_db_fetch_array($columns_query);

   $field_array = array();
   // Quantities may be used in columns or combination column
   $field_array['products_quantity'] = ($columns_array['products_quantity'] == '') ? TEXT_NOT_AVAILABLE : $columns_array['products_quantity'];

   $field_array['products_model'] = ($columns_array['products_model'] == '') ? TEXT_NOT_AVAILABLE : $columns_array['products_model'];

   $field_array['products_index_description'] = ($columns_array['products_index_description'] == '') ? TEXT_NOT_AVAILABLE : $columns_array['products_index_description'];

   $field_array['products_description'] = ($columns_array['products_description'] == '') ? TEXT_NOT_AVAILABLE : $columns_array['products_description'];

   $link_array = tep_get_link_data( $columns_array['products_id'] );
   $cPath_new = $link_array['cPath'];
   $category_name = $link_array['categories_name'];

   $parameters = 'cPath=' . $cPath_new . '&products_id=' . $columns_array['products_id'];
   $product_link = tep_href_link( FILENAME_PRODUCT_INFO, $parameters, 'NONSSL', true, true, $category_name, $columns_array['products_name'] );

   $field_array['products_image'] = '<a href="' . $product_link . '">' . tep_image(DIR_WS_IMAGES . $columns_array['products_image'], $columns_array['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a>';

   $field_array['products_name'] = ($columns_array['products_name'] == '') ? TEXT_NOT_AVAILABLE : '<a href="' . $product_link . '">' . $columns_array['products_name'] . '</a>';

   if (tep_not_null($columns_array['specials_new_products_price'])) {
     $field_array['products_price'] = '<s>' . $currencies->display_price($columns_array['products_price'], tep_get_tax_rate($columns_array['products_tax_class_id'])) . '</s><br><span class="productSpecialPrice">' . $currencies->display_price($columns_array['specials_new_products_price'], tep_get_tax_rate($columns_array['products_tax_class_id'])) . '</span>';
   } else {
     $field_array['products_price'] = $currencies->display_price($columns_array['products_price'], tep_get_tax_rate($columns_array['products_tax_class_id']));
   }

   $field_array['final_price'] = $currencies->display_price($columns_array['final_price'], tep_get_tax_rate($columns_array['products_tax_class_id']));

   if( $columns_array['price_in_cart_only'] == '1' ) {
     $field_array['products_price'] = '                <span class="smalltext">';

     $field_array['products_price'] .= '<script language="javascript"><!--' . "\n";
     $field_array['products_price'] .= 'document.write(\'' . '<a href="javascript:popupWindow(\\\'' . tep_href_link( FILENAME_POPUP_PRICE_IN_CART ) . '\\\')">' . TEXT_WHY_HIDE_PRICE . '</a>\');' . "\n";
     $field_array['products_price'] .= '//--></script>' . "\n";
     $field_array['products_price'] .= '<noscript>';
     $field_array['products_price'] .= '<a href="' . tep_href_link( FILENAME_POPUP_PRICE_IN_CART ) . '" target="_new">' . TEXT_WHY_HIDE_PRICE . '</a>';
     $field_array['products_price'] .= '</noscript>';
     $field_array['products_price'] .= '                </span>';

     $field_array['final_price'] = $field_array['products_price'];
   }

   $raw_weight = number_format($columns_array['products_weight'], 1);
   if ($raw_weight -floor($raw_weight) == 0) {
     $raw_weight = number_format($columns_array['products_weight'], 0);
   }
   $field_array['products_weight'] = ($raw_weight == 0.0) ? TEXT_NOT_AVAILABLE : $raw_weight;

   $field_array['manufacturers_name'] = ($columns_array['manufacturers_name'] == '') ? TEXT_NOT_AVAILABLE : $columns_array['manufacturers_name'];

   $field_array['buy_now'] = '              <div class="buttonSet" style="margin-left:10px;">
               <span class="buttonAction">' . tep_draw_hidden_field('products_id', $columns_array['products_id']) . tep_draw_button(IMAGE_BUTTON_IN_CART, 'cart', null, 'primary') . '</span>
             </div>';

   // Show Option/Attribute values if there are any
   $field_array['products_options'] =' ';
   $options_array = tep_get_products_attributes ($columns_array['products_id'], (int)$languages_id, $columns_array['products_tax_class_id']);
   if (is_array ($options_array) && count ($options_array) > 0) {
     $field_array['products_options'] = '';
     foreach( $options_array as $options ) {
       $field_array['products_options'] .= tep_select_attributes( $columns_array['products_id'], $options, $languages_id, $columns_array['products_tax_class_id'] );
     }
   }

   $field_array['popup_image'] = TEXT_NOT_AVAILABLE;
   $popup_query_raw = "
     select
       image
     from
       " . TABLE_PRODUCTS_IMAGES . "
     where
       products_id = '" . (int) $products_id . "'
   ";
   // print $popup_query_raw . "<br>\n";
   $popup_query = tep_db_query( $popup_query_raw );
   $popup_array = tep_db_fetch_array( $popup_query );

   if( tep_not_null( $popup_array[ 'image' ] ) ) {
     $field_array['popup_image'] = '<script language="javascript"><!--' . "\n";
     $field_array['popup_image'] .= 'document.write(\'<a href="javascript:popupWindow(\\\'' . tep_href_link (FILENAME_POPUP_IMAGE, 'pID=' . $columns_array['products_id']) . '\\\')">' . TEXT_POPUP . '</a>\');' . "\n";
     $field_array['popup_image'] .= '//--></script>' . "\n";
     $field_array['popup_image'] .= '<noscript>' . "\n";
     $field_array['popup_image'] .= '<a href="' . tep_href_link (DIR_WS_IMAGES . $columns_array['image']) . '" target="_blank">' . TEXT_POPUP . '</a>' . "\n";
     $field_array['popup_image'] .= '</noscript>' . "\n";
   }

   $discount_price_query_raw = "
     select
       pd.products_price,
       dd.discount
     from
       " . TABLE_PRODUCTS_DISCOUNT . " pd
       join " . TABLE_DISCOUNTS . " dd
         on dd.discounts_id = pd.discounts_id
     where
       pd.products_id = '" . (int) $products_id . "'
     order by
       dd.sort_order
   ";
   // print $discount_price_query_raw . "<br>\n";
   $discount_price_query = tep_db_query( $discount_price_query_raw );

   if( tep_db_num_rows( $discount_price_query ) > 0 ) {
   	$discount_price_id = 1;
     while( $discount_price = tep_db_fetch_array( $discount_price_query ) ) {
       $field_array['products_price' . $discount_price_id] = TEXT_NOT_AVAILABLE;
       $field_array['products_discount' . $discount_price_id] = 1;

       if( $discount_price[ 'products_price' ] != 0.0 && tep_not_null( $discount_price[ 'discount' ] ) ) {
         $field_array['products_price' . $discount_price_id] = $currencies->display_price($discount_price['products_price'], tep_get_tax_rate($columns_array['products_tax_class_id']));
         $field_array['products_discount' . $discount_price_id] = $discount_price[ 'discount' ];
       }

       $discount_price_id++;
     }
   }

   return $field_array;
 }

////
// Draw a table cell in a comparison table or alternate category page
 function tep_specification_table_cell( $specs_id, $products_id, $languages_id, $field_array, $specs_data ) {
   $products_specifications_query_raw = "
     select
       specification
     from
       " . TABLE_PRODUCTS_SPECIFICATIONS . "
     where
       specifications_id = '" . (int) $specs_id . "'
       and language_id = '" . (int) $languages_id . "'
       and products_id = '" . (int) $products_id . "'
     limit 1
    ";
    // print $products_specifications_query_raw . "<br>\n";
    $products_specifications_query = tep_db_query($products_specifications_query_raw);

    $products_specifications = tep_db_fetch_array($products_specifications_query);

    if ($products_specifications['specification'] == '') {
      $specs_data['specification'] = TEXT_NOT_AVAILABLE;
    } else {
      $specs_data['specification'] = $products_specifications['specification'];
    }

    // Get the data for the table cell, either from an existing column or from the specification
    switch ($specs_data['column_name']) {
      // If an existing column was selcted, use that data
      case 'products_quantity' :
                 $box_text = $field_array['products_quantity'];
                 $box_align = 'center';
                 break;

      case 'products_model' :
                 $box_text = $field_array['products_model'];
                 $box_align = 'center';
                 break;

      case 'products_image' :
                 $box_text = $field_array['products_image'];
                 $box_align = 'center';
                 break;

      case 'products_price' :
                 $box_text = $field_array['products_price'];
                 $box_align = 'right';
                 break;

      case 'final_price' :
                 $box_text = $field_array['final_price'];
                 $box_align = 'right';
                 break;

      case 'products_weight' :
                 $box_text = $field_array['products_weight'];
                 $box_align = 'center';
                 break;

      case 'products_options' :
                 $box_text = $field_array['products_options'];
                 $box_align = 'center';
                 break;

      case 'manufacturers_id' :
                 $box_text = $field_array['manufacturers_name'];
                 $box_align = 'center';
                 break;

      case 'products_name' :
                 $box_text = $field_array['products_name'];
                 $box_align = 'center';
                 break;

      case 'products_description' :
                 $box_text = stripslashes( stripslashes( $field_array['products_description'] ) );
                 break;

      case 'products_index_description' :
                 $box_text = stripslashes( stripslashes( $field_array['products_index_description'] ) );
                 break;

      case 'buy_now' :
                 $box_text = '<span style="font-size:0.8em;">' . $field_array['buy_now'] . '</span>';
                 $box_align = 'center';
                 break;

      case 'combi' : // Contents of this column are set globally in the Admin Config
                 $combi_components = array ();
                 if (SPECIFICATIONS_COMBO_MODEL > 0)
                   $combi_components[sPECIFICATIONS_COMBO_MODEL] = $field_array['products_model'];
                 if (SPECIFICATIONS_COMBO_IMAGE > 0)
                   $combi_components[sPECIFICATIONS_COMBO_IMAGE] = $field_array['products_image'];
                 if (SPECIFICATIONS_COMBO_PRICE > 0)
                   $combi_components[sPECIFICATIONS_COMBO_PRICE] = $field_array['products_price'];
                 if (SPECIFICATIONS_COMBO_WEIGHT > 0)
                   $combi_components[sPECIFICATIONS_COMBO_WEIGHT] = $field_array['products_weight'];
                 if (SPECIFICATIONS_COMBO_MFR > 0)
                   $combi_components[sPECIFICATIONS_COMBO_MFR] = $field_array['manufacturers_name'];
                 if (SPECIFICATIONS_COMBO_NAME > 0)
                   $combi_components[sPECIFICATIONS_COMBO_NAME] = $field_array['products_name'];
                 if (SPECIFICATIONS_COMBO_BUY_NOW > 0)
                   $combi_components[sPECIFICATIONS_COMBO_BUY_NOW] = $field_array['buy_now'];
                 ksort($combi_components);
                 $box_text = implode('<br>', $combi_components);
                 $box_align = 'center';
                 break;

      case '' : // No existing column, so use specification data
      default :
                 $box_text = $specs_data['prefix'] . ' ' . PHP_EOL;

                 if ($specs_data['display'] == 'image' || $specs_data['display'] == 'multiimage' || $specs_data['enter'] == 'image' || $specs_data['enter'] == 'multiimage') {
                   $box_text .= tep_image(DIR_WS_IMAGES . $specs_data['specification'], $specs_data['column_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . PHP_EOL;
                 } else {
                   $box_text .= $specs_data['specification'] . ' ' . PHP_EOL;
                 }

                 if ($specs_data['suffix'] != '' && SPECIFICATIONS_COMP_SUFFIX != 'True') {
                   $box_text .= ' ' . $specs_data['suffix'] . PHP_EOL;
                 }

                 $box_align = $specs_data['column_justify'];
                 break;
   } // switch ($specs_data['column_name']

   return array( 'box_text' => $box_text, 'box_align' => $box_align );
 }

 

Thanks for the bug report. I'll add this to the next release.

 

Regards

Jim

 

In which files must add above code ?

Share this post


Link to post
Share on other sites

That shouldn't be possible. Can you give me a link to the page that gives that error?

 

Regards

Jim

This bug is when i adding in Filters in Specification: Apaszka

http://www.sklep.emcmoda.pl/apaszki-damskie-c-25.html

 

when this filters is empty i have text "TEXT_NO_COMPARISON_AVAILABLE"

 

It is my mistake i select product name instef of product_model

 

BR Michał

Edited by emcmoda

Share this post


Link to post
Share on other sites

This bug is when i adding in Filters in Specification: Apaszka

http://www.sklep.emcmoda.pl/apaszki-damskie-c-25.html

 

when this filters is empty i have text "TEXT_NO_COMPARISON_AVAILABLE"

 

It is my mistake i select product name instef of product_model

 

BR Michał

 

If i select wrong filters or Column Name: products_model

Filter Class: range

Display the Filter as: pulldown

Filter Show All: False

Enter Specification Values as: pulldown

 

than i have bug

Share this post


Link to post
Share on other sites

You are missing catalog/includes/languages/english/modules/comparison.php or the equivalent file for your language.

 

I assume that you know that you will have to translate all of the files in catalog/includes/languages/english/ into whatever other language(s) you install.

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

This bug is when i adding in Filters in Specification: Apaszka

http://www.sklep.emcmoda.pl/apaszki-damskie-c-25.html

 

when this filters is empty i have text "TEXT_NO_COMPARISON_AVAILABLE"

 

It is my mistake i select product name instef of product_model

 

BR Michał

why i have this error ?

http://www.sklep.emcmoda.pl/plaszcze-damskie-c-23.html

Fatal error: Call to undefined function tep_fill_existing_fields() in /home/emc/domains/emcmoda.pl/public_html/sklep/includes/modules/comparison.php on line 179

http://www.sklep.emcmoda.pl/apaszki-damskie-c-25.html

TEXT_NO_COMPARISON_AVAILABLE

Share this post


Link to post
Share on other sites

You are missing catalog/includes/languages/english/modules/comparison.php or the equivalent file for your language.

 

I assume that you know that you will have to translate all of the files in catalog/includes/languages/english/ into whatever other language(s) you install.

 

Regards

Jim

 

I have translate files but file comparision.php is catalog/includes/languages/polish/comparison.php

  
 define ('HEADING_TITLE', '%s Porównanie');

 define ('TEXT_NO_COMPARISON_AVAILABLE', 'Przepraszamy, strona porównania produktów nie jest dostępna..');
 define ('TEXT_PRODUCT', 'Produkt');

Hmm

Edited by emcmoda

Share this post


Link to post
Share on other sites

I answered that up above. It does no good for me to post answers if you're not going to read them.

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

Version 1.1.7 has been uploaded to the Addons page. It's also available from my server until the official upload is approved.

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

This bug is when i adding in Filters in Specification: Apaszka

http://www.sklep.emcmoda.pl/apaszki-damskie-c-25.html

 

when this filters is empty i have text "TEXT_NO_COMPARISON_AVAILABLE"

 

It is my mistake i select product name instef of product_model

 

BR Michał

I adde define

define ('HEADING_TITLE', '%s Porównanie');

 

define ('TEXT_NO_COMPARISON_AVAILABLE', 'Przepraszamy, strona porównania produktów nie jest dostępna..');

define ('TEXT_PRODUCT', 'Produkt');

to files 'catalog/include/language/polish/index.php' it works

Share this post


Link to post
Share on other sites

Hi Jim

I update files except index.php because when I updateing, columns left and right are wrong places. When, a click on to category or subcategory I heve this bug

 

http://www.sklep.emcmoda.pl/plaszcze-damskie-c-23.html

Fatal error: Call to undefined function tep_get_link_data() in /home/emc/domains/emcmoda.pl/public_html/sklep/includes/functions/products_specifications.php on line 766

 

Have you any solved?

 

B.Regards

Michał

Share this post


Link to post
Share on other sites

That's a bug. That code is ugly anyway, so I need to rewrite it. I'll post the fix when I get it working.

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

That's a bug. That code is ugly anyway, so I need to rewrite it. I'll post the fix when I get it working.

 

Regards

Jim

 

Ok if I find more bug I posted, i really want to using this add ons but it must work perfect :)

 

Regards

Michał

Share this post


Link to post
Share on other sites

To fix the above bug, find this code in catalog/includes/functions/products_specifications.php:

 

    $link_array = tep_get_link_data( $columns_array['products_id'] );
   $cPath_new = $link_array['cPath'];
   $category_name = $link_array['categories_name'];

   $parameters = 'cPath=' . $cPath_new . '&products_id=' . $columns_array['products_id'];
   $product_link = tep_href_link( FILENAME_PRODUCT_INFO, $parameters, 'NONSSL', true, true, $category_name, $columns_array['products_name'] );

and replace it with this:

 

    $cPath_new = tep_get_product_path( $columns_array['products_id'] );
   $product_link = tep_href_link( FILENAME_PRODUCT_INFO, 'cPath=' . $cPath_new . '&products_id=' . $columns_array['products_id'] );

I'll put up a new download with this change later.

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

To fix the above bug, find this code in catalog/includes/functions/products_specifications.php:

 

    $link_array = tep_get_link_data( $columns_array['products_id'] );
   $cPath_new = $link_array['cPath'];
   $category_name = $link_array['categories_name'];

   $parameters = 'cPath=' . $cPath_new . '&products_id=' . $columns_array['products_id'];
   $product_link = tep_href_link( FILENAME_PRODUCT_INFO, $parameters, 'NONSSL', true, true, $category_name, $columns_array['products_name'] );

and replace it with this:

 

    $cPath_new = tep_get_product_path( $columns_array['products_id'] );
   $product_link = tep_href_link( FILENAME_PRODUCT_INFO, 'cPath=' . $cPath_new . '&products_id=' . $columns_array['products_id'] );

I'll put up a new download with this change later.

 

Regards

Jim

 

Hi i update files but ia have another error:

1146 - Table 'emc_skleputfpl.TABLE_PRODUCTS_DISCOUNT' doesn't exist

select pd.products_price, dd.discount from TABLE_PRODUCTS_DISCOUNT pd join TABLE_DISCOUNTS dd on dd.discounts_id = pd.discounts_id where pd.products_id = '30' order by dd.sort_order 

but when instead of your index.php i using below index.php

the site work well and also filter the display in box

<?php
/*
 $Id$

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

 Copyright (c) 2010 osCommerce

 Released under the GNU General Public License
*/

 require('includes/application_top.php');

// the following cPath references come from application_top.php
 $category_depth = 'top';
 if (isset($cPath) && tep_not_null($cPath)) {
   $categories_products_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_TO_CATEGORIES . " where categories_id = '" . (int)$current_category_id . "'");
   $categories_products = tep_db_fetch_array($categories_products_query);
   if ($categories_products['total'] > 0) {
     $category_depth = 'products'; // display products
   } else {
     $category_parent_query = tep_db_query("select count(*) as total from " . TABLE_CATEGORIES . " where parent_id = '" . (int)$current_category_id . "'");
     $category_parent = tep_db_fetch_array($category_parent_query);
     if ($category_parent['total'] > 0) {
       $category_depth = 'nested'; // navigate through the categories
     } else {
       $category_depth = 'products'; // category has no products, but display the 'no products' message
     }
   }
 }

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

 require(DIR_WS_INCLUDES . 'template_top.php');

 if ($category_depth == 'nested') {
   /*** Begin Header Tags SEO ***/
   $category_query = tep_db_query("select cd.categories_name, c.categories_image, cd.categories_htc_title_tag, cd.categories_htc_description from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_id = '" . (int)$current_category_id . "' and cd.categories_id = '" . (int)$current_category_id . "' and cd.language_id = '" . (int)$languages_id . "'");
   /*** end Header Tags SEO ***/
   $category = tep_db_fetch_array($category_query);
?>

<h1><?php echo $category['categories_htc_title_tag']; ?></h1>

<?php 
/*** Begin Header Tags SEO ***/ 
if (tep_not_null($category['categories_htc_description'])) { 
  echo '<h2 style="text-decoration:none;">' . $category['categories_htc_description'] . '</h2>';
} 
/*** End Header Tags SEO ***/ 
?>

<div class="contentContainer">
 <div class="contentText">
   <table border="0" width="100%" cellspacing="0" cellpadding="2">
     <tr>
<?php
   if (isset($cPath) && strpos('_', $cPath)) {
// check to see if there are deeper categories within the current category
     $category_links = array_reverse($cPath_array);
     for($i=0, $n=sizeof($category_links); $i<$n; $i++) {
       $categories_query = tep_db_query("select count(*) as total from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . (int)$category_links[$i] . "' and c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "'");
       $categories = tep_db_fetch_array($categories_query);
       if ($categories['total'] < 1) {
         // do nothing, go through the loop
       } else {
         $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.categories_image, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . (int)$category_links[$i] . "' and c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "' order by sort_order, cd.categories_name");
         break; // we've found the deepest category the customer is in
       }
     }
   } else {
     $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.categories_image, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . (int)$current_category_id . "' and c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "' order by sort_order, cd.categories_name");
   }

   $number_of_categories = tep_db_num_rows($categories_query);

   $rows = 0;
   while ($categories = tep_db_fetch_array($categories_query)) {
     $rows++;
     $cPath_new = tep_get_path($categories['categories_id']);
     $width = (int)(100 / MAX_DISPLAY_CATEGORIES_PER_ROW) . '%';
     echo '        <td align="center" class="smallText" width="' . $width . '" valign="top"><a href="' . tep_href_link(FILENAME_DEFAULT, $cPath_new) . '">' . tep_image(DIR_WS_IMAGES . $categories['categories_image'], $categories['categories_name'], SUBCATEGORY_IMAGE_WIDTH, SUBCATEGORY_IMAGE_HEIGHT) . '<br />' . $categories['categories_name'] . '</a></td>' . "\n";
     if ((($rows / MAX_DISPLAY_CATEGORIES_PER_ROW) == floor($rows / MAX_DISPLAY_CATEGORIES_PER_ROW)) && ($rows != $number_of_categories)) {
       echo '      </tr>' . "\n";
       echo '      <tr>' . "\n";
     }
   }

// needed for the new products module shown below
   $new_products_category_id = $current_category_id;
?>
     </tr>
   </table>

   <br />

<?php include(DIR_WS_MODULES . FILENAME_NEW_PRODUCTS); ?>
<!--- BEGIN Header Tags SEO Social Bookmarks -->
<?php if (HEADER_TAGS_DISPLAY_SOCIAL_BOOKMARKS == 'true') 
include(DIR_WS_MODULES . 'header_tags_social_bookmarks.php'); 
?>
<!--- END Header Tags SEO Social Bookmarks -->              
 </div>
</div>

<?php
 } elseif ($category_depth == 'products' || isset($HTTP_GET_VARS['manufacturers_id'])) {
// create column list
   $define_list = array('PRODUCT_LIST_MODEL' => PRODUCT_LIST_MODEL,
                        'PRODUCT_LIST_NAME' => PRODUCT_LIST_NAME,
                        'PRODUCT_LIST_MANUFACTURER' => PRODUCT_LIST_MANUFACTURER,
                        'PRODUCT_LIST_PRICE' => PRODUCT_LIST_PRICE,
                        'PRODUCT_LIST_QUANTITY' => PRODUCT_LIST_QUANTITY,
                        'PRODUCT_LIST_WEIGHT' => PRODUCT_LIST_WEIGHT,
                        'PRODUCT_LIST_IMAGE' => PRODUCT_LIST_IMAGE,
                        'PRODUCT_LIST_BUY_NOW' => PRODUCT_LIST_BUY_NOW);

   asort($define_list);

   $column_list = array();
   reset($define_list);
   while (list($key, $value) = each($define_list)) {
     if ($value > 0) $column_list[] = $key;
   }

   $select_column_list = '';

   for ($i=0, $n=sizeof($column_list); $i<$n; $i++) {
     switch ($column_list[$i]) {
       case 'PRODUCT_LIST_MODEL':
         $select_column_list .= 'p.products_model, ';
         break;
       case 'PRODUCT_LIST_NAME':
         $select_column_list .= 'pd.products_name, ';
         break;
       case 'PRODUCT_LIST_MANUFACTURER':
         $select_column_list .= 'm.manufacturers_name, ';
         break;
       case 'PRODUCT_LIST_QUANTITY':
         $select_column_list .= 'p.products_quantity, ';
         break;
       case 'PRODUCT_LIST_IMAGE':
         $select_column_list .= 'p.products_image, ';
         break;
       case 'PRODUCT_LIST_WEIGHT':
         $select_column_list .= 'p.products_weight, ';
         break;
     }
   }

// show the products of a specified manufacturer
   if (isset($HTTP_GET_VARS['manufacturers_id'])) {
     if (isset($HTTP_GET_VARS['filter_id']) && tep_not_null($HTTP_GET_VARS['filter_id'])) {
// We are asked to show only a specific category
       $listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "'";
     } else {
// We show them all
       $listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m where p.products_status = '1' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'";
     }
   } else {
// show the products in a given categorie
     if (isset($HTTP_GET_VARS['filter_id']) && tep_not_null($HTTP_GET_VARS['filter_id'])) {
// We are asked to show only specific catgeory
       $listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "'";
     } else {
// We show them all
       $listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_status = '1' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "'";
     }
   }

   if ( (!isset($HTTP_GET_VARS['sort'])) || (!preg_match('/^[1-8][ad]$/', $HTTP_GET_VARS['sort'])) || (substr($HTTP_GET_VARS['sort'], 0, 1) > sizeof($column_list)) ) {
     for ($i=0, $n=sizeof($column_list); $i<$n; $i++) {
       if ($column_list[$i] == 'PRODUCT_LIST_NAME') {
         $HTTP_GET_VARS['sort'] = $i+1 . 'a';
         $listing_sql .= " order by pd.products_name";
         break;
       }
     }
   } else {
     $sort_col = substr($HTTP_GET_VARS['sort'], 0 , 1);
     $sort_order = substr($HTTP_GET_VARS['sort'], 1);

     switch ($column_list[$sort_col-1]) {
       case 'PRODUCT_LIST_MODEL':
         $listing_sql .= " order by p.products_model " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";
         break;
       case 'PRODUCT_LIST_NAME':
         $listing_sql .= " order by pd.products_name " . ($sort_order == 'd' ? 'desc' : '');
         break;
       case 'PRODUCT_LIST_MANUFACTURER':
         $listing_sql .= " order by m.manufacturers_name " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";
         break;
       case 'PRODUCT_LIST_QUANTITY':
         $listing_sql .= " order by p.products_quantity " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";
         break;
       case 'PRODUCT_LIST_IMAGE':
         $listing_sql .= " order by pd.products_name";
         break;
       case 'PRODUCT_LIST_WEIGHT':
         $listing_sql .= " order by p.products_weight " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";
         break;
       case 'PRODUCT_LIST_PRICE':
         $listing_sql .= " order by final_price " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";
         break;
     }
   }
   /*** Begin Header Tags SEO ***/
   if (isset($HTTP_GET_VARS['manufacturers_id'])) {
     $image = tep_db_query("select manufacturers_image, manufacturers_name as catname from " . TABLE_MANUFACTURERS . " where manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'");
     $image = tep_db_fetch_array($image);
     $db_query = tep_db_query("select manufacturers_htc_title_tag as htc_title, manufacturers_htc_description as htc_description from " . TABLE_MANUFACTURERS_INFO . " where languages_id = '" . (int)$languages_id . "' and manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'");
   } elseif ($current_category_id) {
     $image = tep_db_query("select c.categories_image, cd.categories_name as catname from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_id = '" . (int)$current_category_id . "' and c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "'");
     $image = tep_db_fetch_array($image);
     $db_query = tep_db_query("select categories_htc_title_tag as htc_title, categories_htc_description as htc_description from " . TABLE_CATEGORIES_DESCRIPTION . " where categories_id = '" . (int)$current_category_id . "' and language_id = '" . (int)$languages_id . "'");
   }
   $htc = tep_db_fetch_array($db_query);
?>

<h1><?php echo $htc['htc_title']; // naglowek?></h1>
   <?php /*** End Header Tags SEO ***/ ?>
<div class="contentContainer">

<?php
// optional Product List Filter
   if (PRODUCT_LIST_FILTER > 0) {
     if (isset($HTTP_GET_VARS['manufacturers_id'])) {
       $filterlist_sql = "select distinct c.categories_id as id, cd.categories_name as name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where p.products_status = '1' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and p2c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "' and p.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "' order by cd.categories_name";
     } else {
       $filterlist_sql= "select distinct m.manufacturers_id as id, m.manufacturers_name as name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_MANUFACTURERS . " m where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and p.products_id = p2c.products_id and p2c.categories_id = '" . (int)$current_category_id . "' order by m.manufacturers_name";
     }
     $filterlist_query = tep_db_query($filterlist_sql);
     if (tep_db_num_rows($filterlist_query) > 1) {
       echo '<div>' . tep_draw_form('filter', FILENAME_DEFAULT, 'get') . '<p align="right">' . TEXT_SHOW . ' ';
       if (isset($HTTP_GET_VARS['manufacturers_id'])) {
         echo tep_draw_hidden_field('manufacturers_id', $HTTP_GET_VARS['manufacturers_id']);
         $options = array(array('id' => '', 'text' => TEXT_ALL_CATEGORIES));
       } else {
         echo tep_draw_hidden_field('cPath', $cPath);
         $options = array(array('id' => '', 'text' => TEXT_ALL_MANUFACTURERS));
       }
       echo tep_draw_hidden_field('sort', $HTTP_GET_VARS['sort']);
       while ($filterlist = tep_db_fetch_array($filterlist_query)) {
         $options[] = array('id' => $filterlist['id'], 'text' => $filterlist['name']);
       }
       echo tep_draw_pull_down_menu('filter_id', $options, (isset($HTTP_GET_VARS['filter_id']) ? $HTTP_GET_VARS['filter_id'] : ''), 'onchange="this.form.submit()"');
       echo tep_hide_session_id() . '</p></form></div>' . "\n";
     }
   }

   /*** Begin Header Tags SEO ***/ 
   if (tep_not_null($htc['htc_description'])) { 
        echo '<h2 style="text-decoration:none;">'. $htc['htc_description'] . '</h2>';
    }
   /*** End Header Tags SEO ***/ 

   include(DIR_WS_MODULES . FILENAME_PRODUCT_LISTING);
?>

</div>
  <!--- BEGIN Header Tags SEO Social Bookmarks -->
  <?php if (HEADER_TAGS_DISPLAY_SOCIAL_BOOKMARKS == 'true') 
  include(DIR_WS_MODULES . 'header_tags_social_bookmarks.php'); 
  ?>
     <!--- END Header Tags SEO Social Bookmarks -->  
<?php
 } else { // default page
?>

<h1><?php echo HEADING_TITLE; ?></h1>

<div class="contentContainer">
 <div class="contentText">
   <?php echo tep_customer_greeting(); ?>
 </div>

<?php
   if (tep_not_null(TEXT_MAIN)) {
?>

 <div class="contentText">
   <?php echo TEXT_MAIN; ?>
 </div>

<?php
   }

   include(DIR_WS_MODULES . FILENAME_NEW_PRODUCTS);

   // <!--- BEGIN Header Tags SEO Social Bookmarks -->
   if (HEADER_TAGS_DISPLAY_SOCIAL_BOOKMARKS == 'true') {
       include(DIR_WS_MODULES . 'header_tags_social_bookmarks.php'); 
   }	
   // <!--- END Header Tags SEO Social Bookmarks --> 

   include(DIR_WS_MODULES . FILENAME_UPCOMING_PRODUCTS);
?>

</div>

<?php
 }

 require(DIR_WS_INCLUDES . 'template_bottom.php');
 require(DIR_WS_INCLUDES . 'application_bottom.php');
?>

Share this post


Link to post
Share on other sites

Looks like I grabbed the wrong file again. This is really a pain when I'm trying to develop a new version while supporting the previous one. In any case, find the following code in catalog/includes/functions/products_specifications.php and remove it:

 

   $discount_price_query_raw = "
     select
       pd.products_price,
       dd.discount
     from
       " . TABLE_PRODUCTS_DISCOUNT . " pd
       join " . TABLE_DISCOUNTS . " dd
         on dd.discounts_id = pd.discounts_id
     where
       pd.products_id = '" . (int) $products_id . "'
     order by
       dd.sort_order
   ";
   // print $discount_price_query_raw . "<br>\n";
   $discount_price_query = tep_db_query( $discount_price_query_raw );

   if( tep_db_num_rows( $discount_price_query ) > 0 ) {
   	$discount_price_id = 1;
     while( $discount_price = tep_db_fetch_array( $discount_price_query ) ) {
       $field_array['products_price' . $discount_price_id] = TEXT_NOT_AVAILABLE;
       $field_array['products_discount' . $discount_price_id] = 1;

       if( $discount_price[ 'products_price' ] != 0.0 && tep_not_null( $discount_price[ 'discount' ] ) ) {
         $field_array['products_price' . $discount_price_id] = $currencies->display_price($discount_price['products_price'], tep_get_tax_rate($columns_array['products_tax_class_id']));
         $field_array['products_discount' . $discount_price_id] = $discount_price[ 'discount' ];
       }

       $discount_price_id++;
     }
   }

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

In your first link, I believe yo have your filters set incorrectly. All I can see is filters that don't work, so I can only guess at the cause.

 

I think I have the second one figured out. Find this code in catalog/includes/modules/comparison.php (two places)

 

        echo TEXT_NO_COMPARISON_AVAILABLE . PHP_EOL;

and replace it with this:

 

       echo TEXT_NO_COMPARISON_AVAILABLE . PHP_EOL;
       echo '  </div>' . PHP_EOL;
       echo '</div>' . PHP_EOL;

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

In your first link, I believe yo have your filters set incorrectly. All I can see is filters that don't work, so I can only guess at the cause.

 

I think I have the second one figured out. Find this code in catalog/includes/modules/comparison.php (two places)

 

        echo TEXT_NO_COMPARISON_AVAILABLE . PHP_EOL;

and replace it with this:

 

       echo TEXT_NO_COMPARISON_AVAILABLE . PHP_EOL;
       echo '  </div>' . PHP_EOL;
       echo '</div>' . PHP_EOL;

Regards

Jim

 

Hi Jim thanks for your solutions, second bug is resolved

Below is my settings filters can you check for me ?

 

ps.jpg

 

Regards

Michał

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

×