Jump to content

Archived

This topic is now archived and is closed to further replies.

burt

Open discussion on Better Navigation and Categories

Recommended Posts

So you need to know the exact name of the category that contains what you want. If I'm looking for a disk drive for my computer I look under "D". But the store has these under Hard Drives (H) or Internal Drives (I). After fumbling through dozens of unrelated categories that start with "D", I go off to find a store that's easier to use.

 

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

@@kymation

 

Thanks for replying. You raise an interesting point and I agree. I didn't think of it that way. I failed to put myself in the customer's shoes. The way I thought about is was if a customer was looking for Calvin Klein they click on "C".  Or maybe some kind of menu or search function?

 

How would you arrange so many categories based on your experience? My goal is to reduce overwhelming and discouragement. I asked myself, "If I land on a page with hundreds of categories, then what looks organized? 

 

Thanks.

Share this post


Link to post
Share on other sites

I've been the customer a few times*. That's actually the best way to learn. I may be slightly prejudiced though.

 

Go look at some of your competitors. Act like a customer, and go looking for a particular item. Does their system work? How could you improve it? This actually takes a lot of work, but is worth it if you do it right.

 

Search is also important. Some customers will use search instead of any category menu.

 

osCommerce has a manufacturer filter, so you could use that to find Calvin Klein. Maybe some additional filters would help. The Product Specifications addon includes filters if that is of interest.

 

Regards

Jim

 

*A few thousand at least. I live in the back end of nowhere, so I do a lot of on-line ordering.


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

Share this post


Link to post
Share on other sites

@@kymation

 

After looking at my competitors and comparing their structures to mine, I've decided to go ahead with the numerical/alphabetical navbar.

 

The reason for this are my plans for the music section. Customers will have the ability to click on a letter and all the artists beginning with that letter will be displayed.

 

I've been looking for an add-on that will accomplish this. Maybe it's a custom code job. If you have anymore suggestions or ideas, please don't hesitate.

 

Thanks

Share this post


Link to post
Share on other sites

@@discxpress There is an addon called all products SEO that has a similar thing to what you want. There is a box with letters and numvers and also a set of the same on the all products page, which allows for searching by those letters and numbers. Maybe some of the code could be altered to fit your requirements. Have a look at http://addons.oscommerce.com/info/6216


REMEMBER BACKUP, BACKUP AND BACKUP

Get the latest Responsive osCommerce CE (community edition) here

It's very easy to over complicate what are simple things in life

Share this post


Link to post
Share on other sites

@@discxpress There is an addon called all products SEO that has a similar thing to what you want. There is a box with letters and numvers and also a set of the same on the all products page, which allows for searching by those letters and numbers. Maybe some of the code could be altered to fit your requirements. Have a look at http://addons.oscommerce.com/info/6216

@@14steve14 Thanks for your reply. I'm aware of that add-on. I actually looked at the code and you're right. However, I'm unsure of what part of the code does what. From my understanding, the code from that add-on would have to be tweaked and integrated in the index.php file. 

 

So I'll consult with the author and see what has to be done. It may be simpler to just compensate him.  :thumbsup:

 

Thanks for reading.

Share this post


Link to post
Share on other sites

@@discxpress

 

Depends how you want it shown;

 

Content Module or Box Module (or Both) to show your;

0 1 2 3 4 .... X Y Z

each of which links to a new page (eg blahblah.php?filter_id=3 or blahblah.php?filter_id=X)

 

On the new page blahblah.php have a SQL that looks at the filter_id and scans the category name for anything beginning with that filter_id. I think that would work best and have zero core code amendments.


Help shape the future of Phoenix; join the Phoenix Club

Share this post


Link to post
Share on other sites

@@burt

 

Thanks for your reply. I believe I follow your example. That would be great if the core code doesn't need to be touched. I know you focus on efficiency. But will scanning the categories using SQL be intense labor for the server? Or does your approach limit the amount of queries needed?

 

Thanks again?

Share this post


Link to post
Share on other sites

@@discxpress

 

This following code is very old, 10 years ago I used this for my 2.2MS2 shop.

I quickly tested it inside a normal osC 2.3.4 shop and it still works. It might need some improvement regarding the query and evtl. add numbers and/or special characters into the list. Also buttons instead of text would be nice and like Jacks addon if there are no products inside it maybe deactivate the text/buttons?

