Zen cart website optimization Series 1

Source: Internet
Author: User
Tags zen cart

--- Meta settings ---

Zen cart's mate tags settings are comprehensive, including the keywords and titles on the product sales page and product category list page, if not defined, the product name or category name will be called automatically.
But for new products (index. php? Main_page = products_new), special offer (index. php? Main_page = specials), recommended products (index. php? Main_page = featured_products) the page cannot be set separately in the website background. In fact, these can be implemented by modifying the meta_tags.php file in the language file.
The specific path is des/ages/english/meta_tags.php.
Find
Define ('meta _ tag_description_page_name ','');
Define ('meta _ tag_keywords_page_name ','');
Define ('meta _ tag_title_page_name ','');
Add the following code under it and write the title, keyword, and description respectively.

// Products_new
Define ('meta _ tag_description_products_new ', '35blue. com ');
Define ('meta _ tag_keywords_products_new ', '35blue. com ');
Define ('meta _ tag_title_products_new ', '35blue. com ');
// Featured_products
Define ('meta _ tag_description_featured_products', '35blue. com ');
Define ('meta _ tag_keywords_featured_products', '35blue. com ');
Define ('meta _ tag_title_featured_products', '35blue. com ');
// Specials
Define ('meta _ tag_description_specials ', '35blue. com ');
Define ('meta _ tag_keywords_specials ', '35blue. com ');
Define ('meta _ tag_title_specials ', '35blue. com ');

----- Modify the homepage META title ------

Run the following SQL:
Insert into configuration (configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) Values

 

(Null, 'homepage title', 'home _ page_title', 'title of your website title', 'set the Home Page title', 1,210, now (), now (), null, null ),
(Null, 'homepage keyword', 'home _ page_meta_keyword', 'Your keywords keyword', 'set the Home Page keyword', 1,211, now (), now (), null, null ),
(Null, 'homepage description', 'home _ page_meta_description ', 'l your website description description', 'set the Home Page description', 1,212, now (), now (), null, null );

Next, modify the content of the related des/ages/english/meta_tags.php:

// Home page only:
Define ('home _ page_meta_description ', home_page_meta_description );
Define ('home _ page_meta_keywords ', home_page_meta_keywords );
Define ('home _ page_title ', home_page_title );
// Note: If home_page_title is left blank (default) Then title and site_tagline will be used instead.
Define ('home _ page_title ', home_page_title); // usually best left blank
After adding the above content, you can directly edit your title, keywords, and description in the background.

After logging on again, set it in conficuration-my store.

------ Zencart system other page meta modification instructions -------

