Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Change -> for a new arrow image


warrenerjm

Recommended Posts

I know that this line puts the -> AFTER the category name.

 

      if (tep_has_category_subcategories($counter)) {
       $categories_string .= '->';
     }

 

Looking at a previous 2.2 add-on I can see this is for the new arrows BEFORE the category name (blue) & sub category (light blue)

 

if ($cat['has_subcat']) {
       $categories_string .= tep_image(DIR_WS_IMAGES . 'pointer_blue.gif', '');
     } else {
       $categories_string .= tep_image(DIR_WS_IMAGES . 'pointer_blue_light.gif', '');
}

 

But if I change the above to this the new arrows will still appear AFTER the category name?

 

      if (tep_has_category_subcategories($counter)) {
       $categories_string .= tep_image(DIR_WS_IMAGES . 'pointer_blue.gif', '');
     } else {
       $categories_string .= tep_image(DIR_WS_IMAGES . 'pointer_blue_light.gif', '');
     }      

 

The categories box looks different to the others so I'm not sure what other code I need to put the new blue arrow image BEFORE the top level & the light blue arrow in subsequent sub-categories?

 

Any help please?

 

Thanks

Julie

Link to comment
Share on other sites

Then you need to add the this block before the category name in the file

 

Simplified it is like this

 

categories_string = '';

categories_string .= $my_name;

categories_string .= $Emoticon;

categories_string .= $your name;

 

if I print this out I have George :) Julie

 

If I want the emoticon before both names I need to do

categories_string .= $Emoticon;

categories_string .= $my_name;

categories_string .= $your name;

 

So I have :thumbsup: George Julie

 

The .= is adding stuff to the $categories_string in the order it is listed in the file

Link to comment
Share on other sites

Easy when you have clear instructions :thumbsup: thanks

 

Now I am unsure if I am happy with it >_<

 

I like an image before the category names (present image just to see if it works)but my suggested code show the first 3 default with a blue arrow & the last category (with no sub categories) as a light blue arrow. That one looks odd, but this light blue arrow is needed for the sub categories. When you open the top category with sub categories it flows well.

 

Any suggested options?

Link to comment
Share on other sites

Well, the box know about the level you are on and about the parent

$tree[$counter]['parent']

$tree[$counter]['level']

 

You can use this info, to make one more condition in your condition to say for example, "if we are on the level 0 then use dark blue"

Link to comment
Share on other sites

This works ... I think but is it right coding, as I don't mention the sub categories?

 

      if ($tree[$counter]['parent'] == 0) {
       $categories_string .= tep_image(DIR_WS_IMAGES . 'pointer_blue.gif', '');
     } else {
       $categories_string .= tep_image(DIR_WS_IMAGES . 'pointer_blue_light.gif', '');
     }

 

I "may" add something after the name to say it has sub categories, but not - @ g t ;

I "will" change the pointer_blue.gif & pointer_blue_light.gif to suit site.

 

On that note is there somewhere to get free commercial use icons/images. I know you need to be careful & they don't always make it clear whether they are ok to use or not. :huh: I look for copyright free? I have Photoshop but not learnt much of that either. This is why it is taking me so long! :(

 

Your help understanding the code is much appreciated. :D

Link to comment
Share on other sites

      if ($tree[$counter]['parent'] == 0) { // we have top level
       $categories_string .= tep_image(DIR_WS_IMAGES . 'pointer_blue.gif', ''); // dark on top level always
     } else { // we don't have top level
       if (tep_has_category_subcategories($counter)) { // we have subcats
         $categories_string .= tep_image(DIR_WS_IMAGES . 'pointer_blue.gif', ''); // dark on sublevel if subcategories
       } else { // we don't have subcats
         $categories_string .= tep_image(DIR_WS_IMAGES . 'pointer_blue_light.gif', ''); // light on sublevel if no subcategories
       }   
     }

 

Don't make such a big deal because of an arrow, focus on other things in the store

Link to comment
Share on other sites

Change:

 

$categories_string .= '<a  href="';

 

to:

 

$categories_string .= '<a ';

     if (tep_has_category_subcategories($counter)) {
       $categories_string .= ' class="cattree" ';
     }

     $categories_string .= ' href="';

 

and that top category will have a class of cattree. You can then add the bullet as a background image in the stylesheet. (You would then delete the '->' in

categories_string .= '->';)

Oscommerce site:

 

 

OSC to CSS, http://addons.oscommerce.com/info/7263 -Mail Manager, http://addons.oscommerce.com/info/8120

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...