Closed

Virtuemart Desc product instead of website

Sat Dec 14, 2013 5:46 am
Good Day

In witch file are located the og tag ... ie property="og:title etc...

I want to test some stuff ;)

Stefan
The topic has been closed.
Sat Dec 14, 2013 6:03 am
Good day

Im using your supermart template and it is great with this plugin ...

How can i force when on the product detail page to use the description of the product instead of the website ...

something like this ... $og_desc = $this->product->product_s_desc;

Thanks
The topic has been closed.
Sat Dec 14, 2013 12:57 pm
I do not think this is a good idea. You can always enter your custom meta description in the meta description field in your products which will also be used for og meta description. Now if you change the og meta description and defers from your actual page meta description then your site should get penalized by search engine crawler because of conflicts. Apart from that Product Short Description field can also has html content and in that case this method will completely break your site.

Anyway, you can always change it in plugins\system\vmogmetatag\vmogmetatag.php

Find the following codes between lines 93 to 104:
  else if ($option == "com_virtuemart" and $view == "productdetails") {
   $product = $product_model->getProduct($virtuemart_product_id); 
   $product_model->addImages($product);	              
	 $productImage = str_replace(' ', '%20', $product->images[0]->file_url);
   $vmogmetatag_image_thumb = '  <meta property="og:image" content="'.JURI::base().''.$productImage.'" />'. "\r\n";
  }	
 
  else {
   $vmogmetatag_image_thumb = '  <meta property="og:image" content="'.JURI::base().''.$vmogmetatag_image_instance.'" />'. "\r\n";
  };
 
  $vmogmetatag_desc =   '  <meta property="og:description" content="'.$vmogmetatag_desc_instance.'" />'. "\r\n";
Replace above by:
  else if ($option == "com_virtuemart" and $view == "productdetails") {
   $product = $product_model->getProduct($virtuemart_product_id); 
   $product_model->addImages($product);	              
	 $productImage = str_replace(' ', '%20', $product->images[0]->file_url);
   $vmogmetatag_image_thumb = '  <meta property="og:image" content="'.JURI::base().''.$productImage.'" />'. "\r\n";
	 $vmogmetatag_desc =   '  <meta property="og:description" content="'.$product->product_s_desc.'" />'. "\r\n";
  }	
 
  else {
   $vmogmetatag_image_thumb = '  <meta property="og:image" content="'.JURI::base().''.$vmogmetatag_image_instance.'" />'. "\r\n";
  };
	if(!isset($vmogmetatag_desc)) {
		$vmogmetatag_desc =   '  <meta property="og:description" content="'.$vmogmetatag_desc_instance.'" />'. "\r\n";
	}
Post your reviews about us on our Facebook Page.
Post your testimonials and suggestions Here.
Don't forget to Close your topic when resolved.
The topic has been closed.
Tue Dec 17, 2013 9:11 pm
Great ... and if i want to include the price beside de product name ?
The topic has been closed.
Wed Dec 18, 2013 12:17 am
Ok i got it ;)

I did add this and it work ;)
  $vmogmetatag_title = "\r\n" .'  <meta property="og:title" content="'.$vmogmetatag_title_instance.','.number_format((float)$product->prices['salesPrice'], 2, '.', '').'"/>'. "\r\n";

The only thing left is to figure out how to put the $ before the price ;)
The topic has been closed.
Wed Dec 18, 2013 1:11 pm
You can manually put any text in the codes:
$vmogmetatag_title = "\r\n" .'  <meta property="og:title" content="'.$vmogmetatag_title_instance.', $'.number_format((float)$product->prices['salesPrice'], 2, '.', '').'"/>'. "\r\n";
Post your reviews about us on our Facebook Page.
Post your testimonials and suggestions Here.
Don't forget to Close your topic when resolved.
The topic has been closed.