Results 1 to 7 of 7
  1. #1
    Join Date
    Jan 2006
    Posts
    57
    Plugin Contributions
    0

    Default Customized Product (and Category) Meta Tags

    I'd like to customize meta tags on product pages so that they follow a custom sequence / display. The current sequence is something like:

    $product_name [$model] - $price: $business

    Then if I go into product meta tags and edit the "Meta Title" it changes to:

    $product_name $meta_tag_title [$model] - $price: $business

    What I would like to see is:

    $model [$product_name] $price - $meta_tag_title - $business

    I realize there is a limited number of characters to work with and can work with that. I assume this is done in meta_tags.php but I don't know which area to edit and the correct variables to make it happen. Thx

  2. #2
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,828
    Plugin Contributions
    9

    Default Re: Customized Product (and Category) Meta Tags

    I do not see where $business is a variable stored??
    Zen-Venom Get Bitten

  3. #3
    Join Date
    Jan 2006
    Posts
    57
    Plugin Contributions
    0

    Default Re: Customized Product (and Category) Meta Tags

    If the title tag is not already too long, it appears to display the business name which I think is grabbed from the store configuration. I don't care so much about that as I do rearranging some of the other elements.

    $model [$product_name] $price - $meta_tag_title - $business

    OR

    $model [$product_name] $price - $meta_tag_title

    if the first option does not work.

  4. #4
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,828
    Plugin Contributions
    9

    Default Re: Customized Product (and Category) Meta Tags

    That information is grabbed by /includes/modules/meta_tags_php

    Make a copy of that file for your template
    Zen-Venom Get Bitten

  5. #5
    Join Date
    Jan 2006
    Posts
    57
    Plugin Contributions
    0

    Default Re: Customized Product (and Category) Meta Tags

    I know of the meta_tags.php file but without knowing the zencart framework of how this is created it will take a great deal of time to sort out what affects what, how the variables are implemented, etc. Can you provide some direction, what I am looking for?

  6. #6
    Join Date
    Jan 2006
    Posts
    57
    Plugin Contributions
    0

    Default Re: Customized Product (and Category) Meta Tags

    Which is the part of this file that I should be focusing on, which variables etc?

  7. #7
    Join Date
    Jan 2006
    Posts
    57
    Plugin Contributions
    0

    Default Re: Customized Product (and Category) Meta Tags

    okay I figured it out, beginning around line 214 in meta_tags.php. I used something like the following, stripping out some square brackets, dash and spaces along the way:

    // CUSTOM //

    $meta_products_price = ($product_info_metatags->fields['metatags_price_status'] == '1' ? SECONDARY_SECTION . ($product_info_metatags->fields['products_price_sorter'] > 0 ? $currencies- >display_price($product_info_metatags->fields['products_price_sorter'], zen_get_tax_rate($product_info_metatags->fields['products_tax_class_id'])) : SECONDARY_SECTION . META_TAG_PRODUCTS_PRI CE_IS_FREE_TEXT) : '');

    $meta_products_name .= ($product_info_metatags->fields['metatags_model_status'] == '1' ? '' . $product_info_metatags->fields['products_model'] . '' : '');
    if (zen_check_show_prices() == true) {
    $meta_products_price = "$meta_products_price";
    $meta_products_price = $content = str_replace('-', '',$meta_products_price);
    $meta_products_price = $content = str_replace(' ', '',$meta_products_price);
    $meta_products_name .= " [$meta_products_price] ";
    }
    $meta_products_name .= ($product_info_metatags->fields['metatags_products_name_status'] == '1' ? $product_info_metatags->fields['products_name'] : '');
    $meta_products_name .= ($product_info_metatags->fields['metatags_title_tagline_status'] == '1' ? PRIMARY_SECTION . TITLE . TAGLINE : '');

    // END CUSTOM //

    It could probably be more efficient but it works.

 

 

Similar Threads

  1. Replies: 1
    Last Post: 27 Nov 2008, 02:27 PM
  2. Category/Product Meta Tags
    By amypintx in forum Setting Up Categories, Products, Attributes
    Replies: 2
    Last Post: 29 Dec 2007, 11:38 PM
  3. Custom meta tags for category and products
    By camay123 in forum General Questions
    Replies: 11
    Last Post: 28 Nov 2007, 02:50 AM
  4. meta tags for category and subcategory pages
    By dealbyethan.com in forum General Questions
    Replies: 2
    Last Post: 17 Feb 2007, 02:22 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
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR