WordPress.org

Ready to get started?Download WordPress

Forums

WooCommerce - excelling eCommerce
[resolved] Rename "Categories" and "Products" (45 posts)

  1. FishFush
    Member
    Posted 1 year ago #

    Hi,

    I have a WooCommerce shop with a WooTheme, it's great, but the words "categories" and "products" that appear all over the store are not appropriate for my uses.

    How do I rename them site-wide?

    For example, I mean things like:
    - "Home / Shop / Products / Example" in the breadcrumb navigation
    - "Featured Products", "Recent Products" and "Product Categories" on the homepage
    - "Category: Example" on the product page

    I would prefer:
    - "Authors" instead of categories
    - "Items" instead of products

    Thank you. (I have considered using attributes, but that wouldn't work as I'm using them for other purposes.)

    http://wordpress.org/extend/plugins/woocommerce/

    P.S. I would also like to rename the "Add to cart" button to be "Purchase" or "Acquire", and take away the quantity selectors.

  2. royho
    Member
    Posted 1 year ago #

    This is best to use PO/MO to translate the words in question to what you want.

  3. FishFush
    Member
    Posted 1 year ago #

    Thanks, you mean this?

    http://codex.wordpress.org/Translating_WordPress

    And then making it into a plugin?

    http://codex.wordpress.org/Writing_a_Plugin

    (The plugin would be for WooCommerce, correct? Or would it be for the theme?)

    How long do you think it'd take to do all this + learn? Thanks!

  4. royho
    Member
    Posted 1 year ago #

    No no...You don't need to make a plugin or do anything complicated. Just use a FREE PO editor program and create a new PO file and from there you can change the text. If you look at the translating document in the WordPress codex as you have link to, there is a section showing you how to use a PO editor to do what you want.

  5. FishFush
    Member
    Posted 1 year ago #

    Thanks! :)

    Where do I find the en_US .pot file? I only see en_GB, and I'd like to keep everything as-is on the store, just these few changes.

    And once I get this US file, and make the changes with Poedit and save a .po or .mo file, what do I do with it?

    Thanks :)

  6. helgatheviking
    Member
    Posted 1 year ago #

    FULL STOP! You don't need to do any translating. Presuming I understand what you are trying to do, WooCommerce has built-in plugin options to do this.

    In your dashboard, go to WooCommerce->Settings>Pages

    wp-admin/admin.php?page=woocommerce_settings&tab=pages

    Then specifically the section on Permalinks.

    Change the product slug to item and the product category slug to author... use what is already available, don't hack the .po files.

    PS- after you change the permalinks you will have to go to Settings>Permalinks and click save (to flush the re-write rules) or you will get 404 errors.

  7. FishFush
    Member
    Posted 1 year ago #

    Hey Helga,

    The slug changes the URL, but it doesn't change the term across the store. I want to change what customers see :)

    For example, I mean things like:
    - "Home / Shop / Products / Example" in the breadcrumb navigation
    - "Featured Products", "Recent Products" and "Product Categories" on the homepage
    - "Category: Example" on the product page

  8. FishFush
    Member
    Posted 1 year ago #

    I just tried the CodeStyling plugin, but it only seems to show back-end text. What I want to change is how the shop appears to visitors.

    Maybe I did something wrong?

    1. I created a new language for the WooCommerce Plugin (selected en_US)
    2. I hit rescan
    3. I entered the edit mode and searched for "Featured Products", "Recent Products", but nothing came up

    Am I meant to translate the WooThemes files instead? For my WooTheme (Mystile), I only see one language file: en_GB... that's strange, I thought that the theme was in US english?

  9. royho
    Member
    Posted 1 year ago #

    Don't forget you need to change a setting in wp_config.php to use your newly translated text (WP_LANG)...Either that or you modified the en_GB.po directly, then you don't have to change that line. But then you may need to watch out for updates if you do it this way.

  10. FishFush
    Member
    Posted 1 year ago #

    Ah cool thanks!

    So the default language for the Mystile WooTheme is en_GB? Or is there a default en_US hidden somewhere?

    It looks like everything is spelt the American way anyway: color, localization, etc.

    Thanks!

  11. royho
    Member
    Posted 1 year ago #

    Well you're not trying to edit the woothemes theme translations, but the WooCommerce translations because "products" and "categories" text is declared in the WooCommerce plugin, not your themes. So look for the languages folder within the plugin, not theme.

  12. FishFush
    Member
    Posted 1 year ago #

    Ah, OK

    But also there it seems that the default is en_GB?

  13. royho
    Member
    Posted 1 year ago #

    That's fine...You can easily copy that and rename it to say en_US.po and make your changes there so it will not be overridden on updates.

  14. FishFush
    Member
    Posted 1 year ago #

    Cool thanks Royho!

    By copy, do you mean, make a new file, and click "Rescan"? And in the wp_config.php file I just set WPLAND to en_US and it works :)

    But can that cause any bugs in the future if, for example, en_US isn't available for certain themes/plugins?

    Important question:

    Is there any disadvantage to using this CodeStylers Localization over manual .po file creation and stuff? Does it slow down the store in any way?

    Once I'm done editing the respective files and have evrything set up, can I disable the Localization plugin?

  15. royho
    Member
    Posted 1 year ago #

    Bugs? no there will not be any bugs...You may just have to rescan from time to time if WooCommerce added anything new but it is not something you need to worry about because if your target audience is already in English. And yes if you're not targeting other languages, you don't really need a fullblown translation plugin to do small edits like this.

    No, it will not slow your site down in either case unless the plugin has poor coding but not likely in this case.

  16. FishFush
    Member
    Posted 1 year ago #

    Thanks!

    Can I disable the plugin once I'm done editing everything?

    By the way, I'm searching the WooCommerce plugin for "Recent Products" but nothing comes up apart from "WooCommerce Recent Products" and changing that does nothing to the actual page.

    "Recent Products" is what appears on my homepage...

    ...it must be somewhere?

    Maybe this is from the Theme then?

  17. FishFush
    Member
    Posted 1 year ago #

    Actually the same goes for these on the homepage:
    - Featured Products
    - Recent Products

    They're unchangeable for some reason...

  18. royho
    Member
    Posted 1 year ago #

    This is something you have to research because some text could be custom by your theme and some are not. I would not know as I can't see your theme.

  19. FishFush
    Member
    Posted 1 year ago #

    Thanks

    It's not a custom theme, but an out-of-the-box WOoTheme (Mystile)

  20. royho
    Member
    Posted 1 year ago #

    Hehe, that means its custom theme. Anything that is not using default WooCommerce templates is custom.

  21. FishFush
    Member
    Posted 1 year ago #

    ...but there's no way to disable the theme and have "pure" WC running anyway.

    Essentially, this theme should get along well with WC :|

    And not override functions, as it seems to be doing now

  22. royho
    Member
    Posted 1 year ago #

    Hmmm but you can...WC will work out of the box with just default 2011 theme if you want...But that is beside the point. Your issue isn't because it is a custom theme or not. Is just the fact that some translations may be in the plugin and some in the theme depending on the context.

  23. FishFush
    Member
    Posted 1 year ago #

    Ah, so it's not a bug or anything?

  24. royho
    Member
    Posted 1 year ago #

    Nope...

  25. helgatheviking
    Member
    Posted 1 year ago #

    @FishFush, guess I misunderstood. Sorry for the misleading answer. Still, I can almost guarantee there is a filter for this...

    btw- "All Products" on the shop page is still set in the plugin options I referred to above.

  26. FishFush
    Member
    Posted 1 year ago #

    Yeah, I can change All Products, but nothing else.

    I looked everywhere in the settings, literally. Can you find it?

    Thanks!

  27. helgatheviking
    Member
    Posted 1 year ago #

    It isn't a WooCommerce setting. And I looked and I guess it isn't a WC filter either. In fact, I am not 100% sure that it isn't coming from your theme.

    But you can still filter the text strings as follows: (add to your theme's functions.php) **NB: untested

    add_filter( 'gettext', 'kia_text_strings', 20, 3 );
    /**
     * Change text strings
     *
     * @link http://codex.wordpress.org/Plugin_API/Filter_Reference/gettext
     */
    function kia_text_strings( $translated_text, $text, $domain ) {
    
            switch ( $translated_text ) {
    
                case 'Featured Products' :
    
                    $translated_text = __( 'Featured Items', 'theme_text_domain' );
                    break;
    
                case 'Recent Products' :
    
                    $translated_text = __( 'Recent Items', 'theme_text_domain' );
                    break;
    
                case 'Product Categories' :
    
                    $translated_text = __( 'Authors', 'theme_text_domain' );
                    break;
            }
    
        return $translated_text;
    }
  28. royho
    Member
    Posted 1 year ago #

    In my opinion, using PO file is still the best way and much easier and that is what it is used for. It's not just for translating to a different language. In addition, it is update.

  29. helgatheviking
    Member
    Posted 1 year ago #

    If you hack the .po file in the WC folder then you lose your customizations every time WooCommerce updates.

  30. royho
    Member
    Posted 1 year ago #

    No, you don't need to hack anything...just make a copy of it to another name such as en_US.po...

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.