leonardodestefanis Posted May 10, 2016 Share Posted May 10, 2016 Hi, I want to display title and description instead of meta_title and meta_description in Facebook sharing. Someone can help me to configure Facebook Open Graph? Link to comment Share on other sites More sharing options...
vekia Posted May 10, 2016 Share Posted May 10, 2016 if you want to do this individually for each product you need solution that will give you possibility to define unique open graph tags for selected products. manually, without module it will be a nightmare Link to comment Share on other sites More sharing options...
leonardodestefanis Posted May 10, 2016 Author Share Posted May 10, 2016 I'd like to introduce a "general rule" for all products, can't I do this? Link to comment Share on other sites More sharing options...
vekia Posted May 10, 2016 Share Posted May 10, 2016 im not sure what you mean you just want to disable it everywhere, for each avaialble product? Link to comment Share on other sites More sharing options...
leonardodestefanis Posted May 10, 2016 Author Share Posted May 10, 2016 At the moment Facebook shows meta title as post title and meta description as post description. I simple want that everytime that I share a product on Facebook it will display the Product Title (and not meta_title) as title of the Facebook post, the Short Description (and not meta_description) as description of the facebook post and featured image as thumbnail of the Facebook post. But I want to do this for every products, without set open graph tags individually each time. Link to comment Share on other sites More sharing options...
vekia Posted May 10, 2016 Share Posted May 10, 2016 okay i understand. it is possible to achieve this with some minor modifications of one module that generates og tags in prestashop - It's a socialsharing module. And with one commercial addon. i Will describe possible solutions below: (1) Modification of default prestashop module - please open socialsharing.php - there is a code: $this->context->smarty->assign(array( 'price' => Tools::ps_round($product->getPrice(!Product::getTaxCalculationMethod((int)$this->context->cookie->id_customer), null), _PS_PRICE_COMPUTE_PRECISION_), 'pretax_price' => Tools::ps_round($product->getPrice(false, null), _PS_PRICE_COMPUTE_PRECISION_), 'weight' => $product->weight, 'weight_unit' => Configuration::get('PS_WEIGHT_UNIT'), 'cover' => isset($product->id) ? Product::getCover((int)$product->id) : '', 'link_rewrite' => isset($product->link_rewrite) && $product->link_rewrite ? $product->link_rewrite : '', )); change it to: $this->context->smarty->assign(array( 'price' => Tools::ps_round($product->getPrice(!Product::getTaxCalculationMethod((int)$this->context->cookie->id_customer), null), _PS_PRICE_COMPUTE_PRECISION_), 'pretax_price' => Tools::ps_round($product->getPrice(false, null), _PS_PRICE_COMPUTE_PRECISION_), 'weight' => $product->weight, 'weight_unit' => Configuration::get('PS_WEIGHT_UNIT'), 'cover' => isset($product->id) ? Product::getCover((int)$product->id) : '', 'link_rewrite' => isset($product->link_rewrite) && $product->link_rewrite ? $product->link_rewrite : '', 'thisproduct' => $product )); in socialsharing_header.tpl change: <meta property="og:title" content="{$meta_title|escape:'html':'UTF-8'}" /> <meta property="og:description" content="{$meta_description|escape:'html':'UTF-8'}" /> to: <meta property="og:title" content="{$thisproduct->name|escape:'html':'UTF-8'}" /> <meta property="og:description" content="{$thisproduct->description_short|escape:'html':'UTF-8'}" /> (2) commercial module - no changes necessry you can achieve the same with no changes, with mine open graph tags module. it creates automatically new og:tags for: - og title: it will use product name - og description: it will use product short description Link to comment Share on other sites More sharing options...
leonardodestefanis Posted May 11, 2016 Author Share Posted May 11, 2016 Ok, great! Now it works correctly but I have a little problem: in Facebook post's description I see something like <p> text </p> <li> text </li>. Any suggestions? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now