Page 1 of 2 12 LastLast
Results 1 to 10 of 12
  1. #1
    Join Date
    Apr 2007
    Location
    Sydney
    Posts
    109
    Plugin Contributions
    0

    Default [Done 1.3.9a] default category meta tags not working after removing custom tags

    While experiementing with the category meta tags, I notice that once custom meta tags are defined for a category, it seems impossible to restore to the previous default tags.

    I completely removed custom tags so that admin biohazard button goes from orange to black again, but the default tags do not re-appear. So despite admin saying "meta tags undefined", Zen Cart actually remains in the "custom-tag" state. Is this the expected behaviour?

  2. #2
    Join Date
    Jan 2004
    Posts
    66,363
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: default meta tags not working after removing custom tags

    If you remove the metatags, leaving them blank, the expected behavior is that the default metatags would be generated.

    What is the URL where this can be seen?

    Note: If you were expecting them to suddenly change on Google, you'll have to wait to be re-indexed by the search engines.
    .

    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.

  3. #3
    Join Date
    Apr 2007
    Location
    Sydney
    Posts
    109
    Plugin Contributions
    0

    Default Re: default meta tags not working after removing custom tags

    DrByte thank you for your fast response! The site is not live yet so I'm not talking about google, but rather the browser page title and meta tags in the source document (they are all empty).

    I was able to duplicate this on an almost 100% new install. But I'll test again on a brand new install just to make sure.

  4. #4
    Join Date
    Apr 2007
    Location
    Sydney
    Posts
    109
    Plugin Contributions
    0

    Default Re: default meta tags not working after removing custom tags

    OK I just installed a new database and 1.3.8, and the unexpected behaviour persists.

    This is what I did:


    1. Install new Zen Cart with test products, keep default settings

    2. In admin, click the biohazard button for Mixed Product Types category, at this time the button is black

    3. Write something in meta description, save; biohazard button automatically turns orange

    4. Click again the biohazard button for Mixed Product Types category, delete everything so that all meta boxes are empty; save

    5. Biohazard button is now black, which is expected. But if you go to store, click the Mixed Product Types category, you see nothing in browser's title bar, except maybe "Mozilla Firefox". Meta tags are empty in page source. So that's why I think Zen Cart remains in "custom tags" state.


    In step 3-4 you can alternatively simply click save without entering any meta tag, and you get to step 5.


    I tested this with XAMPP 1.6.6
    Apache 2.2.8
    MySQL 5.0.51a
    PHP 5.2.5

  5. #5
    Join Date
    Jan 2004
    Posts
    66,363
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: default meta tags not working after removing custom tags

    Thanks for the detailed steps.

    Confirmed as a bug in 1.3.x.

    Moving to bug reports area.
    .

    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.

  6. #6
    Join Date
    Jan 2004
    Posts
    66,363
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: default meta tags not working after removing custom tags

    Workaround:

    edit /admin/categories.php
    around line 240 you'll see a block of code like this:
    Code:
          // bof: categories meta tags
          case 'update_category_meta_tags':
          // add or update meta tags
          //die('I SEE ' . $action . ' - ' . $_POST['categories_id']);
          $categories_id = $_POST['categories_id'];
          $languages = zen_get_languages();
          for ($i=0, $n=sizeof($languages); $i<$n; $i++) {
            $language_id = $languages[$i]['id'];
            $check = $db->Execute("select *
                                   from " . TABLE_METATAGS_CATEGORIES_DESCRIPTION . "
                                   where categories_id = '" . (int)$categories_id . "'
                                   and language_id = '" . (int)$language_id . "'");
            if ($check->RecordCount() > 0) {
              $action = 'update_category_meta_tags';
            } else {
              $action = 'insert_categories_meta_tags';
            }
    
            $sql_data_array = array('metatags_title' => zen_db_prepare_input($_POST['metatags_title'][$language_id]),
                                    'metatags_keywords' => zen_db_prepare_input($_POST['metatags_keywords'][$language_id]),
                                    'metatags_description' => zen_db_prepare_input($_POST['metatags_description'][$language_id]));
    
            if ($action == 'insert_categories_meta_tags') {
              $insert_sql_data = array('categories_id' => $categories_id,
                                       'language_id' => $language_id);
              $sql_data_array = array_merge($sql_data_array, $insert_sql_data);
    
              zen_db_perform(TABLE_METATAGS_CATEGORIES_DESCRIPTION, $sql_data_array);
            } elseif ($action == 'update_category_meta_tags') {
              if (empty($_POST['metatags_title'][$language_id]) && empty($_POST['metatags_keywords'][$language_id]) && empty($_POST['metatags_description'][$language_id])) {
                $remove_categories_metatag = "DELETE from " . TABLE_METATAGS_CATEGORIES_DESCRIPTION . " WHERE categories_id = '" . (int)$categories_id . "' and language_id = '" . (int)$language_id . "'";
                $db->Execute($remove_categories_metatag);
              } else {
                zen_db_perform(TABLE_METATAGS_CATEGORIES_DESCRIPTION, $sql_data_array, 'update', "categories_id = '" . (int)$categories_id . "' and language_id = '" . (int)$language_id . "'");
              }
            }
          }
    
          zen_redirect(zen_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&cID=' . $categories_id));
          break;
          // eof: categories meta tags
    change it to this:
    Code:
          // bof: categories meta tags
          case 'update_category_meta_tags':
          // add or update meta tags
          //die('I SEE ' . $action . ' - ' . $_POST['categories_id']);
          $categories_id = $_POST['categories_id'];
          $languages = zen_get_languages();
          for ($i=0, $n=sizeof($languages); $i<$n; $i++) {
            $language_id = $languages[$i]['id'];
            $check = $db->Execute("select *
                                   from " . TABLE_METATAGS_CATEGORIES_DESCRIPTION . "
                                   where categories_id = '" . (int)$categories_id . "'
                                   and language_id = '" . (int)$language_id . "'");
            if ($check->RecordCount() > 0) {
              $action = 'update_category_meta_tags';
            } else {
              $action = 'insert_categories_meta_tags';
            }
            if (empty($_POST['metatags_title'][$language_id]) && empty($_POST['metatags_keywords'][$language_id]) && empty($_POST['metatags_description'][$language_id])) {
              $action = 'delete_category_meta_tags';
            }
    
            $sql_data_array = array('metatags_title' => zen_db_prepare_input($_POST['metatags_title'][$language_id]),
                                    'metatags_keywords' => zen_db_prepare_input($_POST['metatags_keywords'][$language_id]),
                                    'metatags_description' => zen_db_prepare_input($_POST['metatags_description'][$language_id]));
    
            if ($action == 'insert_categories_meta_tags') {
              $insert_sql_data = array('categories_id' => $categories_id,
                                       'language_id' => $language_id);
              $sql_data_array = array_merge($sql_data_array, $insert_sql_data);
    
              zen_db_perform(TABLE_METATAGS_CATEGORIES_DESCRIPTION, $sql_data_array);
            } elseif ($action == 'update_category_meta_tags') {
              zen_db_perform(TABLE_METATAGS_CATEGORIES_DESCRIPTION, $sql_data_array, 'update', "categories_id = '" . (int)$categories_id . "' and language_id = '" . (int)$language_id . "'");
            } elseif ($action == 'delete_category_meta_tags') {
              $remove_categories_metatag = "DELETE from " . TABLE_METATAGS_CATEGORIES_DESCRIPTION . " WHERE categories_id = '" . (int)$categories_id . "' and language_id = '" . (int)$language_id . "'";
              $db->Execute($remove_categories_metatag);
            }
          }
    
          zen_redirect(zen_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&cID=' . $categories_id));
          break;
          // eof: categories meta tags
    .

    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.

  7. #7
    Join Date
    May 2007
    Posts
    42
    Plugin Contributions
    0

    Default Re: default meta tags not working after removing custom tags

    So glad I found this thread and the appropriate workaround. Thanks DrByte. :)
    121webconsultancy - Professional Website Design & Internet Marketing

  8. #8
    Join Date
    Jun 2007
    Location
    Shropshire UK
    Posts
    134
    Plugin Contributions
    0

    Default Re: default category meta tags not working after removing custom tags

    I tried this workaround and it did not work - until I removed the record from the database Table: meta_tags_categories_description

  9. #9
    Join Date
    Jan 2009
    Location
    Victoria Australia
    Posts
    100
    Plugin Contributions
    0

    Default Re: default category meta tags not working after removing custom tags

    Quote Originally Posted by Vinyl Signs View Post
    I tried this workaround and it did not work - until I removed the record from the database Table:
    meta_tags_categories_description
    Ditto.
    (Only I would have said that the workaround works, but you must also remove the record from the database.)
    David

  10. #10
    Join Date
    Nov 2009
    Posts
    8
    Plugin Contributions
    0

    Default Re: default category meta tags not working after removing custom tags

    can anyone describe how to delete the meta_tags_categories_description record from the database table using phpMyAdmin ?

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. Custom Meta Tags + Default Details
    By yaseent in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 3 Jan 2012, 01:05 PM
  2. Default Product Meta tags not responding
    By xavierpages in forum General Questions
    Replies: 3
    Last Post: 1 Jun 2011, 01:31 PM
  3. Meta tags difference - Custom tags and....
    By Muzz in forum General Questions
    Replies: 2
    Last Post: 28 Aug 2009, 06:38 AM
  4. Replies: 1
    Last Post: 27 Nov 2008, 02:27 PM
  5. Custom meta tags for category and products
    By camay123 in forum General Questions
    Replies: 11
    Last Post: 28 Nov 2007, 02:50 AM

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