Dear all users of this Contribution,
I noticed that email address and City fields are prefilled with your store email address and your city when customer reaches Register page or Contact us page. This is because $city and $email_address used in the code appearing in (your-zencart-store-root)/includes/templates/your_custom_template/common/html_header.php interferes with zencart's code. So, I suggest you changing the names to $mycity and $myemail_address. Also, please replace "1" to "0" if you do not want to use your address, email and phone fields in the meta tags.
Code:
################ start of AutoOpenGraph ###################
$store_name = "Your Company Name"; //e.g. "Samanthas Power Tools", or "Gus' China Shop".
$store_url = "http://www.yourdomain.com/store"; //url to your store (no trailing '/')
$product_type = "product"; //type of product you're selling (see tutorial)
$use_addr = 0; //use address? if yes, set $use_addr = 1; (no quotes). edit lines below suitably.
$use_email = 0; //use email address? if yes, set $use_email = 1; (no quotes) edit lines below suitably.
$use_phone = 0; //use phone number? if yes, set $use_phone = 1; (no quotes) edit line below suitably.
//if $use_addr is set to 1;
$mystreet = "123 Your Street Name"; //change to your street address.
$mycity = "City"; //your city
$mystate = "State"; //Your State. Facebook exaple uses abbreviation.
$myzip = "zipcode"; //you're zip/postal code.
$mycountry = "USA"; //your country. Facebook example uses acronym.
//if $use_email is set to 1;
$myemail_address = "[email protected]"; // your email
//if use_phone is set to 1
$myphone_number = "+1-123-12345678"; //format: +country code - area code - number.
//no need to edit below this line:
extract($product_info_metatags->fields);
extract($category_metatags->fields);
$prod_url = "http://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
//get defined image or default
$myImage= zen_get_products_image((int)$_GET['products_id']);
$img = simplexml_load_string($myImage);
$img = $img['src'];
if($this_is_home_page){ $depends = $store_name; $product_type = "website"; }
else if ($categories_name){ $depends = $categories_name; $product_type = "website"; }
else if ($products_name){ $depends = $products_name; }
else { $depends = META_TAG_TITLE; $product_type = "website"; }
//print_r($product_info_metatags);
################# end of AutoOpenGraph ####################
Under meta tags, please change suitably as follows:
Code:
<?php
if($use_addr){
echo '<meta property="og:street-address" content="'.$mystreet.'" />'."\n";
echo '<meta property="og:locality" content="'.$mycity.'" />'."\n";
echo '<meta property="og:region" content="'.$mystate.'" />'."\n";
echo '<meta property="og:postal-code" content="'.$myzip.'" />'."\n";
echo '<meta property="og:country-name" content="'.$mycountry.'" />'."\n";
}
if($use_email){
echo '<meta property="og:email" content="'.$myemail_address.'" />'."\n";
}
if($use_phone){
echo '<meta property="og:phone_number" content="'.$myphone_number.'" />'."\n";
}
?>
Regards
Bookmarks