
Originally Posted by
Randolph Hoppe
Here's the as it stand in MY_TEMPLATE/common/html_header.php
Code:
################ start of AutoOpenGraph ###################
$og_store_name = "NAME"; //e.g. "Samanthas Power Tools", or "Gus' China Shop".
$og_store_url = "SITE"; //url to your store (no trailing '/')
$og_product_type = "product"; //type of product you're selling (see tutorial)
$og_use_addr = 0; //use address? if yes, set $use_addr = 1; (no quotes). edit lines 31-34.
$og_use_email = 0; //use email address? if yes, set $use_email = 1; (no quotes) edit line 37.
$og_use_phone = 0; //use phone number? if yes, set $use_phone = 1; (no quotes) edit line 40.
//if $use_addr is set to 1;
$og_street = "123 Main St"; //change to your street address.
$og_city = "Richmond"; //your city
$og_state = "VA"; //Your State. Facebook exaple uses abbreviation.
$og_zip = "23220"; //you're zip/postal code.
$og_country = "USA"; //your country. Facebook example uses acronym.
//if $use_email is set to 1;
$og_email_address = "[email protected]"; // your email
//if use_phone is set to 1
$og_phone_number = "+1-800-555-1234"; //format: +country code - area code - number.
//no need to edit below this line:
extract($product_info_metatags->fields);
extract($category_metatags->fields);
$og_prod_url = "http://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
//get defined image or default
//$myImage = zen_get_products_image((int)$_GET['products_id']);
$myImage = DIR_WS_IMAGES . 'large/' . $products_image_base . IMAGE_SUFFIX_LARGE . $products_image_extension;
$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 ####################
So me this still does not work. A couple of things, one is that the variable product_image_base would not be defined unless on the product page. This causes the variable result to be an image name made up primarily on the constants. Further, the function that process $myimage parses the string looking for src and the content that follows... The current code does not generate aa similar html output, so really the next two steps can be omitted as well and $myImage simply changed to $img.
As to the issue with the metatags, I'm thinking that the logged info, which was not provided in full, is that this is a warning not an error... That section of code could be prefaced with something like:
Code:
if (is_array($product_info_metatags->fields)) {
extract($product_info_metatags->fields);
}