Plenty of room for improvement left...

 

So here it goes:

 

index.php

 

FIND:

// 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 . "'";
      }
    }

ADD AFTER IT:

// Start A-Z Listing
$array_sort = array
        ('a','b','c','d','e','f','g','h','i','j','k','l','m','<br>','n','o','p','q','r','s','t','u','v','w','x','y','z','<br>',TEXT_ALL);

if (isset($HTTP_GET_VARS['s_letter']) && tep_not_null($HTTP_GET_VARS['s_letter']) && ($HTTP_GET_VARS['s_letter'] != 'SHOW ALL')) {
            $letter = $HTTP_GET_VARS['s_letter'];

            $listing_sql = "select " . $select_column_list . " p.products_id, products_date_available, 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, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c left join " . TABLE_SPECIALS . " s on p2c.products_id = s.products_id 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 . "' and LEFT(pd.products_name,1) = '" . $letter . "'";
} else {
            $listing_sql = "select " . $select_column_list . " p.products_id, products_date_available, 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, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c left join " . TABLE_SPECIALS . " s on p2c.products_id = s.products_id 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 . "'";
}
// End A-Z Listing

catalog/includes/modules/product_listing.php

add the following code there where you want to show the letter listing.

<div class="abc">
<?php

if (basename($PHP_SELF) != 'advanced_search_result.php'){
  for ($i=0;$i<=sizeof($array_sort);$i++){

  if (strtoupper($array_sort[$i]) == $HTTP_GET_VARS['s_letter']){
  
   echo '      <a href="'.tep_href_link('index.php', 's_letter='.strtoupper($array_sort[$i]) . '&cPath=' . $cPath).'"><b>'.strtoupper($array_sort[$i]).'</a></b>';

} else {

   echo '      <a href="'.tep_href_link('index.php', 's_letter='.strtoupper($array_sort[$i]) . '&cPath=' . $cPath).'">'.strtoupper($array_sort[$i]).'</a>';

}
 }
 } else {

for ($i=0;$i<=sizeof($array_sort);$i++){
$zusatz1 = '&cPath=' . $cPath . '&keywords=' . $_GET['keywords'] . '&categories_id=' . $_GET['categories_id'] . '&inc_subcat=' . $_GET['inc_subcat'] . '&manufacturers_id=' . $_GET['manufacturers_id'] . '&pfrom=' . $_GET['pfrom'] . '&pto=' . $_GET['pto'] . '&dfrom=' . $_GET['dfrom'] . '&dto=' . $_GET['dto'] . '&x=' . $_GET['x'] . '&y=' . $_GET['y'] . '&search_in_description=' . $_GET['search_in_description'];
     if (strtoupper($array_sort[$i]) == $HTTP_GET_VARS['s_letter']){
   echo '      <a href="'.tep_href_link('advanced_search_result.php', 's_letter='.strtoupper($array_sort[$i]) . $zusatz1).'"><b>'.strtoupper($array_sort[$i]).'</a></b>';
} else {
     echo '      <a href="'.tep_href_link('advanced_search_result.php', 's_letter='.strtoupper($array_sort[$i]) . $zusatz1).'">'.strtoupper($array_sort[$i]).'</a>';
}
 }
 }
?>
</div>

catalog/includes/languages/english.php

add this new definition

define('TEXT_ALL', 'Show all');

and then define the class="abc" (or name it whatever you like) inside your stylesheet

Share this post


Link to post
Share on other sites

@@burt

 

Thanks for your reply. I believe I follow your example. That would be great if the core code doesn't need to be touched. I know you focus on efficiency. But will scanning the categories using SQL be intense labor for the server? Or does your approach limit the amount of queries needed?

 

Thanks again?

It would be about the same "heavy" as an advanced_search search ... so should not be a problem.

 

Try to avoid core code changes as pointed out in the post above mine :(


Help shape the future of Phoenix; join the Phoenix Club

Share this post


Link to post
Share on other sites

Try to avoid core code changes as pointed out in the post above mine :(

 

:lol:

:devil:

 

as I said that code could be used as base to create something or maybe not. I just had it and threw it in here.

Share this post


Link to post
Share on other sites

@@Tsimi Thanks for the code. But I'm trying to avoid touching the core code. However, that is a gift for a curious coder to who loves to experiment and maybe develop something useful.

Share this post


Link to post
Share on other sites

×