tesladisk Posted June 16, 2016 Share Posted June 16, 2016 Hi to all i do not know why this is happen but in some of the products i have in my site the short description appears also in the top of the page making the site look odd, in some products all short description appears on top in others only part of it, also the short description continue to display to the home page also, anyone encounder this problem i will like some help thanks image attached also link for one of the problematic pages https://tzabapc.com/en/pc-laptop-cooling/168-zalman-skadi-lq520-dual-fan-radiator-liquid-water-cooling.html Link to comment Share on other sites More sharing options...
vekia Posted June 16, 2016 Share Posted June 16, 2016 from what i see it's a matter of twitter module / feature twitter description contains html code and because of this html tag is cutted and in effect displays text case needs inspection of header.tpl or twitter module that you use on product page (if you use any) Link to comment Share on other sites More sharing options...
tesladisk Posted June 16, 2016 Author Share Posted June 16, 2016 yes i use twitter card module i disabled it seams the problem is gone i will check the other products and report back thanks vekia Link to comment Share on other sites More sharing options...
vekia Posted June 16, 2016 Share Posted June 16, 2016 in simple words, in this twitter card module it is necessary to add |strip_tags to short_description variable and problem will be fixed Link to comment Share on other sites More sharing options...
tesladisk Posted June 16, 2016 Author Share Posted June 16, 2016 i am not sure how to do this here is the code of the php if you want to take a look <?php /* * 2007-2012 PrestaShop * * NOTICE OF LICENSE * * This source file is subject to the Academic Free License (AFL 3.0) * that is bundled with this package in the file LICENSE.txt. * It is also available through the world-wide-web at this URL: * http://opensource.org/licenses/afl-3.0.php * If you did not receive a copy of the license and are unable to * obtain it through the world-wide-web, please send an email * to [email protected] so we can send you a copy immediately. * DISCLAIMER * * Do not edit or add to this file if you wish to upgrade PrestaShop to newer * versions in the future. If you wish to customize PrestaShop for your * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA <[email protected]> * @copyright 2007-2012 PrestaShop SA * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) * International Registered Trademark & Property of PrestaShop SA */ if (!defined('_CAN_LOAD_FILES_')) exit; class Twittercard extends Module { public function __construct() { $this->name = 'twittercard'; if (version_compare(_PS_VERSION_, '1.4.0.0') >= 0) $this->tab = 'front_office_features'; else $this->tab = 'Blocks'; $this->version = '1.0'; $this -> author = 'dh42'; parent::__construct(); $this->displayName = $this->l('Twitter Card'); $this->description = $this->l('Adds Twitter Cards to your site'); } public function install() { $this->_clearCache('twittercard.tpl'); return (parent::install() && Configuration::updateValue('twitterhandle', '') && Configuration::updateValue('extrainfo1', '') && Configuration::updateValue('extrainfo2', '') && Configuration::updateValue('hometitle', '') && Configuration::updateValue('homedesc', '') && Configuration::updateValue('homelogo', '') && Configuration::updateValue('homelogourl', '') && $this->registerHook('header')); } public function uninstall() { $this->_clearCache('twittercard.tpl'); return ( !Configuration::deleteByName('twitterhandle') || !Configuration::deleteByName('extrainfo1') || !Configuration::deleteByName('extrainfo2') || !Configuration::deleteByName('hometitle') || !Configuration::deleteByName('homedesc') || !Configuration::deleteByName('homelogo') || !Configuration::deleteByName('homelogourl') || parent::uninstall()); } public function getContent() { $html = ''; if (isset($_POST['submitModule'])) { Configuration::updateValue('twitterhandle', ((isset($_POST['twitterhandle']) && $_POST['twitterhandle'] != '') ? $_POST['twitterhandle'] : ''), true); Configuration::updateValue('extrainfo1', Tools::getValue('extrainfo1')); Configuration::updateValue('extrainfo2', Tools::getValue('extrainfo2')); Configuration::updateValue('hometitle', Tools::getValue('hometitle')); Configuration::updateValue('homedesc', Tools::getValue('homedesc')); Configuration::updateValue('homelogo', Tools::getValue('homelogo')); Configuration::updateValue('homelogourl', Tools::getValue('homelogourl')); $html .= '<div class="confirm" style="height: 40px;padding-left: 40px;line-height: 40px;">'.$this->l('Configuration updated').'</div>'; } $html .= ' <h2>'.$this->displayName.'</h2> <form action="'.$_SERVER['REQUEST_URI'].'" method="post"> <fieldset> <p><label for="twitterhandle">'.$this->l('Twitter Name (ex. @designhaus42)').' :</label> <textarea id="twitterhandle" name="twitterhandle" cols="20" rows="1">'.Configuration::get('twitterhandle').'</textarea></p> </fieldset> <fieldset> <p><label for="extrainfo1">'.$this->l('Required Extra Info').' :</label> <textarea id="extrainfo1" name="extrainfo1" cols="40" rows="1">'.Configuration::get('extrainfo1').'</textarea></p> <p><label for="extrainfo2">'.$this->l('Required Extra Info Label').' :</label> <textarea id="extrainfo2" name="extrainfo2" cols="40" rows="1">'.Configuration::get('extrainfo2').'</textarea> <img src="../modules/twittercard/twittercard.png" style="float:right;margin-top:-42px"/> </p> <div class="margin-form"> <p>The same extra info will be displayed on all product pages.</p> </div> </fieldset> <fieldset> <p><label for="hometitle">'.$this->l('Home Page Title').' :</label> <textarea id="hometitle" name="hometitle" cols="40" rows="1">'.Configuration::get('hometitle').'</textarea> </p> <p><label for="homedesc">'.$this->l('Home Page Description limit 200 chars.').' :</label> <textarea id="homedesc" name="homedesc" cols="80" rows="4">'.Configuration::get('homedesc').'</textarea> </p> <div class="margin-form">Home Page Image<br> <input type="radio" name="homelogo" value="1"'.(Configuration::get('homelogo') ? 'checked="checked" ' : '').'> Use logo<br> <input type="radio" name="homelogo" value="0"' .(!Configuration::get('homelogo') ? 'checked="checked" ' : '').'> Use Custom<br> </div> <p><label for="homelogourl">'.$this->l('Custom Image URL').' :</label> <textarea id="homelogourl" name="homelogourl" cols="100" rows="1">'.Configuration::get('homelogourl').'</textarea> </p> <div class="margin-form"> </div> </fieldset> <fieldset> <div class="margin-form"> <input type="submit" name="submitModule" value="'.$this->l('Save').'" class="button" /> <p>You can test your Twitter Cards <a href="https://dev.twitter.com/docs/cards/validation/validator">here.</a> </div> </fieldset> </form> '; return $html; } public function hookHeader($params) { global $smarty, $cookie, $link; $current_page = get_class($this->context->controller); if ($current_page =="ProductController"){ $cover = Product::getCover(intval(Tools::getValue('id_product'))); $productinfo = Product::getCover(intval(Tools::getValue('id_product'))); $product = new Product($_GET['id_product'],false,intval($cookie->id_lang)); if (is_array($cover) && sizeof($cover) == 1) { $fb_cover = ''; $protocol_link = @$_SERVER['HTTPS'] == "on"?"https://":"http://"; if ($id_product = (int)Tools::getValue('id_product')) $product = new Product($id_product, true, $this->context->language->id, $this->context->shop->id); $twitter_image = $link->getImageLink($product->link_rewrite[$cookie->id_lang], Tools::getValue('id_product').'-'.$cover['id_image'],'thickbox_default'); } }else{} if (!$this->isCached('twittercard.tpl', $this->getCacheId())) { global $smarty; if ($current_page =="ProductController"){ $smarty->assign(array( 'twitter_site' => Configuration::get('twitterhandle'), 'twitter_product_name' => $product->name, 'twitter_description' => $product->description_short, 'twitter_currency' => $this->context->currency->sign, 'twitter_image' => $twitter_image, 'twitter_price' => $product->price, 'twitter_extra1' => Configuration::get('extrainfo1'), 'twitter_extra2' => Configuration::get('extrainfo2'), )); }else{ $smarty->assign(array( 'twitter_site' => Configuration::get('twitterhandle'), 'twitter_hometitle' => Configuration::get('hometitle'), 'twitter_homedesc' => Configuration::get('homedesc'), 'twitter_homelogo' => Configuration::get('homelogo'), 'twitter_homelogourl' => Configuration::get('homelogourl') )); } } return $this->display(__FILE__, 'twittercard.tpl', $this->getCacheId()); } } 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