About Club osCommerce

Showcasing osCommerce - the good, the bad and the ugly!

StumbleUpon It! DIGG It!

Let's see what we have here

Written By Gary on Jul 28 2008 ·

"Let's see what we have here" - a piece of text that shows as the title in each of your category pages. Absolutely useless! You should change this to something more interesting and useful (in terms of user experience and SEO) such as the title of the category - doing this is very simple...

Open up /includes/languages/english/index.php and find:

PHP:
  1. define('HEADING_TITLE', 'Let\'s See What We Have Here');

Change to:

PHP:
  1. define('HEADING_TITLE', ucwords(strtolower($categories['categories_name'])));

Save and upload. Done.

There is a slight problem once you've done this, but I'll cover that in a future post - inthe meantime I wonder if any of you can work out what the problem is? The first person to spot the problem and present a solution will win a prize...


Buy Gary A Beer?
Buying me a "beer" helps me to keep my contributions updated and keep this blog alive. Cheers!


16 Comments

  1. Have no idea what the problem is. Love this idea tho.
    Pretty cool.

    Only thing I can really see and it most likely is meant to be that way is that until you get to the sub-Categories (if using) Is you get the word Categories there. Would be even cooler if say the Main Category name was there instead.

    Comment by cassie — July 29, 2008 @ 12:35 am


  2. define('HEADING_TITLE', ucwords(strtolower($categories[\'categories_name\'])));

    Comment by jared — July 29, 2008 @ 6:35 am


  3. That line of code wouldn't be terribly helpful on the main index page anyway. No categories have been selected.

    Comment by jared — July 29, 2008 @ 6:37 am


  4. Cassie - in that case, just also change this line ;)

    define('HEADING_TITLE', 'Categories');

    Jared - good try, but it should work OK without the ' escapes.

    Comment by Gary — July 29, 2008 @ 8:27 am


  5. I believe it's the problem is that the language file is called before the $categories query is run.

    Comment by John — July 30, 2008 @ 1:46 pm


  6. Forgive the bad grammer in the previous post. Just starting the day off a long night. :)

    Comment by John — July 30, 2008 @ 1:47 pm


  7. John - that shouldn't affect it.

    The problem is the "manufacturers" name - it simply will not show as we are only asking the script to show the category name.

    Most shops probably would never notice it - but if your shop does use Manufacturers, and you made this modification, then you need a bit of extra code to deal with it.

    Anyone come up with the extra bit of code?

    Comment by Gary — July 30, 2008 @ 9:53 pm


  8. You are a legend Gary :)
    Thanks for that tip.

    Comment by cassie — July 31, 2008 @ 8:02 am


  9. 5f you are changing this for SEO you should also add

    Comment by Bean Coffee Shop — July 31, 2008 @ 3:40 pm


  10. BCS - I'm guessing you added code which wordpress managed to eat. If you send it me via email I'll add it to your comment.

    Cheers.

    Comment by Gary — August 1, 2008 @ 6:28 pm


  11. Oh - no-one took up the challenge, so here you are:

    $category_name = (isset($HTTP_GET_VARS['manufacturers_id'])) ? $manufacturers['manufacturers_name'] : $categories['categories_name'];
    define('HEADING_TITLE', ucwords(strtolower($category_name)));

    This will show the manufacturers name instead of the category nam when in the manufacturer structure of index.php

    Comment by Gary — August 1, 2008 @ 6:29 pm


  12. I guess it did eat it. It was the EXACT code you added but mine got eaten … ;) So where is my prize???

    Okay, all I put was that you needed the H1 tags around the code that displays it on the page which would make is better in terms of SEO.

    Comment by Bean Coffee Shop — August 2, 2008 @ 11:59 am


  13. Wordpress is ultra annoying when commenting code - reckon this is what you wanted:

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

    in your index page?

    I agree that this would be much more suitable for SEO purposes - ally that to the changes made in the original post and my follow up comment and we have something that is more useful for every store.

    My next addition would be to code up my own flavour of "Category/Manufacturer Descriptions" and print that in the index structure too. Thoughts? I know there is already some contributions for this, but I like coding my own where possible.

    Comment by Gary — August 2, 2008 @ 12:06 pm


  14. Sorry Gary, for SEO that should have been an h2 tag as there is a better place for the h1 tag and it is a good little trick. I sent you an email with where the h1 tag should go. It should be higher on the page.

    Comment by Bean Coffee Shop — August 2, 2008 @ 1:08 pm


  15. Thanks Gary. I'm designing a site for my wife's business and couldn't for the life of me figure out how to remove this dumb line LOL. I really appreciate the help and tutorial.

    Comment by John Hoff — November 30, 2008 @ 9:20 am


  16. John - you are welcome.

    Comment by Gary — November 30, 2008 @ 11:18 am


Leave a comment

RSS feed for comments on this post · TrackBack URL

Hot 100 osCommerce Shops

View the osCommerce HOT 100These are the best looking, most exceptional osCommerce Stores as voted for by you.

New to osCommerce - get inspiration from these beautiful shops. Reckon your site has what it takes to become a member of the HOT 100? Submit it!