Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Development] Products Specifications


kymation

Recommended Posts

Hi

 

How can you get the filter box in the left/right column not to show on the homepage, or on categories where there are no filters applied? I have SEO URLs and a redirect on index.php to mysite.com/

 

Admin setting for min spec filter is set to 1

 

 

Thanks

Ashley

Link to comment
Share on other sites

using the $category_depth variable you can distinguish when you want to show

top = default index.php page

nested = page with subcategories (even if there are also products at that level)

products = page with only products

 

I'm having the brand as a filter and also price ranges setup by default, so even if there are no real specifications, there are some usefull filters for the customers.

 

I dont understand your comment about SEO urls

KEEP CALM AND CARRY ON

I do not use the responsive bootstrap version since i coded my responsive version earlier, but i have bought every 28d of code package to support burts effort and keep this forum alive (albeit more like on life support).

So if you are still here ? What are you waiting for ?!

 

Find the most frequent unique errors to fix:

grep "PHP" php_error_log.txt | sed "s/^.* PHP/PHP/g" |grep "line" |sort | uniq -c | sort -r > counterrors.txt

Link to comment
Share on other sites

That's a bug -- the box should not show when there are no filters. In catalog/includes/boxes/products_filter.php, add the following just before line 158:

    if ($count_filters >= SPECIFICATIONS_FILTER_MINIMUM) {

Then add this just after line 177:

    }

Thanks for reporting this one.

 

I can't guarantee that everything will work with a URL rewriter. They often don't handle GET variables correctly, and we use a lot of those here. You'll just have to try it.

 

Regards

Jim

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

Link to comment
Share on other sites

That's a bug -- the box should not show when there are no filters. In catalog/includes/boxes/products_filter.php, add the following just before line 158:

    if ($count_filters >= SPECIFICATIONS_FILTER_MINIMUM) {

Then add this just after line 177:

    }

Thanks for reporting this one.

 

I can't guarantee that everything will work with a URL rewriter. They often don't handle GET variables correctly, and we use a lot of those here. You'll just have to try it.

 

Regards

Jim

Another thing , the box shows a specification label even when there is no specification value listed.

I believe it is getting set on line 87 already, before the actual list is retrieved.

 

I've made these changes in the file

around line 87

//        $box_text .=  '<b>' . $specs_array['specification_name'] . '</b><br>';
       $box_label =  '<b>' . $specs_array['specification_name'] . '</b><br>';

 

and around line 155

from

      } // if ($specs_array['filter_class'] == 'range'
       $box_text .= tep_get_filter_string ($specs_array['filter_display'], $filters_select_array, FILENAME_PRODUCTS_FILTERS, $var, $$var);
     } // if ($count_filters	  
   } // while ($specs_array

to

      } // if ($specs_array['filter_class'] == 'range'
       $box_text_vars = tep_get_filter_string ($specs_array['filter_display'], $filters_select_array, FILENAME_PRODUCTS_FILTERS, $var, $$var);
     } // if ($count_filters
  if ($box_text_vars <> '<br clear=all>') {
    $box_text .=  $box_label . $box_text_vars;
  }

   } // while ($specs_array

KEEP CALM AND CARRY ON

I do not use the responsive bootstrap version since i coded my responsive version earlier, but i have bought every 28d of code package to support burts effort and keep this forum alive (albeit more like on life support).

So if you are still here ? What are you waiting for ?!

 

Find the most frequent unique errors to fix:

grep "PHP" php_error_log.txt | sed "s/^.* PHP/PHP/g" |grep "line" |sort | uniq -c | sort -r > counterrors.txt

Link to comment
Share on other sites

BTW I"m testing this with SEO urls and had little issues, any issues I had where due to bad programming from my site, not in the filter code.

KEEP CALM AND CARRY ON

I do not use the responsive bootstrap version since i coded my responsive version earlier, but i have bought every 28d of code package to support burts effort and keep this forum alive (albeit more like on life support).

So if you are still here ? What are you waiting for ?!

 

Find the most frequent unique errors to fix:

grep "PHP" php_error_log.txt | sed "s/^.* PHP/PHP/g" |grep "line" |sort | uniq -c | sort -r > counterrors.txt

Link to comment
Share on other sites

