Results 1 to 5 of 5

Help Understanding Categories

This is a discussion on Help Understanding Categories within the osCmax v1.7 Discussion forums, part of the osCmax v1.7 Forums category; I am new to OScommerce, and I'm having trouble understanding the categories, I would appreciate any suggestions. The data which ...

      
  1. #1
    New Member
    Join Date
    Sep 2004
    Posts
    9
    Rep Power
    0


    Default Help Understanding Categories

    I am new to OScommerce, and I'm having trouble understanding the categories, I would appreciate any suggestions. The data which we upload into oscommerce, comes from MS Access, we've assigned the relevant field to be used as the category, unfortunately, the descriptions in this field, only makes sense internally, when viewed on the website, they just look like a bunch of giberish. How would I go about, defining the category descriptions in OSCommerce, so that they show up on the website with meaningful terminology? An example, in our database, dom= Domestic, impor= Import, ect, currently the "dom" and "impor" are showing up as categories, when imported via easypopulate. Is there a way to tell oscommerce that impor=Import and dom =Domestic,I am trying to avoid changing the categories in MS Access, because they are relevant in our day to day business, they just aren't user friendly. Thanks

  2. #2
    Active Member
    Join Date
    Jan 2003
    Location
    Surrey, UK
    Posts
    126
    Rep Power
    0


    Default

    Can't you just change the category name in the OSC admin?

    I am not sure if this is overwritten each time you use easypopulate, I never got on with that "upgrade". If it does, you can 'translate' by setting up an array at the top of (or preferably in a separate file but that's just for neatness) includes/boxes/categories.php. It would be something like this:

    $translation = array();
    $translation['impor'] = 'import';
    $translation['dom'] = 'domestic'];

    So that each of your abbreviations is the key to the correct word.

    Then, on line 35-ish (not sure as I've mod'd my one quite a bit), change:

    $categories_string .= $tree[$counter]['name'];

    to:

    $categories_string .= $translation[$tree[$counter]['name']];


    that should do it.


    hope that helps


    jon

  3. #3
    New Member
    Join Date
    Sep 2004
    Posts
    9
    Rep Power
    0


    Default

    Jon, thanks for your response. I tried changing the names in the admin section first, but I had two problems, First, all the categories disappeared from the category box on the homepage, and second, during the next easypopulate upload, it just added the original categories, giving both the old and new categories.

    I checked the includes/boxes/categories.php file, but I did not find the statement

    $categories_string .= $tree[$counter]['name'];

    the closest match was

    $boxContent .= $tree[$counter]['name'];

  4. #4
    Active Member
    Join Date
    Jan 2003
    Location
    Surrey, UK
    Posts
    126
    Rep Power
    0


    Default

    yes, that is probably it, I think I was looking at a non-MAX version of OSC. Sorry

    So try the following:

    1) at the top of the page, inside the php tags, insert the following:

    $translation = array();
    $translation['impor'] = 'import';
    $translation['dom'] = 'domestic'];


    2) Then, replace your existing code:

    $boxContent .= $tree[$counter]['name'];

    with:

    $boxContent .= $translation[$tree[$counter]['name']];

    and see if that works. The category named 'impor' should now appear as 'import' as desired. Hopefully. Be aware that it is case-sensitive.

    The best way to do what you want would be to add an extra field to the database which contains your correct category name, and to create an admin tool etc etc... but this hack should work.

    jw

  5. #5
    New Member
    Join Date
    Sep 2004
    Posts
    9
    Rep Power
    0


    Default

    Jon, I've been away, so I haven't had a chance to try your last suggestion yet. I'll give it a try Monday. Thanks for your help.

Similar Threads

  1. Categories.php
    By kwiznoz in forum osCmax v2 Customization/Mods
    Replies: 0
    Last Post: 08-18-2005, 10:58 AM
  2. Help with categories
    By krissj in forum osCmax v1.7 Discussion
    Replies: 1
    Last Post: 12-09-2004, 12:41 PM
  3. Want to show categories AND sub categories in index.php!!
    By calle in forum osCommerce 2.2 Modification Help
    Replies: 0
    Last Post: 10-27-2004, 12:51 PM
  4. CATEGORIES BOX does not display categories list
    By glk in forum osCmax v1.7 Discussion
    Replies: 2
    Last Post: 03-05-2004, 11:09 AM
  5. having real trouble understanding Dynamic Mo Pics
    By Anonymous in forum osCmax v1.7 Discussion
    Replies: 2
    Last Post: 02-23-2004, 10:10 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •