Results 1 to 8 of 8
  1. #1
    Join Date
    Jul 2010
    Location
    Australia
    Posts
    231
    Plugin Contributions
    0

    Default Remove 'site title' from product title meta

    For all my products, the meta title is:

    "product title" : "site title"

    I would like it to be just "product title" for all my product pages. Where can I make this change globally?

    Thanks a lot!

  2. #2
    Join Date
    Jul 2010
    Location
    Australia
    Posts
    231
    Plugin Contributions
    0

    Default Re: Remove 'site title' from product title meta

    I've checked my meta_tages.php, it seems to be the standard one, there is no override file, but I can't figure out the code that forms the product title.
    In case you're wondering, yes I have search the forum for at least an hour, but could not find the specific solution to my problem.
    Would really appreciate the help, thanks guys!

  3. #3
    Join Date
    Nov 2005
    Location
    los angeles
    Posts
    2,688
    Plugin Contributions
    9

    Default Re: Remove 'site title' from product title meta

    you are in the right place. the variable you are looking for is:

    $meta_products_name

    it starts on line 216 and the final assignment is on line 248 (just for the products page).

    to me, it looks like line 228 adds the extra stuff that you want to eliminate.

    if you were to change the value of:

    metatags_title_tagline_status

    to 0 for all your products in the products table, you would accomplish what you are looking for.

    good luck.
    author of square Webpay.
    mxWorks has premium plugins. donations: venmo or paypal accepted.
    premium consistent excellent support. available for hire.

  4. #4
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Remove 'site title' from product title meta

    Easy: just change the metatag switch for that product:

    Name:  Image 2018-01-01 at 11.45.38 PM.jpg
Views: 151
Size:  25.2 KB
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  5. #5
    Join Date
    Jul 2010
    Location
    Australia
    Posts
    231
    Plugin Contributions
    0

    Default Re: Remove 'site title' from product title meta

    Quote Originally Posted by DrByte View Post
    Easy: just change the metatag switch for that product:
    Thank you. Yes I tried that, that does not change anything for my site.

  6. #6
    Join Date
    Jul 2010
    Location
    Australia
    Posts
    231
    Plugin Contributions
    0

    Default Re: Remove 'site title' from product title meta

    Quote Originally Posted by carlwhat View Post
    you are in the right place. the variable you are looking for is:

    $meta_products_name

    it starts on line 216 and the final assignment is on line 248 (just for the products page).

    to me, it looks like line 228 adds the extra stuff that you want to eliminate.

    if you were to change the value of:

    metatags_title_tagline_status

    to 0 for all your products in the products table, you would accomplish what you are looking for.

    good luck.
    Thank you!

    Here is the section of code you mentioned:
    Code:
    if ($product_info_metatags->EOF) {
        $meta_tags_over_ride = true;
      } else {
        // custom meta tags per product
        if (!empty($product_info_metatags->fields['metatags_keywords']) or !empty($product_info_metatags->fields['metatags_description'])) {
          $meta_products_name = '';
          $meta_products_price = '';
          $metatags_keywords = '';
    
          $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_PRICE_IS_FREE_TEXT) : '');
    
          $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_status'] == '1' ? ' ' . $product_info_metatags->fields['metatags_title'] : '');
          $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_name .= $meta_products_price;
          }
          $meta_products_name .= ($product_info_metatags->fields['metatags_title_tagline_status'] == '1' ? PRIMARY_SECTION . TITLE . TAGLINE : '');
    
          if (!empty($product_info_metatags->fields['metatags_description'])) {
            // use custom description
            $metatags_description = $product_info_metatags->fields['metatags_description'];
          } else {
            // no custom description defined use product_description
            $metatags_description = zen_truncate_paragraph(strip_tags(stripslashes($product_info_metatags->fields['products_description'])), MAX_META_TAG_DESCRIPTION_LENGTH);
          }
    
          $metatags_description = zen_clean_html($metatags_description);
    
          if (!empty($product_info_metatags->fields['metatags_keywords'])) {
            // use custom keywords
            $metatags_keywords = $product_info_metatags->fields['metatags_keywords'] . METATAGS_DIVIDER . CUSTOM_KEYWORDS;  // CUSTOM skips categories
          } else {
            // no custom keywords defined use product_description
            $metatags_keywords = KEYWORDS . METATAGS_DIVIDER . $meta_products_name . METATAGS_DIVIDER;
          }
    
          define('META_TAG_TITLE', str_replace('"','',zen_clean_html($review_on . $meta_products_name)));
          define('META_TAG_DESCRIPTION', str_replace('"','',zen_clean_html($metatags_description . ' ')));
          define('META_TAG_KEYWORDS', str_replace('"','',zen_clean_html($metatags_keywords)));  // KEYWORDS and CUSTOM_KEYWORDS are added above
    Line 228 is this:
    Code:
          $meta_products_name .= ($product_info_metatags->fields['metatags_title_tagline_status'] == '1' ? PRIMARY_SECTION . TITLE . TAGLINE : '');
    What should it be changed to? It looks to me that it's the bit after the ":" that needs to be eliminated.
    Note that it's the site title that's being added to the product.

    I'm not comfortable made changes to the database directly, but can handle some edits to the files.

    Thank you so much for taking the time to have a look! I'd buy you a drink if you were local.
    Last edited by ttfan; 2 Jan 2018 at 06:05 AM.

  7. #7
    Join Date
    Nov 2005
    Location
    los angeles
    Posts
    2,688
    Plugin Contributions
    9

    Default Re: Remove 'site title' from product title meta

    Quote Originally Posted by DrByte View Post
    Easy: just change the metatag switch for that product:

    Name:  Image 2018-01-01 at 11.45.38 PM.jpg
Views: 151
Size:  25.2 KB
    i think that is what i suggested in my post above....

    as @ttfan has stated, that does not work. he looks to be correct! line 214:

    PHP Code:
    // custom meta tags per product
    if (!empty($product_info_metatags->fields['metatags_keywords']) or !empty($product_info_metatags->fields['metatags_description'])) {
    // first bunch of code
    } else {
    // build un-customized meta tag
    // second bunch of code

    changing that flag only works for the first bunch of code above; NOT the second bunch of code!

    @ttfan change line 279 as follows:

    PHP Code:
    //from
    define('META_TAG_TITLE'str_replace('"','',$review_on $meta_products_name $meta_products_price PRIMARY_SECTION TITLE TAGLINE));

    //to
    define('META_TAG_TITLE'str_replace('"','',$review_on $meta_products_name $meta_products_price)); 
    let us know how it goes.

    best.
    author of square Webpay.
    mxWorks has premium plugins. donations: venmo or paypal accepted.
    premium consistent excellent support. available for hire.

  8. #8
    Join Date
    Jul 2010
    Location
    Australia
    Posts
    231
    Plugin Contributions
    0

    Default Re: Remove 'site title' from product title meta

    That's done the trick, awesome carlwhat!!!

 

 

Similar Threads

  1. v151 how to remove site title from product meta
    By jennydutch in forum Customization from the Admin
    Replies: 0
    Last Post: 21 Oct 2014, 03:49 PM
  2. Replies: 0
    Last Post: 28 Oct 2013, 11: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