That's a bug -- the box should not show when there are no filters. In catalog/includes/boxes/products_filter.php, add the following just before line 158:

    if ($count_filters >= SPECIFICATIONS_FILTER_MINIMUM) {

Then add this just after line 177:

    }

Thanks for reporting this one.

 

I can't guarantee that everything will work with a URL rewriter. They often don't handle GET variables correctly, and we use a lot of those here. You'll just have to try it.

 

Regards

Jim

 

Lovely, that takes care of that. :)

 

I made the SEO comment because index.php is not really visible in my store, and I thought the code might somehow have been checking for that.

Link to comment
Share on other sites

Jim,

 

I am having a problem with the tabs. When adding a product I enter text into the various tabs and it gets put into the products_description table like it should and shows up on the catalog side of the site. If I go back into admin to edit the product or change a price all of the tabs are cleared out except for the products_description and the specifications I have entered. If I submit the change all of my data gets cleared out. I have also tried this on a new install with the same results.

 

Thank you for the all help,

 

James

Link to comment
Share on other sites

In catalog/admin/includes/modules/products_tabs.php, find the following code (Lines 16-18 in the distribution copy):

 $products_tabs = array();
 for ($i=0, $n=sizeof($languages); $i<$n; $i++) {
   $products_tabs[$i] = tep_get_products_tabs ( (int) $_GET['pID'], $languages[$i]['id']);

Change the last line of that to:

    $products_tabs[$languages[$i]['id']] = tep_get_products_tabs ( (int) $_GET['pID'], $languages[$i]['id']);

If that doesn't work, you probably have an error somewhere in the top part of that file.

 

Regards

Jim

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

Link to comment
Share on other sites

  • 2 weeks later...

Just thaught I'd share a little of the additional changes we made to this excellent contribution.

Note, it is not properly commented , but old code is commented out. Use a file compare tool to see the differences compared to the original file.

 

This is an alternative includes/modules/comparison.php page that

1) performs better/faster (less queries, getting more data in combining queries)

2) shows also products without specifications

3) only allows for left join with specials, if you manufacturer is optional, you need to re-insert a left join for the manufacturers table

 

Hope this helps some ...

 

Carine

 

<?php
/*
 $Id: comparison.php, v1.0.1 20090917 kymation Exp $
 $Loc: catalog/includes/modules/ $

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

 Copyright (c) 2009 osCommerce

 Released under the GNU General Public License
*/

/*
* This file produces the product comparison table from the specification data
* for products in a linked category. It can be included in catalog/comparison.
* php or catalog/index.php (Admin controlled)
* 
* $current_category_id is required to determine which specifications to use
*/


?>
   <table border="0" width="100%" cellspacing="0" cellpadding="0">
     <tr>
       <td>