Meta Modification
Modify directory page Meta
Some directories only have level-1 directories and some have level-2 directories. Therefore, we must consider level-2 directories when modifying directories. In this way, both level-1 and level-2 directories are modified
Find
Starting from 130 rows
Case 'index ':
// BOF: Categories meta tags
// Run custom categories meta tags
$ SQL = "select * from ". table_languags_categories_description. "MCD where McD. categories_id = '". (INT) $ current_category_id. "'and McD. required age_id = '". (INT) $ _ session ['AGES _ id']. "'";
$ Category_cmdags = $ db-> execute ($ SQL );
If (! $ Category_cmdags-> EOF ){
Define ('meta _ tag_title ', str_replace (' "','', $ category_categorags-> fields ['categorags _ title']);
Define ('meta _ tag_description ', str_replace (' "','', $ category_categorags-> fields ['categorags _ description']);
Define ('meta _ tag_keywords ', str_replace (' "','', $ category_tagags-> fields ['tagags _ keyword']);
} Else {
// Build categories meta tags
// EOF: Categories meta tags
If ($ category_depth = 'nested '){
$ SQL = "select CD. categories_name from ". table_categories. "C ,". table_categories_description. "CD where c. categories_id = CD. categories_id and CD. categories_id = '". (INT) $ current_category_id. "'and CD. required age_id = '". (INT) $ _ session ['AGES _ id']. "'and C. categories_status = 1 ";
$ Category_cmdags = $ db-> execute ($ SQL );
If ($ category_cmdags-> EOF ){
$ Meta_tags_over_ride = true;
} Else {
Here we need to change to the directory page meta.
Define ('meta _ tag_title ', str_replace (' "','', zen_clean_html ($ category_categorags-> fields ['categories _ name']). '-sale cheap ed hard in online ed hard Shop '. tagline ));
Define ('meta _ tag_description ', str_replace (' "','', zen_clean_html ($ category_categorags-> fields ['categories _ name']). 'Are sells well in Ed hard shop, the newest and popular '. zen_clean_html ($ category_cmdags-> fields ['categories _ name']). 'are cheap ed hard and good quality fashion show in Edhardy-us.com. '));
Define ('meta _ tag_keywords ', str_replace (' "','', 'ed hard clothing, Ed hard clothes, Ed hard sale ,'. zen_clean_html ($ category_cmdags-> fields ['categories _ name']). ', Ed hard shirts '));
} // EOF
} Elseif ($ category_depth = 'products '){
If (isset ($ _ Get ['manufacturers _ id']) | (isset ($ _ Get ['filter _ id']) & $ _ Get ['filter _ id']> 0) & isset ($ _ Get ['cpath ']) {
If (isset ($ _ Get ['filter _ id']) & isset ($ _ Get ['cpath ']) {
$ Include_manufacturers_id = $ _ Get ['filter _ id'];
} Else {
$ Include_manufacturers_id = $ _ Get ['manufacturers _ id'];
}
$ SQL = "select manufacturers_name from". table_manufacturers. "Where manufacturers_id = '". (INT) $ include_manufacturers_id ."'";
$ Manufacturer_cmdags = $ db-> execute ($ SQL );
If ($ manufacturer_cmdags-> EOF ){
$ Meta_tags_over_ride = true;
} Else {
Define ('meta _ tag_title ', str_replace (' "','', $ manufacturer_mongoags-> fields ['manufacturers _ name']. primary_section. Title. tagline ));
Define ('meta _ tag_description ', str_replace (' "','', title. primary_section. $ manufacturer_cmdags-> fields ['manufacturers _ name']. secondary_section. Keywords ));
Define ('meta _ tag_keywords ', str_replace (' "','', $ manufacturer_mongoags-> fields ['manufacturers _ name']. languags_divider. Keywords ));
} // EOF
} Else {
$ SQL = "select CD. categories_name from ". table_categories. 'C ,'. table_categories_description. "CD where c. categories_id = CD. categories_id and CD. categories_id = '". (INT) $ current_category_id. "'and CD. required age_id = '". (INT) $ _ session ['AGES _ id']. "'and C. categories_status = 1 ";
$ Category_cmdags = $ db-> execute ($ SQL );
If ($ category_cmdags-> EOF ){
$ Meta_tags_over_ride = true;
} Else {

Here we need to change it to the meta we need.
Define ('meta _ tag_title ', str_replace (' "','', zen_clean_html ($ category_categorags-> fields ['categories _ name']). '-sale cheap ed hard in online ed hard Shop '. tagline ));
Define ('meta _ tag_description ', str_replace (' "','', zen_clean_html ($ category_categorags-> fields ['categories _ name']). 'Are sells well in Ed hard shop, the newest and popular '. zen_clean_html ($ category_cmdags-> fields ['categories _ name']). 'are cheap ed hard and good quality fashion show in Edhardy-us.com. '));
Define ('meta _ tag_keywords ', str_replace (' "','', 'ed hard clothing, Ed hard clothes, Ed hard sale ,'. zen_clean_html ($ category_cmdags-> fields ['categories _ name']). ', Ed hard shirts '));
} // EOF
}
} Else {
If (isset ($ _ Get ['manufacturers _ id']) {
$ SQL = "select manufacturers_name from". table_manufacturers. "Where manufacturers_id = '". (INT) $ _ Get ['manufacturers _ id']. "'";
$ Manufacturer_cmdags = $ db-> execute ($ SQL );
If ($ manufacturer_cmdags-> EOF ){
Define ('meta _ tag_title ', title. tagline );
Define ('meta _ tag_description ', title. primary_section. str_replace (Array ("'", '"'),'', strip_tags (heading_title). secondary_section. Keywords );
Define ('meta _ tag_keywords ', keywords. metatags_divider. str_replace (Array ("'", '"'),'', strip_tags (heading_title )));
} Else {
Define ('meta _ tag_title ', str_replace (' "','', $ manufacturer_mongoags-> fields ['manufacturers _ name']. primary_section. Title. tagline ));
Define ('meta _ tag_description ', str_replace (' "','', title. primary_section. $ manufacturer_cmdags-> fields ['manufacturers _ name']. secondary_section. Keywords ));
Define ('meta _ tag_keywords ', str_replace (' "','', $ manufacturer_mongoags-> fields ['manufacturers _ name']. languags_divider. Keywords ));
}
} Else {
// Nothing custom Main Page
$ Meta_tags_over_ride = true;
}
}
} // Custom meta tags
Break;
// EOF: Categories meta tags
The above two are the meta of the level-1 directory and the meta of the level-2 directory.
3. Modify the meta of the product page Directory.
Find (335-337) in includes/modules/meta_tages.php)
Define ('meta _ tag_title ', str_replace (' "','', $ meta_products_name. '-'. $ meta_products_model. '| Air Max '. $ meta_products_price. 'airmaxsky.com '. tagline ));
Define ('meta _ tag_description ', str_replace (' "','', $ meta_products_name. '-'. $ meta_products_model. 'sells well in airmaxsky.com. air Max online store support 24/7 service. '. $ meta_categories_name. '-'. $ meta_products_name. 'is the top Air Max shoes. '));
Define ('meta _ tag_keywords ', str_replace (' "','', $ meta_products_name ));
In File 335-337, change these three rows to the meta we need.

Note:
1. Check the meta after it is changed. Remember that the text cannot wrap when you change the homepage.
2. You can also add a directory or modify the meta on the product page and directory page in the background. If you modify the meta on the background, the priority is the highest.

On the level 2 Directory page, you can use breakcrumb to set the category name. Breakcrumb. PHP has a function Trail ($ separator = '& nbsp;') function in des/classes, you can create another function trailmeta ($ separator = '& nbsp;') with the same content and code as above, if you want to change something, you can change it here.

Category name on the product page
There is an SQL statement at about 235 rows. Add P. master_categories_id to it, and then around 315 rows below
Define ('meta _ tag_title ', str_replace (' "','', $ meta_products_name. $ meta_products_price.' | cheap bags '));
Define ('meta _ tag_description ', str_replace (' "','', $ meta_products_name. is a best sellig '. zen_clean_html ($ category_cmdags-> fields ['categories _ name']). '. cheap '. $ meta_products_name. 'sale 30% off. free shipping for every replica bags! '));
Define ('meta _ tag_keywords ', str_replace (' "','', $ meta_products_name. ','. zen_clean_html ($ category_cmdags-> fields ['categories _ name']). ', fashion bags, replica bags '));
Add $ SQL = "select CD. categories_name from ". table_categories. 'C ,'. table_categories_description. "CD where c. categories_id = CD. categories_id and CD. categories_id = '". (INT) $ current_category_id. "'and CD. required age_id = '". (INT) $ _ session ['AGES _ id']. "'and C. categories_status = 1 ";
$ Category_cmdags = $ db-> execute ($ SQL );

 
------------

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.