Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Adding "All Products" Link to Categories Box


cdi-buy.com

Recommended Posts

I'm sure it's been posted elsewhere but as most people know, the search isn't very accurate when trying to find a post. I've seen it done on so many sites and I want to do it on my own but I'm not sure exactly where to put it in the infobox code for categories.

 

All I want is a simple link to All Products since I don't usually stock many products and there are few categories. It would be nice to have the ability for the user to click one link and get everything at a time rather than trying to jump around the category tree (could be a hassle for those quicker clickers).

 

Thanks in advance for the help.

Link to comment
Share on other sites

are you after something like this

 

View all products

 

the link is at the bottom of the categories left column navigation

No longer giving free advice. Please place deposit in meter slot provided.  Individual: [=] SME: [==] Corporation: [===]
If deposit does not fit one of the slots provided then you are asking too much! :P

Is your Osc dated try Phoenix  raising oscommerce from the ashes.

Link to comment
Share on other sites

that's exactly what I want....except now I have categories as a drop down menu so it would have to be integrated into that somehow. I just don't know the exact line of code I need and where exactly to place it in the jumbled mess (as is appears to me) of includes/boxes/categories.php

 

if you need my current (drop down menu) code, I can post it but I didn't want to use space on here if it's unnecessary.

Link to comment
Share on other sites

includes/boxes/categories

 

$info_box_contents[] = array('align' => 'center" valign="top',
                              'text'  => '<hr><a href="' . tep_href_link(FILENAME_ALLPRODS, '', 'NONSSL') . '">' . BOX_INFORMATION_ALLPRODS . '</a>');

 

 

or alternative

 

<td width="10" align="right" class="headerNavigation"><?php echo '<a href="' . tep_href_link(FILENAME_ALL_PRODUCTS, '', 'NONSSL', true) . '">' . tep_image_button('button_all_products.gif', IMAGE_BUTTON_ALL_PRODUCTS) . '</a>'; ?></td>

No longer giving free advice. Please place deposit in meter slot provided.  Individual: [=] SME: [==] Corporation: [===]
If deposit does not fit one of the slots provided then you are asking too much! :P

Is your Osc dated try Phoenix  raising oscommerce from the ashes.

Link to comment
Share on other sites

that would work except I have a drop down menu now and I need to know how to add all products to the drop down menu

 

using your first set of code would have been fine if I had stuck with the default menu.

 

see what I mean here

 

this is my current code:

<?php

  $info_box_contents = array();

  $info_box_contents[] = array('align' => 'left',

                              'text'  => BOX_HEADING_CATEGORIES

                              );

  new infoBoxHeading($info_box_contents, true, false);

 

  $info_box_contents = array();

  $info_box_contents[] = array('form' => '<form action="' . tep_href_link(FILENAME_DEFAULT) . '" method="get">' . tep_hide_session_id(),

                              'align' => 'left',

                              'text'  => tep_draw_pull_down_menu('cPath', tep_get_categories(array(array('id' => '', 'text' => PULL_DOWN_DEFAULT))), $cPath, 'onchange="this.form.submit();"')

                              );

  new infoBox($info_box_contents);

?>

            </td>

          </tr>

<!-- categories_eof //-->

Link to comment
Share on other sites

ok your showing a parse error at the moment

 

