Jump to content


  • Posts

  • Joined

  • Last visited

Everything posted by elnur

  1. Hi all, I got proglem with "hreflang" attributes in google webmaster tools, there is a lot of errors: "On the page with the code of language en no backlinks". As I find out if I have page like: en/category/product1 then I have to add on this page code like: <link href='https://www.site.com/en/category/product1' hreflang='en' rel='alternate'> <link href='https://www.site.com/ru/category/product1' hreflang='ru' rel='alternate'> en/category/product2 <link href='https://www.site.com/en/category/product2' hreflang='en' rel='alternate'> <link href='https://www.site.com/ru/category/product2' hreflang='ru' rel='alternate'> How can I achieved such an arrangement, on each product page? Now I got only this code in header.tpl <link rel="alternate" href="http://www.site.com/en/" hreflang="en" /> <link rel="alternate" href="http://www.site.com/ru/" hreflang="ru" /> Thanks
  2. Thanks for replying, yes only some urls. Here is route: mysite.com/ru/category/product.html?id_product=2704&isolang=ru
  3. Hi all, recently I discovered that some product urls have additional end after .html, here it is: ?id_product=2704&isolang=ru. It appears when I move from google search. How bad is it for SEO of my website? And how to remove it? P.S., friendly url is on.
  4. Hello guys I installed free Mobile Template http://addons.prestashop.com/ru/mobile/6165-prestashop-mobile-template-14.html and got problem wit "ru" language. So I am trying to get access to mobile version on my computer for modification, and when I turn language to "ru" I see only blank page, and nothing else. For "en" "es" "fr" language everything fine. And other problem that I noticed it is hard to press settings button in right corner, need about 10-20 press to activate it. How to solve this problems? PS
  5. is it possible to restore pr_minic_slider in php my admin?
  6. Hi all, got this errors on product page: Notice: Undefined variable: homepage in /home2/worldbr1/public_html/classes/Tools.php on line 930 Notice: Undefined variable: product in /home2/worldbr1/public_html/classes/Tools.php on line 930 Notice: Trying to get property of non-object in /home2/worldbr1/public_html/classes/Tools.php on line 930 The error appeared unexpectedly. Can someone advice how to solve it? PS Solution found in changing of tools.php from default PS
  7. Finally it works, this is ridiculous but the problem was in ";" it was ;max_input_vars = 5000 and should be max_input_vars = 5000 Thanks Vekia and El Patron for support.
  8. I contacted my hoster, and he did as I asked. But in fact it turns out he did not change it? And as I found out I think I am on localhost.
  9. Thanks for reply, so I installed module, and saw that max input vars is 1000. But in my php.ini it is 5000? Maybe I have to change it in elsewhere?
  10. Hi all, I have problem with translation of installed modules, when I go in BO>translation, and select translate istalled modules, get this message: Warning, your hosting provider limits the maximum number of fields to post in a form: 1000 for max_input_vars Please ask your hosting provider to increase the suhosin post and request limit to 4455 at least. or edit the translation file manually. I tried to increase this max_input_vars to different numbers, added suhosin parameters, add some fields in .htaccess (all this from topics). But nothing helps. Can someone advice solution? PS version, shared host Thanks.
  11. Hi guys I need help, after downloading module from computer, it not appear in modules list. How to fix it?
  12. I have other problem, after adding email, appears message "There is not enough product in stock." PS
  13. Hi all, I have problem with shopping cart, it is become empty after adding product to cart, but only in Chrome, Opera and UC browser. In Mozilla shopping cart works fine. I cleaned cache many times but no results, also cleaned in smarty. So I wanted to know is it problem in my store or in browsers? If in my store, then how to fix it? P.S.
  14. After reading this post https://www.prestashop.com/forums/topic/424413-back-office-doesnt-save-any-changes/ I suggested that the problem in Caching system, change it from File system to Memcached.
  15. Hi all. Today I noticed that the changes are not saved in Back office. Noticed this when I wanted to change Maintenance IP, I press Save, but IP not changing, tried to enable shop and again the same thing, shop not enabling. And so also in other sections of BO, all what I want to change, does not change. And a message appears as usual "Settings update successful". How to solve it?
  16. Hi all, I use PS and recently noticed this message in Preferences> Performance "To use Memcached, you must install the Memcache PECL extension on your server. http://www.php.net/manual/en/memcache.installation.php" Can someone tell me is it necessary to install? Will it make influence on my store if it is not install?
  17. As I didn't found desigion how to solve it, I add some changes in tpl file. For those who interested desigion is here: https://www.prestashop.com/forums/topic/167178-solved-how-do-i-ad-a-new-phrase-with-translation-to-module/ P.S.Thank you all for your active help.
  18. Hello everyone, I use PS so I have next problem: my Top horizontal menu designed only for default language, and in BO it looks like on image 1. Field "Label" designed only for default language, and when I change to another language on the website, links are disappear. Ideally, I need like on image 2. I tried to do on the similarity of the other modules. All what I got is on image 3 Or can someone tell me how to make that links are not lost when switching to another language? Really need help Here is code: <?php include _PS_MODULE_DIR_.'blocktopmenu2prestastylecs/menutoplinks.class.prestastylecs.php'; class blocktopmenu2PrestastyleCS extends Module { private $_menu = ''; private $_html = ''; public function __construct() { $this->name = 'blocktopmenu2prestastylecs'; $this->tab = 'Julien Breux Developpement'; $this->version = 1.3; parent::__construct(); $this->displayName = $this->l('[Clean & Simple] Top horizontal menu'); $this->description = $this->l('Add a new menu on top of your shop.'); } public function install() { if(!parent::install() || !$this->registerHook('top') || !Configuration::updateValue('MOD_BLOCKTOPMENU_ITEMS', 'CAT1,CMS1,CMS2,PRD1') || !Configuration::updateValue('MOD_BLOCKTOPMENU_SEARCH', '0') || !$this->installDB()) return false; return true; } public function installDb() { Db::getInstance()->ExecuteS(' CREATE TABLE IF NOT EXISTS `'._DB_PREFIX_.' smenutop` ( `id_link` INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY , `new_window` TINYINT( 1 ) NOT NULL, `link` VARCHAR( 128 ) NOT NULL ) ENGINE = MYISAM CHARACTER SET utf8 COLLATE utf8_general_ci;'); Db::getInstance()->ExecuteS(' CREATE TABLE IF NOT EXISTS `'._DB_PREFIX_.'linksmenutop_lang` ( `id_link` INT NOT NULL , `id_lang` INT NOT NULL , `label` VARCHAR( 128 ) NOT NULL , INDEX ( `id_link` , `id_lang` ) ) ENGINE = MYISAM CHARACTER SET utf8 COLLATE utf8_general_ci;'); return true; } public function uninstall() { if(!parent::uninstall() || !Configuration::deleteByName('MOD_BLOCKTOPMENU_ITEMS') || !Configuration::deleteByName('MOD_BLOCKTOPMENU_SEARCH') || !$this->uninstallDB()) return false; return true; } private function uninstallDb() { Db::getInstance()->ExecuteS('DROP TABLE `'._DB_PREFIX_.'linksmenutop`'); Db::getInstance()->ExecuteS('DROP TABLE `'._DB_PREFIX_.'linksmenutop_lang`'); return true; } public function getContent() { global $cookie; if(Tools::isSubmit('submitBlocktopmenu')) { if(Configuration::updateValue('MOD_BLOCKTOPMENU_ITEMS', Tools::getValue('items'))) $this->_html .= $this->displayConfirmation($this->l('Settings Updated')); else $this->_html .= $this->displayError($this->l('Unable to update settings')); Configuration::updateValue('MOD_BLOCKTOPMENU_SEARCH', (bool)Tools::getValue('search')); } if(Tools::isSubmit('submitBlocktopmenuLinks')) { if(Tools::getValue('link') == '') { $this->_html .= $this->displayError($this->l('Unable to add this link')); } else { MenuTopLinksPrestastyle::add(Tools::getValue('link'), Tools::getValue('label'), Tools::getValue('new_window', 0)); $this->_html .= $this->displayConfirmation($this->l('The link has been added')); } } if(Tools::isSubmit('submitBlocktopmenuRemove')) { $id_link = Tools::getValue('id_link', 0); MenuTopLinksPrestastyle::remove($id_link); Configuration::updateValue('MOD_BLOCKTOPMENU_ITEMS', str_replace(array('LNK'.$id_link.',', 'LNK'.$id_link), '', Configuration::get('MOD_BLOCKTOPMENU_ITEMS'))); $this->_html .= $this->displayConfirmation($this->l('The link has been removed')); } $this->_html .= ' <fieldset> <legend><img src="'.$this->_path.'logo.gif" alt="" title="" />'.$this->l('Settings').'</legend> <form action="'.$_SERVER['REQUEST_URI'].'" method="post" id="form"> <div style="display: none"> <label>'.$this->l('Items').'</label> <div class="margin-form"> <input type="text" name="items" id="itemsInput" value="'.Configuration::get('MOD_BLOCKTOPMENU_ITEMS').'" size="70" /> </div> </div> <div class="clear"> </div> <table style="margin-left: 130px;"> <tbody> <tr> <td> <select multiple="multiple" id="items" style="width: 300px; height: 160px;">'; $this->makeMenuOption(); $this->_html .= '</select><br/> <br/> <a href="#" id="removeItem" style="border: 1px solid rgb(170, 170, 170); margin: 2px; padding: 2px; text-align: center; display: block; text-decoration: none; background-color: rgb(250, 250, 250); color: rgb(18, 52, 86);">'.$this->l('Remove').' >></a> </td> <td style="padding-left: 20px;"> <select multiple="multiple" id="availableItems" style="width: 300px; height: 160px;">'; // BEGIN CMS $this->_html .= '<optgroup label="'.$this->l('CMS').'">'; $_cms = CMS::listCms($cookie->id_lang); foreach($_cms as $cms) $this->_html .= '<option value="CMS'.$cms['id_cms'].'" style="margin-left:10px;">'.$cms['meta_title'].'</option>'; $this->_html .= '</optgroup>'; // END CMS // BEGIN SUPPLIER $this->_html .= '<optgroup label="'.$this->l('Supplier').'">'; $suppliers = Supplier::getSuppliers(false, $cookie->id_lang); foreach($suppliers as $supplier) $this->_html .= '<option value="SUP'.$supplier['id_supplier'].'" style="margin-left:10px;">'.$supplier['name'].'</option>'; $this->_html .= '</optgroup>'; // END SUPPLIER // BEGIN Manufacturer $this->_html .= '<optgroup label="'.$this->l('Manufacturer').'">'; $manufacturers = Manufacturer::getManufacturers(false, $cookie->id_lang); foreach($manufacturers as $manufacturer) $this->_html .= '<option value="MAN'.$manufacturer['id_manufacturer'].'" style="margin-left:10px;">'.$manufacturer['name'].'</option>'; $this->_html .= '</optgroup>'; // END Manufacturer // BEGIN Categories $this->_html .= '<optgroup label="'.$this->l('Categories').'">'; $this->getCategoryOption(1, $cookie->id_lang); $this->_html .= '</optgroup>'; // END Categories // BEGIN Products $this->_html .= '<optgroup label="'.$this->l('Products').'">'; $this->_html .= '<option value="PRODUCT" style="margin-left:10px;font-style:italic">'.$this->l('Choose ID product').'</option>'; $this->_html .= '</optgroup>'; // END Products // BEGIN Menu Top Links $this->_html .= '<optgroup label="'.$this->l('Menu Top Links').'">'; $links = MenuTopLinksPrestastyle::gets($cookie->id_lang); foreach($links as $link) $this->_html .= '<option value="LNK'.$link['id_link'].'" style="margin-left:10px;">'.$link['label'].'</option>'; $this->_html .= '</optgroup>'; // END Menu Top Links $this->_html .= '</select><br /> <br /> <a href="#" id="addItem" style="border: 1px solid rgb(170, 170, 170); margin: 2px; padding: 2px; text-align: center; display: block; text-decoration: none; background-color: rgb(250, 250, 250); color: rgb(18, 52, 86);"><< '.$this->l('Add').'</a> </td> </tr> </tbody> </table> <div class="clear"> </div> <script type="text/javascript"> $(document).ready(function(){ $("#addItem").click(add); $("#availableItems").dblclick(add); $("#removeItem").click(remove); $("#items").dblclick(remove); function add() { $("#availableItems option:selected").each(function(i){ var val = $(this).val(); var text = $(this).text(); if(val == "PRODUCT") { val = prompt("'.$this->l('Set ID product').'"); if(val == null || val == "" || isNaN(val)) return; text = "'.$this->l('Product ID').' "+val; val = "PRD"+val; } $("#items").append("<option value=\""+val+"\">"+text+"</option>"); }); serialize(); return false; } function remove() { $("#items option:selected").each(function(i){ $(this).remove(); }); serialize(); return false; } function serialize() { var options = ""; $("#items option").each(function(i){ options += $(this).val()+","; }); $("#itemsInput").val(options.substr(0, options.length - 1)); } }); </script> < for="s">'.$this->l('Search Bar').'</label> <div class="margin-form"> <input type="checkbox" name="search" id="s" value="1"'.((Configuration::get('MOD_BLOCKTOPMENU_SEARCH')) ? ' checked=""': '').'/> </div> <p class="center"> <input type="submit" name="submitBlocktopmenu" value="'.$this->l(' Save ').'" class="button" /> </p> </form> </fieldset><br />'; $defaultFormLanguage = intval(Configuration::get('PS_LANG_DEFAULT')); $languages = Language::getLanguages(); $iso = Language::getIsoById($defaultFormLanguage); $divLangName = 'link_label'; $this->_html .= ' <fieldset> <legend><img src="../img/admin/add.gif" alt="" title="" />'.$this->l('Add Menu Top Link').'</legend> <form action="'.$_SERVER['REQUEST_URI'].'" method="post" id="form"> <label>'.$this->l('Label').'</label> <div class="margin-form">'; foreach ($languages as $language) { $this->_html .= ' <div id="link_label_'.$language['id_lang'].'" style="display: '.($language['id_lang'] == $defaultFormLanguage ? 'block' : 'none').';float: left;"> <input type="text" name="link_label_'.$language['id_lang'].'" id="label_'.$language['id_lang'].'" size="70" value=""> </div>'; } $this->_html .= $this->displayFlags($this->_languages, $this->_defaultFormLanguage, $divLangName, 'link_label', true); $this->_html .= '</div><p class="clear"> </p> <label>'.$this->l('Link').'</label> <div class="margin-form"> <input type="text" name="link" value="" size="70" /> </div> <label>'.$this->l('New Window').'</label> <div class="margin-form"> <input type="checkbox" name="new_window" value="1" /> </div> <p class="center"> <input type="submit" name="submitBlocktopmenuLinks" value="'.$this->l(' Add ').'" class="button" /> </p> </form> </fieldset><br />'; $this->_html .= ' <fieldset> <legend><img src="../img/admin/details.gif" alt="" title="" />'.$this->l('List Menu Top Link').'</legend> <table style="width:100%;"> <thead> <tr> <th>'.$this->l('Id Link').'</th> <th>'.$this->l('Label').'</th> <th>'.$this->l('Link').'</th> <th>'.$this->l('New Window').'</th> <th>'.$this->l('Action').'</th> </tr> </thead> <tbody>'; $links = MenuTopLinksPrestastyle::gets($cookie->id_lang); foreach($links as $link) { $this->_html .= ' <tr> <td>'.$link['id_link'].'</td> <td>'.$link['label'].'</td> <td>'.$link['link'].'</td> <td>'.(($link['new_window']) ? $this->l('Yes') : $this->l('No')).'</td> <td> <form action="'.$_SERVER['REQUEST_URI'].'" method="post"> <input type="hidden" name="id_link" value="'.$link['id_link'].'" /> <input type="submit" name="submitBlocktopmenuRemove" value="'.$this->l('Remove').'" class="button" /> </form> </td> </tr>'; } $this->_html .= '</tbody> </table> </fieldset>'; echo $this->_html; } private function getMenuItems() { $items = Configuration::get('MOD_BLOCKTOPMENU_ITEMS'); $items = explode(',', $items); return $items; } private function makeMenuOption() { global $cookie; foreach($this->getMenuItems() as $item) { $id = (int)substr($item, 3, strlen($item)); switch(substr($item, 0, 3)) { case'CAT': $this->getCategoryOption($id, $cookie->id_lang, false); break; case'PRD': $product = new Product($id, true, $cookie->id_lang); if(!is_null($product->id)) $this->_html .= '<option value="PRD'.$id.'">'.$product->name.'</option>'.PHP_EOL; break; case'CMS': $cms = CMS::getLinks($cookie->id_lang, array($id)); if(count($cms)) $this->_html .= '<option value="CMS'.$id.'">'.$cms[0]['meta_title'].'</option>'.PHP_EOL; break; case'MAN': $manufacturer = new Manufacturer($id, $cookie->id_lang); if(!is_null($manufacturer->id)) $this->_html .= '<option value="MAN'.$id.'">'.$manufacturer->name.'</option>'.PHP_EOL; break; case'SUP': $supplier = new Supplier($id, $cookie->id_lang); if(!is_null($supplier->id)) $this->_html .= '<option value="SUP'.$id.'">'.$supplier->name.'</option>'.PHP_EOL; break; case'LNK': $link = MenuTopLinksPrestastyle::get($id, $cookie->id_lang); if(count($link)) $this->_html .= '<option value="LNK'.$id.'">'.$link[0]['label'].'</option>'.PHP_EOL; break; } } } private function makeMenu() { global $cookie, $page_name; foreach($this->getMenuItems() as $item) { $id = (int)substr($item, 3, strlen($item)); switch(substr($item, 0, 3)) { case'CAT': $this->getCategory($id, $cookie->id_lang); break; case'PRD': $selected = ($page_name == 'product' && (Tools::getValue('id_product') == $id)) ? ' class="sfHover"' : ''; $product = new Product($id, true, $cookie->id_lang); if(!is_null($product->id)) $this->_menu .= '<li'.$selected.'><a href="'.$product->getLink().'">'.$product->name.'</a></li>'.PHP_EOL; break; case'CMS': $selected = ($page_name == 'cms' && (Tools::getValue('id_cms') == $id)) ? ' class="sfHover"' : ''; $cms = CMS::getLinks($cookie->id_lang, array($id)); if(count($cms)) $this->_menu .= '<li'.$selected.'><a href="'.$cms[0]['link'].'">'.$cms[0]['meta_title'].'</a></li>'.PHP_EOL; break; case'MAN': $selected = ($page_name == 'manufacturer' && (Tools::getValue('id_manufacturer') == $id)) ? ' class="sfHover"' : ''; $manufacturer = new Manufacturer($id, $cookie->id_lang); if(!is_null($manufacturer->id)) { if (intval(Configuration::get('PS_REWRITING_SETTINGS'))) $manufacturer->link_rewrite = Tools::link_rewrite($manufacturer->name, false); else $manufacturer->link_rewrite = 0; $link = new Link; $this->_menu .= '<li'.$selected.'><a href="'.$link->getManufacturerLink($id, $manufacturer->link_rewrite).'">'.$manufacturer->name.'</a></li>'.PHP_EOL; } break; case'SUP': $selected = ($page_name == 'supplier' && (Tools::getValue('id_supplier') == $id)) ? ' class="sfHover"' : ''; $supplier = new Supplier($id, $cookie->id_lang); if(!is_null($supplier->id)) { $link = new Link; $this->_menu .= '<li'.$selected.'><a href="'.$link->getSupplierLink($id, $supplier->link_rewrite).'">'.$supplier->name.'</a></li>'.PHP_EOL; } break; case'LNK': $link = MenuTopLinksPrestastyle::get($id, $cookie->id_lang); if(count($link)) $this->_menu .= '<li><a href="'.$link[0]['link'].'"'.(($link[0]['new_window']) ? ' target="_blank"': '').'>'.$link[0]['label'].'</a></li>'.PHP_EOL; break; } } } private function getCategoryOption($id_category, $id_lang, $children = true) { $categorie = new Category($id_category, $id_lang); if(is_null($categorie->id)) return; if(count(explode('.', $categorie->name)) > 1) $name = str_replace('.', '', strstr($categorie->name, '.')); else $name = $categorie->name; $this->_html .= '<option value="CAT'.$categorie->id.'" style="margin-left:'.(($children) ? round(15+(15*(int)$categorie->level_depth)) : 0).'px;">'.$name.'</option>'; if($children) { $childrens = Category::getChildren($id_category, $id_lang); if(count($childrens)) foreach($childrens as $children) $this->getCategoryOption($children['id_category'], $id_lang); } } private function getCategory($id_category, $id_lang) { global $page_name; $categorie = new Category($id_category, $id_lang); if(is_null($categorie->id)) return; $selected = ($page_name == 'category' && ((int)Tools::getValue('id_category') == $id_category)) ? ' class="sfHoverForce"' : ''; $this->_menu .= '<li'.$selected.'>'; if(count(explode('.', $categorie->name)) > 1) $name = str_replace('.', '', strstr($categorie->name, '.')); else $name = $categorie->name; $this->_menu .= '<a href="'.$categorie->getLink().'">'.$name.'</a>'; $childrens = Category::getChildren($id_category, $id_lang); if(count($childrens)) { $this->_menu .= '<ul>'; foreach($childrens as $children) $this->getCategory($children['id_category'], $id_lang); $this->_menu .= '</ul>'; } $this->_menu .= '</li>'; } public function hooktop($param) { global $smarty; $this->makeMenu(); $smarty->assign('MENU_SEARCH', Configuration::get('MOD_BLOCKTOPMENU_SEARCH')); $smarty->assign('MENU', $this->_menu); $smarty->assign('this_path', $this->_path); return $this->display(__FILE__, 'blocktopmenu.tpl'); } } ?>
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More