<?php
 if ($current_category_id != 0) {
   $title_array = array();
   //Get the top right image and name for this category
   $title_query_raw = "select c.categories_image,
                              cd.categories_name
                          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 . "' 
                        ";
   // print $image_query_raw . "<br>\n";
   $title_query = tep_db_query ($title_query_raw);

   if (tep_db_num_rows ($title_query) > 0) {
     $title_array = tep_db_fetch_array ($title_query);
   } // if (tep_db_num_rows ($category_query
?>
       <table border="0" width="100%" cellspacing="0" cellpadding="0">
         <tr>
           <td class="pageHeading"><?php echo sprintf (HEADING_TITLE, $title_array['categories_name']); ?></td>
           <td align="right"><?php echo tep_image(DIR_WS_IMAGES . $title_array['categories_image'], $title_array['categories_name'], 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>
     <tr>
       <td> 
<?php
       // This is used here to generate the column headings (Row 0 of the table)
       //   and later to step through the columns on each row
       $list_box_contents = array();
       $specifications_query_raw = "select s.specifications_id,
                                           s.specification_sort_order,
                                           s.products_column_name,
                                           s.column_justify,
                                           s.filter_display,
                                           s.enter_values,
                                           sd.specification_name,
                                           sd.specification_prefix,
                                           sd.specification_suffix,
                                           sg.specification_group_id
                                   from " . TABLE_SPECIFICATION . " s,
                                        " . TABLE_SPECIFICATION_DESCRIPTION . " sd,
                                        " . TABLE_SPECIFICATION_GROUPS . " sg,
                                        " . TABLE_SPECIFICATIONS_TO_CATEGORIES . " sg2c,
                                        " . TABLE_CATEGORIES_DESCRIPTION . " cd
                                   where sg.specification_group_id = sg2c.specification_group_id
                                     and cd.categories_id = sg2c.categories_id
                                     and sd.specifications_id = s.specifications_id
                                     and sg.show_comparison = 'True'
                                     and s.show_comparison = 'True'
                                     and cd.categories_id = '" . (int) $current_category_id . "'
                                     and cd.language_id = '" . (int) $languages_id . "' 
                                     and s.specification_group_id = sg.specification_group_id
                                     and sd.language_id = '" . (int) $languages_id . "' 
                                   order by s.specification_sort_order,
                                            sd.specification_name
                                 ";
       // print $specifications_query_raw . "<br>\n";
       $specifications_query = tep_db_query ($specifications_query_raw);

       if (tep_db_num_rows ($specifications_query) > 0) {
         $specification_id_array = array();
         while ($specifications_heading = tep_db_fetch_array ($specifications_query) ) {
           // Set up the heading for the table
           $box_text = $specifications_heading['specification_name'];
           if ($specifications_heading['specification_suffix'] != '' && SPECIFICATIONS_COMP_SUFFIX == 'True') {
             $box_text .= '<br>(' . $specifications_heading['specification_suffix'] . ')';
           }

           if ($specifications_heading['column_justify'] == '') {
             $specifications_heading['column_justify'] = 'left';
           }

           $list_box_contents[0][] = array ('align' => $specifications_heading['column_justify'],
                                            'params' => 'class="productListing-heading"',
                                            'text' => ' ' . $box_text . ' '
                                           );

           // Build an array to use as an index on the table rows
           $id = $specifications_heading['specifications_id'];
           $group_id = $specifications_heading['specification_group_id'];
           $specification_id_array[$id] = array ('id' => $specifications_heading['specifications_id'],
                                                 'sort_order' => $specifications_heading['specification_sort_order'],
                                                 'column_name' => $specifications_heading['products_column_name'],
                                                 'column_justify' => $specifications_heading['column_justify'],
                                                 'name' => $specifications_heading['specification_name'],
                                                 'prefix' => $specifications_heading['specification_prefix'],
                                                 'suffix' => $specifications_heading['specification_suffix'],
                                                 'display' => $specifications_heading['filter_display'],
                                                 'enter' => $specifications_heading['enter_values'],
                                                 'group_id' => $specifications_heading['specification_group_id']
                                                );
         } //while ($specifications_heading

////
// Table rows
/*          $products_query_raw = "select p.products_id, p.products_model, pd.products_name
                                from " . TABLE_PRODUCTS. " p,
							      " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c,
                                     " . TABLE_PRODUCTS_DESCRIPTION . " pd
                                where p2c.categories_id = '" . (int) $current_category_id . "'
							   and p.products_id = pd.products_id 
							   and p.products_id = p2c.products_id
							   and pd.language_id = '" . (int) $languages_id ."'
							   and p.products_status = '1'
                                 order by p.products_model
                              ";
*/							   
         // print 'Products Query: ' . $products_query_raw . "<br>\n";
//          $products_query = tep_db_query ($products_query_raw);
         $products_query_raw = "select distinct p2c.products_id
                                from " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c
                                where p2c.categories_id = '" . (int) $current_category_id . "'
                              ";

//          if (tep_db_num_rows ($products_query) >= SPECIFICATIONS_MINIMUM_COMPARISON) {
           $row_number = 1; // Row 0 was the header
//            while ($products_array = tep_db_fetch_array ($products_query) ) { // Each product is a row
//              $products_id = $products_array['products_id'];

//CB Always show, even without specs
             // Check to see if this product has any specifications
/*             $check_query_raw = "select count(products_specification_id) as total
                                from " . TABLE_PRODUCTS_SPECIFICATIONS . "
                                where products_id = '" . $products_id . "'
                                  and specification != ''
                              ";
             // print 'Check Query: ' . $check_query_raw . "<br>\n";
             $check_query = tep_db_query ($check_query_raw);
             $check_total = tep_db_fetch_array ($check_query);
             if ($check_total['total'] > 0) { // Show product only if specifications are not empty
*/
reset ($specification_id_array);

               // Get the data for existing columns (All of them, so we can use what we want in the table)
               $columns_query_raw = "select p.products_id,
                                            pd.products_name,
                                            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 using (products_id)
                                     join " . TABLE_MANUFACTURERS . " m using (manufacturers_id)
                                left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id
                                     where p.manufacturers_id = m.manufacturers_id
      								   and p.products_status = '1'
                                        and pd.language_id = '" . (int) $languages_id . "' 
                                   ";
//                                        and p.products_id = '" . (int) $products_id . "'
               // print $columns_query_raw . "<br>\n";
			if (isset($_GET['manufacturers_id']) ){
			  $columns_query_raw .= ' and p.manufacturers_id = ' . (int)$_GET['manufacturers_id'] ;
			}
			$columns_query_raw .= ' and p.products_id in ( ' . $products_query_raw . ' ) ';
			$columns_query_raw .= ' order by m.manufacturers_name, pd.products_name ';

               $columns_query = tep_db_query ($columns_query_raw);
//              $columns_array = tep_db_fetch_array ($columns_query);
//              $products_id = $products_array['products_id'];
           while ($columns_array = tep_db_fetch_array ($columns_query) ) { // Each product is a row
              $products_id = $columns_array['products_id'];

               // Quantities may be used in columns or combination column
               $products_quantity = ($columns_array['products_quantity'] == '') ? TEXT_NOT_AVAILABLE : $columns_array['products_quantity'];
               $products_model = ($columns_array['products_model'] == '') ? TEXT_NOT_AVAILABLE : $columns_array['products_model'];
               $products_image = '<a href="' . tep_href_link (FILENAME_PRODUCT_INFO, ($cPath ? 'cPath=' . $cPath . '&' : '') . 'products_id=' . $columns_array['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $columns_array['products_image'], $columns_array['products_name'], SMALL_IMAGE_WIDTH/2, SMALL_IMAGE_HEIGHT/2) . '</a>';
               if (tep_not_null ($columns_array['specials_new_products_price']) ) {
                 $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 {
                 $products_price = $currencies->display_price ($columns_array['products_price'], tep_get_tax_rate ($columns_array['products_tax_class_id']) );
               }
               $final_price = $currencies->display_price ($columns_array['final_price'], tep_get_tax_rate ($columns_array['products_tax_class_id']) );
               $products_weight = ($columns_array['products_weight'] == '') ? TEXT_NOT_AVAILABLE : $columns_array['products_weight'];
               $manufacturers_name = ($columns_array['manufacturers_name'] == '') ? TEXT_NOT_AVAILABLE : $columns_array['manufacturers_name'];
               $products_name = ($columns_array['products_name'] == '') ? TEXT_NOT_AVAILABLE : '<a href="' . tep_href_link (FILENAME_PRODUCT_INFO, ($cPath ? 'cPath=' . $cPath . '&' : '') . 'products_id=' . $columns_array['products_id']) . '">' . $columns_array['products_name'] . '</a>';
               $buy_now = '<a href="' . tep_href_link (basename ($PHP_SELF), tep_get_all_get_params (array ('action') ) . 'action=buy_now&products_id=' . $columns_array['products_id']) . '">' . tep_image_button ('button_buy_now.gif', IMAGE_BUTTON_BUY_NOW) . '</a>';

               // Get the data for each specification in the row 
               foreach ($specification_id_array as $specs_id => $specs_data) {
			  // gewijzigd door keukenlust: 'limit 1' weggehaald (we willen alle waarden voor de specificatie tonen, zie ook een beetje lager)
                 $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 . "' 

                                                     ";
                 // 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 = ' ' . $products_quantity . ' ';
                     $box_align = 'right';
                     break;

                   case 'products_model':
                     $box_text = ' ' . $products_model . ' ';
                     $box_align = 'left';
                     break;

                   case 'products_image':
                     $box_text = ' ' . $products_image . ' ';
                     $box_align = 'center';
                     break;

                   case 'products_price':  
                     $box_text = ' ' . $products_price . ' ';
                     $box_align = 'right';
                     break;

                   case 'final_price':  
                     $box_text = ' ' . $final_price . ' ';
                     $box_align = 'right';
                     break;

                   case 'products_weight':
                     $box_text = ' ' . $products_weight . ' ';
                     $box_align = 'right';
                     break;

                   case 'manufacturers_id':
                     $box_text = ' ' . $manufacturers_name . ' ';
                     $box_align = 'left';
                     break;

                   case 'products_name':
                     $box_text = ' ' . $products_name . ' ';
                     $box_align = 'left';
                     break;

                   case 'buy_now': 
                     $box_text = ' ' . $buy_now . ' ';
                     $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] = $products_model;
                     if (SPECIFICATIONS_COMBO_IMAGE > 0) $combi_components[sPECIFICATIONS_COMBO_IMAGE] = $products_image;
                     if (SPECIFICATIONS_COMBO_PRICE > 0) $combi_components[sPECIFICATIONS_COMBO_PRICE] = $products_price;
                     if (SPECIFICATIONS_COMBO_WEIGHT > 0) $combi_components[sPECIFICATIONS_COMBO_WEIGHT] = $products_weight;
                     if (SPECIFICATIONS_COMBO_MFR > 0) $combi_components[sPECIFICATIONS_COMBO_MFR] = $manufacturers_name;
                     if (SPECIFICATIONS_COMBO_NAME > 0) $combi_components[sPECIFICATIONS_COMBO_NAME] = $products_name;
                     if (SPECIFICATIONS_COMBO_BUY_NOW > 0) $combi_components[sPECIFICATIONS_COMBO_BUY_NOW] = $buy_now;
                     ksort ($combi_components); 
                     $box_text = implode ('<br>', $combi_components);
				  /* start wijziging door keukenlust */
				  //$box_align = 'center';
                     $box_align = $specs_data['column_justify'];
				  /* end wijziging door keukenlust */
                     break;

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

                     if ($specs_data['display'] == 'image' || $specs_data['display'] == 'multiimage' || $specs_data['enter'] == 'image' || $specs_data['enter'] == 'multiimage') { 

					//keukenlust: afbeeldingetjes op dezelfde regel
					$box_text .= '<span style="white-space: nowrap;">';
					$box_text .= tep_image (DIR_WS_IMAGES . $specs_data['specification'], $specs_data['column_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT);
					/* begin keukenlust -- als er meerdere waarden voor de specificatie zijn opgegeven, tonen we ze allemaal*/
					while($products_specifications = tep_db_fetch_array ($products_specifications_query))
					{
						$box_text .= tep_image (DIR_WS_IMAGES . $products_specifications['specification'], $specs_data['column_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT);
					}
					/* end keukenlust */
					//keukenlust: afbeeldingetjes op dezelfde regel
					$box_text .= ' </span>';
                     } else {
                       $box_text .= $specs_data['specification'] . ' ';

					/* begin keukenlust -- als er meerdere waarden voor de specificatie zijn opgegeven, tonen we ze allemaal*/
					while($products_specifications = tep_db_fetch_array ($products_specifications_query))
					{
						$box_text .= $products_specifications['specification'];
					}
					/* end keukenlust */
                     }

				  // wijziging door keukenlust: && $products_specifications['specification'] != ''
				  // we willen niet dat na TEXT_NOT_AVAILABLE eventuele eenheden getoond worden
                     if ($specs_data['suffix'] != '' && SPECIFICATIONS_COMP_SUFFIX != 'True' && $specs_data['specification'] != TEXT_NOT_AVAILABLE) {
                       $box_text .= ' ' . $specs_data['suffix'];
                     }

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

                 if ( ($row_number % 2) == 0) { // Even numbered row
                   $params = 'class="productListing-even"';
                 } else {
                   $params = 'class="productListing-odd"';
                 } // if ( ($row_number % 2) ... else ...

                 // Output each column in the current row (One product per row, one specification per column)
                 $list_box_contents[$row_number][] = array ('align' => $box_align,
                                                            'params' => $params,
                                                            'text'  => $box_text
                                                           );
               } // foreach ($specification_id_array

               $row_number++;
//              } // if ($check_total['total']
           } // while ($products_array


/*
         } else {
           $list_box_contents[0] = array ('align' => 'center',
                                          'params' => 'class="productListing-odd"',
                                          'text'  => TEXT_NO_COMPARISON_AVAILABLE
                                         );

         } // if (tep_db_num_rows ($products_query
*/
         // Output the box in the selected style
         switch (SPECIFICATIONS_COMPARISON_STYLE) {
           case 'Plain':
             new borderlessBox ($list_box_contents);
             break;

           case 'Simple':
             new productListingBox ($list_box_contents);
             break;

           case 'Stock':
           default:
             new contentBoxHeading ($list_box_heading, false, false);
             new contentBox ($list_box_contents);
             break;
         } // switch (SPECIFICATIONS_BOX_FRAME_STYLE

       } // if (tep_db_num_rows ($category_specs_query

 } else {
   echo TEXT_NO_COMPARISON_AVAILABLE;

 } // if ($current_category_id ... else ...

?>
       </td>
     </tr>
   </table>

KEEP CALM AND CARRY ON

I do not use the responsive bootstrap version since i coded my responsive version earlier, but i have bought every 28d of code package to support burts effort and keep this forum alive (albeit more like on life support).

So if you are still here ? What are you waiting for ?!

 

Find the most frequent unique errors to fix:

grep "PHP" php_error_log.txt | sed "s/^.* PHP/PHP/g" |grep "line" |sort | uniq -c | sort -r > counterrors.txt

Link to comment
Share on other sites

Thanks for the code. I'll take a better look at it when I have more time. You have good ideas, although I think #2 should be an option, as not everyone will want this.

 

Regards

Jim

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

Link to comment
Share on other sites

  • 2 weeks later...

using the $category_depth variable you can distinguish when you want to show

top = default index.php page

nested = page with subcategories (even if there are also products at that level)

products = page with only products

 

I'm having the brand as a filter and also price ranges setup by default, so even if there are no real specifications, there are some usefull filters for the customers.

 

I dont understand your comment about SEO urls

 

Hi,

 

This is what I am looking for. Where would you suggest using the $category_depth variable?? What code would I use to do this? I am not a newbie but my PHP knowledge could be better!

 

Hope you can help me. James

Link to comment
Share on other sites

Hi,

 

This is what I am looking for. Where would you suggest using the $category_depth variable?? What code would I use to do this? I am not a newbie but my PHP knowledge could be better!

 

Hope you can help me. James

if you still have a standard layout, you could use that in includes/column_left for instance to decide when to show the filter

KEEP CALM AND CARRY ON

I do not use the responsive bootstrap version since i coded my responsive version earlier, but i have bought every 28d of code package to support burts effort and keep this forum alive (albeit more like on life support).

So if you are still here ? What are you waiting for ?!

 

Find the most frequent unique errors to fix:

grep "PHP" php_error_log.txt | sed "s/^.* PHP/PHP/g" |grep "line" |sort | uniq -c | sort -r > counterrors.txt

Link to comment
Share on other sites

if you still have a standard layout, you could use that in includes/column_left for instance to decide when to show the filter

 

Hi,

 

Yes I still have a standard layout. I tried to add some code in the column left file but dont think I had the right code. What code would work?

 

Thanks

 

 

James

Link to comment
Share on other sites

I don't have standard layout anymore, but this you should be able to paste e.g. just under the manufacturers box code

if ($category_depth =='nested' || $category_depth == 'products' || basename($PHP_SELF) == 'products_filter.php' ) {
include(DIR_WS_BOXES . 'products_filter.php'); 
} 

KEEP CALM AND CARRY ON

I do not use the responsive bootstrap version since i coded my responsive version earlier, but i have bought every 28d of code package to support burts effort and keep this forum alive (albeit more like on life support).

So if you are still here ? What are you waiting for ?!

 

Find the most frequent unique errors to fix:

grep "PHP" php_error_log.txt | sed "s/^.* PHP/PHP/g" |grep "line" |sort | uniq -c | sort -r > counterrors.txt

Link to comment
Share on other sites

I don't have standard layout anymore, but this you should be able to paste e.g. just under the manufacturers box code

if ($category_depth =='nested' || $category_depth == 'products' || basename($PHP_SELF) == 'products_filter.php' ) {
include(DIR_WS_BOXES . 'products_filter.php'); 
} 

 

Hi thanks ever so much for replying so quickly to my posts.

 

Can I do this for sub categories only?

 

:)

Link to comment
Share on other sites

// checking for topcat
if (isset($cPath) && (strpos($cPath, '_') == 0 ) ) {
         $category_depth = 'topcat';
}

 

I have something like this section in my index.php

you could use the if condition logic in your column left to show or not show for the top level category

 

if you want to show just for subcategories it would be something like this

// only show for subcats
if (isset($cPath) && (strpos($cPath, '_') > 0 ) ) {
         include(DIR_WS_BOXES . 'products_filter.php'); 
}

to add to column_left

 

HTH

KEEP CALM AND CARRY ON

I do not use the responsive bootstrap version since i coded my responsive version earlier, but i have bought every 28d of code package to support burts effort and keep this forum alive (albeit more like on life support).

So if you are still here ? What are you waiting for ?!

 

Find the most frequent unique errors to fix:

grep "PHP" php_error_log.txt | sed "s/^.* PHP/PHP/g" |grep "line" |sort | uniq -c | sort -r > counterrors.txt

Link to comment
Share on other sites

// checking for topcat
if (isset($cPath) && (strpos($cPath, '_') == 0 ) ) {
         $category_depth = 'topcat';
}

 

I have something like this section in my index.php

you could use the if condition logic in your column left to show or not show for the top level category

 

if you want to show just for subcategories it would be something like this

// only show for subcats
if (isset($cPath) && (strpos($cPath, '_') > 0 ) ) {
         include(DIR_WS_BOXES . 'products_filter.php'); 
}

to add to column_left

 

HTH

 

 

Thank you so much! It has really finished off things for me.

 

Thanks again for your help.

 

James

Link to comment
Share on other sites

In your Admin, Filters in Specification: Brand is empty. Ditto all of the other specifications. The Manufacturer filter shows because it pulls the existing manufacturer names from the database. With no available filter values to select, the rest of the selections are not shown. You need to add filter values. Read section 4.2.3 in the manual.

 

Your Admin is not secure. Change the name of the admin folder and protect it with .htaccess/.htpassword. You should also read the security threads on this forum before you get hacked.

 

Regards

Jim

 

 

Hi Jim,

 

The link I gave was a test site so don't worry about the admin too much.

 

I was wondering if you could take a final look at the site because I have it all set up how I want now but I have a problem with one of the specifications. Basically it shows under the filter box but when I click on one of the filters it returns no results.

 

Let me know if you want me to PM you the site address again.

 

Hope to hear from you soon so that I can get this wonderful contribution live.

 

 

Thanks

 

 

James

Link to comment
Share on other sites

Please send the address again. I just moved to a new computer and I'm still a bit disorganized.

 

Even a test site has some value. If you don't care if a hacker destroys it, then leave it open. Otherwise I advise securing it. You're going to have to do it sometime.

 

Regards

Jim

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

Link to comment
Share on other sites

I don't see any filters under Cash Ratings. Check that you have a Specification Group linked to this category, and that the products in this category have Specifications assigned.

 

Regards

Jim

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

Link to comment
Share on other sites

I don't see any filters under Cash Ratings. Check that you have a Specification Group linked to this category, and that the products in this category have Specifications assigned.

 

Regards

Jim

Hi Jim,

 

Look under budget safes which is in the home safes category then you will see what I mean.

 

Also can you tell me if there is a way of filtering the results on the same page rather than moving people to the product_filter page???

 

Regards

James

Edited by jamesblackburn
Link to comment
Share on other sites

Hi Jim,

 

Look under budget safes which is in the home safes category then you will see what I mean.

 

Also can you tell me if there is a way of filtering the results on the same page rather than moving people to the product_filter page???

 

Regards

James

 

Hi Jim,

 

Did you get chance to look under the budget safes section to check out the cash rating problem I am having?

 

Regards

 

 

James

Link to comment
Share on other sites

Look up a couple of posts.

 

The Product Filter page was a way of showing the results of filters without extensive modifications to the index.php that shows the normal category listings. It could be done, but it would be complicated. Your customers shouldn't notice anyway.

 

Regards

Jim

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

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