Parse error: parse error, expecting `')'' in /home/dchocken/public_html/shop/includes/boxes/categories.php on line 18

No longer giving free advice. Please place deposit in meter slot provided.  Individual: [=] SME: [==] Corporation: [===]
If deposit does not fit one of the slots provided then you are asking too much! :P

Is your Osc dated try Phoenix  raising oscommerce from the ashes.

Link to comment
Share on other sites

yeah that's what happened when I tried to play with the code you gave me to put all products in my drop down menu...shows how little I know about php.

 

it should be fixed by now since I put the original code back in (without any mods)

 

what I want to do is add All Products at either the top or bottom of the drop down categories menu

Link to comment
Share on other sites

did you try something like this

 

<?php
 $info_box_contents = array();
 $info_box_contents[] = array('align' => 'left',
                             'text'  => BOX_HEADING_CATEGORIES
                             );
 new infoBoxHeading($info_box_contents, true, false);

 $info_box_contents = array();
 $info_box_contents[] = array('form' => '<form action="' . tep_href_link(FILENAME_DEFAULT) . '" method="get">' . tep_hide_session_id(),
                             'align' => 'left',
                             'text'  => tep_draw_pull_down_menu('cPath', tep_get_categories(array(array('id' => '', 'text' => PULL_DOWN_DEFAULT))), $cPath, 'onchange="this.form.submit();"')
                               $info_box_contents[] = array('align' => 'center" valign="top',
                              'text'  => '<a href="' . tep_href_link(FILENAME_ALLPRODS, '', 'NONSSL') . '">' . BOX_INFORMATION_ALLPRODS . '</a>');

?>
           </td>
         </tr>
<!-- categories_eof //-->

 

I have not had a chance to test this as I am in the middle of a very large backup.

I also have not had a chance to fully llok at the code structure but it is something along this line.

 

I may get a chance once the backups are done.

No longer giving free advice. Please place deposit in meter slot provided.  Individual: [=] SME: [==] Corporation: [===]
If deposit does not fit one of the slots provided then you are asking too much! :P

Is your Osc dated try Phoenix  raising oscommerce from the ashes.

Link to comment
Share on other sites

Having the file that it is calling would certainly be a big advantage

 

click the link in my signature for contributions and in second search field type allproducts there will be one.

 

there are others that are classed as sitemap.

No longer giving free advice. Please place deposit in meter slot provided.  Individual: [=] SME: [==] Corporation: [===]
If deposit does not fit one of the slots provided then you are asking too much! :P

Is your Osc dated try Phoenix  raising oscommerce from the ashes.

Link to comment
Share on other sites

Here is the direct link

 

All Products

No longer giving free advice. Please place deposit in meter slot provided.  Individual: [=] SME: [==] Corporation: [===]
If deposit does not fit one of the slots provided then you are asking too much! :P

Is your Osc dated try Phoenix  raising oscommerce from the ashes.

Link to comment
Share on other sites

Thanks. :lol:

 

For some reason when I thought about putting a link in categories, I assumed allproducts was already a page in oscommerce.

 

duh@me

 

I still haven't figured out how to add the link in the drop down menu itself but in the meantime I added it the very first way you told me about. For now it's just a link to the new products page. Would you mind looking at the store and seeing if it still looks "professional" that way or if it's obviously out of place?

 

Click Here For The Store

Link to comment
Share on other sites

ok I got the contribution installed and I decided to stay with the newest products link as well.

 

Now there is a link to all products AND one to newest products and I think it's beneficial to have both of those there and not in the drop down menu, simply for easier access.

Link to comment
Share on other sites

I see it is all working and looks ok.

 

The only thing for me was when clicking a link you get the white flash of a blank page whilst waiting to load the next page, a minor thing and only my opinion in that I found this a bit off putting and spoils the professional look that you are after.

No longer giving free advice. Please place deposit in meter slot provided.  Individual: [=] SME: [==] Corporation: [===]
If deposit does not fit one of the slots provided then you are asking too much! :P

Is your Osc dated try Phoenix  raising oscommerce from the ashes.

Link to comment
Share on other sites

I think that's my host. They've been having a few troubles recently. It might clear up once they get things straightened out.

 

I might even end up changing hosts. Not sure yet though. I'd hate to go through that whole process again :blink:

 

Might be you have a slightly slower connection too since I have a background image that has to be downloaded.

 

I'll see if I can't reduce the filesize of the background image some more yet and I'll email you through the forums if I do and have you check it out again...see if you get that flash.

Link to comment
Share on other sites

That has sorted out the flash much improved, keep up the good work.

 

I am on a fast connection

No longer giving free advice. Please place deposit in meter slot provided.  Individual: [=] SME: [==] Corporation: [===]
If deposit does not fit one of the slots provided then you are asking too much! :P

Is your Osc dated try Phoenix  raising oscommerce from the ashes.

Link to comment
Share on other sites

I am on a fast connection

 

So am I but sometimes there are lags and/or split second delays due to heavy traffic on a system, etc.

 

Thanks though....I chopped it down from about 2.47KB to I think 200 Bytes.

 

Every little bit helps I think. The only downside is if you look real close you can see where one square ends and another begins a little more easily. Not a big deal tho since I'm hoping more attention goes to my products, NOT my background *crosses fingers*

Link to comment
Share on other sites

You are right, however you only notice this if you look close.

No longer giving free advice. Please place deposit in meter slot provided.  Individual: [=] SME: [==] Corporation: [===]
If deposit does not fit one of the slots provided then you are asking too much! :P

Is your Osc dated try Phoenix  raising oscommerce from the ashes.

Link to comment
Share on other sites

you wouldnt happen to know how to make an image the default for "no image" instead of the broken one would ya? I want to have my No Image Available icon automatically shown when I don't upload a pic for a product, without having to manually upload it.

 

perhaps some code or something I need to place somewhere?

Link to comment
Share on other sites

Do you mean like this

 

One of my sites

No longer giving free advice. Please place deposit in meter slot provided.  Individual: [=] SME: [==] Corporation: [===]
If deposit does not fit one of the slots provided then you are asking too much! :P

Is your Osc dated try Phoenix  raising oscommerce from the ashes.

Link to comment
Share on other sites

Find the following line in admin/categories.php

 

 

 

if (isset($HTTP_POST_VARS['products_image']) && tep_not_null($HTTP_POST_VARS['products_image']) && ($HTTP_POST_VARS['products_image'] != 'none')) {

            $sql_data_array['products_image'] = tep_db_prepare_input($HTTP_POST_VARS['products_image']);

          }

 

 

 

 

 

Replace with:

 

 

 

if (isset($HTTP_POST_VARS['products_image']) && tep_not_null($HTTP_POST_VARS['products_image']) && ($HTTP_POST_VARS['products_image'] != 'none')) {

            $sql_data_array['products_image'] = tep_db_prepare_input($HTTP_POST_VARS['products_image']);

          }

else {

        $sql_data_array['products_image'] = "no_image.gif";

}

 

 

Upload default no image "no_image.gif" in catalog/images

 

Hope it solves your problem!

 

Make a backup of your file before modifications.

No longer giving free advice. Please place deposit in meter slot provided.  Individual: [=] SME: [==] Corporation: [===]
If deposit does not fit one of the slots provided then you are asking too much! :P

Is your Osc dated try Phoenix  raising oscommerce from the ashes.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...