<modification>
	<id>Facebook Meta</id>
	<version>1.0.0</version>
	<vqmver>1.0.8</vqmver>
	<date>14/07/2011</date>
	<author>Opencart-templates.co.uk</author>

	<file name="catalog/view/theme/default/template/common/header.tpl">
        <operation>
            <search position="before">
            <![CDATA[</head>]]></search>
            <add><![CDATA[
			<fb:share-button class="meta">
			<meta name="medium" content="mult"/>
			<?php foreach ($this->document->getFBMeta() as $fbMeta) { ?>
			<meta property="<?php echo $fbMeta['property'] ?>" content="<?php echo $fbMeta['content']; ?>" />
			<?php } ?>
			</fb:share-button>
			]]></add>
        </operation>
	</file>

	<file name="catalog/controller/product/product.php">
        <operation>
            <search position="before">
            <![CDATA[if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/product/product.tpl')) {]]></search>
            <add><![CDATA[
			$this->document->addFBMeta('og:title', $this->data['heading_title']);
			$this->document->addFBMeta('og:url',$this->url->link('product/product', 'product_id=' . $this->request->get['product_id']));
			$this->document->addFBMeta('og:type', 'product');
			$this->document->addFBMeta('og:image', $this->data['thumb'] );
			$this->document->addFBMeta('og:image', $this->model_tool_image->resize($result['image'], $this->config->get('config_image_additional_width'), $this->config->get('config_image_additional_height')) );
			$this->document->addFBMeta('og:site_name', $this->config->get('config_name'));
			$this->document->addFBMeta('og:admins','71596887616');
			if($this->config->get('config_address')){$this->document->addFBMeta('og:street-address',$this->config->get('config_address'));}
			if($this->config->get('config_email')){$this->document->addFBMeta('og:email',$this->config->get('config_email'));}
			if($this->config->get('config_telephone')){$this->document->addFBMeta('og:phone_number',$this->config->get('config_telephone'));}
			if($this->config->get('config_fax')){$this->document->addFBMeta('og:fax_number',$this->config->get('config_fax'));}
			]]></add>
        </operation>
	</file>

	<file name="system/library/document.php">
        <operation>
            <search position="after">
            <![CDATA[private $scripts = array();]]></search>
            <add><![CDATA[public $fbMeta = array();]]></add>
        </operation>
        <operation>
            <search position="before">
            <![CDATA[public function getStyles() {]]></search>
            <add><![CDATA[
			public function addFBMeta($property , $content ) {
				$this->fbMeta[] = array(
					'property'   => $property,
					'content' => $content
				);			
			}
			public function getFBMeta () {
				return $this->fbMeta;
			}
			]]></add>
        </operation>
	</file>

</modification>
