Jump to content

ps3z

Members
  • Posts

    422
  • Joined

  • Last visited

Profile Information

  • Location
    istanbul
  • Activity
    User/Merchant

Recent Profile Visitors

11,248,690 profile views

ps3z's Achievements

Newbie

Newbie (1/14)

28

Reputation

3

Community Answers

  1. merhaba 1.6 daha iyi , not: türkiyede 1.7 versiyon için kredi kartı ödeme modülü yok sanırım.
  2. hello guys i would to modify productcategory module for sort the products new to old Prestashop version 1.6.1.17 Regards Ps3z <?php /* * 2007-2016 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-2016 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('_PS_VERSION_')) exit; class ProductsCategory extends Module { protected $html; public function __construct() { $this->name = 'productscategory'; $this->version = '1.8.1'; $this->author = 'PrestaShop'; $this->tab = 'front_office_features'; $this->need_instance = 0; $this->bootstrap = true; parent::__construct(); $this->displayName = $this->l('Products in the same category'); $this->description = $this->l('Adds a block on the product page that displays products from the same category.'); $this->ps_versions_compliancy = array('min' => '1.6', 'max' => '1.6.99.99'); } public function install() { Configuration::updateValue('PRODUCTSCATEGORY_DISPLAY_PRICE', 0); $this->_clearCache('productscategory.tpl'); return (parent::install() && $this->registerHook('productfooter') && $this->registerHook('header') && $this->registerHook('addproduct') && $this->registerHook('updateproduct') && $this->registerHook('deleteproduct') ); } public function uninstall() { Configuration::deleteByName('PRODUCTSCATEGORY_DISPLAY_PRICE'); $this->_clearCache('productscategory.tpl'); return parent::uninstall(); } public function getContent() { $this->html = ''; if (Tools::isSubmit('submitCross') && Tools::getValue('PRODUCTSCATEGORY_DISPLAY_PRICE') != 0 && Tools::getValue('PRODUCTSCATEGORY_DISPLAY_PRICE') != 1 ) $this->html .= $this->displayError('Invalid displayPrice.'); elseif (Tools::isSubmit('submitCross')) { Configuration::updateValue( 'PRODUCTSCATEGORY_DISPLAY_PRICE', Tools::getValue('PRODUCTSCATEGORY_DISPLAY_PRICE') ); $this->_clearCache('productscategory.tpl'); $this->html .= $this->displayConfirmation($this->l('Settings updated successfully.')); } $this->html .= $this->renderForm(); return $this->html; } protected function getCurrentProduct($products, $id_current) { if ($products) { foreach ($products as $key => $product) { if ($product['id_product'] == $id_current) return $key; } } return false; } public function hookProductFooter($params) { $id_product = (int)$params['product']->id; $product = $params['product']; $cache_id = 'productscategory|'.$id_product.'|'.(isset($params['category']->id_category) ? (int)$params['category']->id_category : (int)$product->id_category_default); if (!$this->isCached('productscategory.tpl', $this->getCacheId($cache_id))) { $category = false; if (isset($params['category']->id_category)) $category = $params['category']; else { if (isset($product->id_category_default) && $product->id_category_default > 1) $category = new Category((int)$product->id_category_default); } if (!Validate::isLoadedObject($category) || !$category->active) return false; // Get infos $category_products = $category->getProducts($this->context->language->id, 1, 100); /* 100 products max. */ $nb_category_products = (int)count($category_products); $middle_position = 0; // Remove current product from the list if (is_array($category_products) && count($category_products)) { foreach ($category_products as $key => $category_product) { if ($category_product['id_product'] == $id_product) { unset($category_products[$key]); break; } } $taxes = Product::getTaxCalculationMethod(); if (Configuration::get('PRODUCTSCATEGORY_DISPLAY_PRICE')) { foreach ($category_products as $key => $category_product) { if ($category_product['id_product'] != $id_product) { if ($taxes == 0 || $taxes == 2) { $category_products[$key]['displayed_price'] = Product::getPriceStatic( (int)$category_product['id_product'], true, null, 2 ); } elseif ($taxes == 1) { $category_products[$key]['displayed_price'] = Product::getPriceStatic( (int)$category_product['id_product'], false, null, 2 ); } } } } // Get positions $middle_position = (int)round($nb_category_products / 2, 0); $product_position = $this->getCurrentProduct($category_products, (int)$id_product); // Flip middle product with current product if ($product_position) { $tmp = $category_products[$middle_position - 1]; $category_products[$middle_position - 1] = $category_products[$product_position]; $category_products[$product_position] = $tmp; } // If products tab higher than 30, slice it if ($nb_category_products > 30) { $category_products = array_slice($category_products, $middle_position - 15, 30, true); $middle_position = 15; } } // Display tpl $this->smarty->assign( array( 'categoryProducts' => $category_products, 'middlePosition' => (int)$middle_position, 'ProdDisplayPrice' => Configuration::get('PRODUCTSCATEGORY_DISPLAY_PRICE') ) ); } return $this->display(__FILE__, 'productscategory.tpl', $this->getCacheId($cache_id)); } public function hookHeader($params) { if (!isset($this->context->controller->php_self) || $this->context->controller->php_self != 'product') return; $this->context->controller->addCSS($this->_path.'css/productscategory.css', 'all'); $this->context->controller->addJS($this->_path.'js/productscategory.js'); $this->context->controller->addJqueryPlugin(array('scrollTo', 'serialScroll', 'bxslider')); } public function hookAddProduct($params) { if (!isset($params['product'])) return; $id_product = (int)$params['product']->id; $product = $params['product']; $cache_id = 'productscategory|'.$id_product.'|'.(isset($params['category']->id_category) ? (int)$params['category']->id_category : (int)$product->id_category_default); $this->_clearCache('productscategory.tpl', $this->getCacheId($cache_id)); } public function hookUpdateProduct($params) { if (!isset($params['product'])) return; $id_product = (int)$params['product']->id; $product = $params['product']; $cache_id = 'productscategory|'.$id_product.'|'.(isset($params['category']->id_category) ? (int)$params['category']->id_category : (int)$product->id_category_default); $this->_clearCache('productscategory.tpl', $this->getCacheId($cache_id)); } public function hookDeleteProduct($params) { if (!isset($params['product'])) return; $id_product = (int)$params['product']->id; $product = $params['product']; $cache_id = 'productscategory|'.$id_product.'|'.(isset($params['category']->id_category) ? (int)$params['category']->id_category : (int)$product->id_category_default); $this->_clearCache('productscategory.tpl', $this->getCacheId($cache_id)); } public function renderForm() { $fields_form = array( 'form' => array( 'legend' => array( 'title' => $this->l('Settings'), 'icon' => 'icon-cogs' ), 'input' => array( array( 'type' => 'switch', 'label' => $this->l('Display products\' prices'), 'desc' => $this->l('Show the prices of the products displayed in the block.'), 'name' => 'PRODUCTSCATEGORY_DISPLAY_PRICE', 'values' => array( array( 'id' => 'active_on', 'value' => 1, 'label' => $this->l('Enabled') ), array( 'id' => 'active_off', 'value' => 0, 'label' => $this->l('Disabled') ) ), ), ), 'submit' => array( 'title' => $this->l('Save'), ) ), ); $helper = new HelperForm(); $helper->show_toolbar = false; $helper->table = $this->table; $lang = new Language((int)Configuration::get('PS_LANG_DEFAULT')); $helper->default_form_language = $lang->id; $helper->allow_employee_form_lang = Configuration::get('PS_BO_ALLOW_EMPLOYEE_FORM_LANG') ? Configuration::get( 'PS_BO_ALLOW_EMPLOYEE_FORM_LANG' ) : 0; $helper->identifier = $this->identifier; $helper->submit_action = 'submitCross'; $helper->currentIndex = $this->context->link->getAdminLink( 'AdminModules', false ).'&configure='.$this->name.'&tab_module='.$this->tab.'&module_name='.$this->name; $helper->token = Tools::getAdminTokenLite('AdminModules'); $helper->tpl_vars = array( 'fields_value' => $this->getConfigFieldsValues(), 'languages' => $this->context->controller->getLanguages(), 'id_language' => $this->context->language->id ); return $helper->generateForm(array($fields_form)); } public function getConfigFieldsValues() { return array( 'PRODUCTSCATEGORY_DISPLAY_PRICE' => Tools::getValue( 'PRODUCTSCATEGORY_DISPLAY_PRICE', Configuration::get('PRODUCTSCATEGORY_DISPLAY_PRICE') ), ); } }
  3. merhaba productscategory module de ürün dizilimini yeni üründen eskiye doğru nasıl yapabilirim. Selamlar Ps3z <?php /* * 2007-2016 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-2016 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('_PS_VERSION_')) exit; class ProductsCategory extends Module { protected $html; public function __construct() { $this->name = 'productscategory'; $this->version = '1.8.1'; $this->author = 'PrestaShop'; $this->tab = 'front_office_features'; $this->need_instance = 0; $this->bootstrap = true; parent::__construct(); $this->displayName = $this->l('Products in the same category'); $this->description = $this->l('Adds a block on the product page that displays products from the same category.'); $this->ps_versions_compliancy = array('min' => '1.6', 'max' => '1.6.99.99'); } public function install() { Configuration::updateValue('PRODUCTSCATEGORY_DISPLAY_PRICE', 0); $this->_clearCache('productscategory.tpl'); return (parent::install() && $this->registerHook('productfooter') && $this->registerHook('header') && $this->registerHook('addproduct') && $this->registerHook('updateproduct') && $this->registerHook('deleteproduct') ); } public function uninstall() { Configuration::deleteByName('PRODUCTSCATEGORY_DISPLAY_PRICE'); $this->_clearCache('productscategory.tpl'); return parent::uninstall(); } public function getContent() { $this->html = ''; if (Tools::isSubmit('submitCross') && Tools::getValue('PRODUCTSCATEGORY_DISPLAY_PRICE') != 0 && Tools::getValue('PRODUCTSCATEGORY_DISPLAY_PRICE') != 1 ) $this->html .= $this->displayError('Invalid displayPrice.'); elseif (Tools::isSubmit('submitCross')) { Configuration::updateValue( 'PRODUCTSCATEGORY_DISPLAY_PRICE', Tools::getValue('PRODUCTSCATEGORY_DISPLAY_PRICE') ); $this->_clearCache('productscategory.tpl'); $this->html .= $this->displayConfirmation($this->l('Settings updated successfully.')); } $this->html .= $this->renderForm(); return $this->html; } protected function getCurrentProduct($products, $id_current) { if ($products) { foreach ($products as $key => $product) { if ($product['id_product'] == $id_current) return $key; } } return false; } public function hookProductFooter($params) { $id_product = (int)$params['product']->id; $product = $params['product']; $cache_id = 'productscategory|'.$id_product.'|'.(isset($params['category']->id_category) ? (int)$params['category']->id_category : (int)$product->id_category_default); if (!$this->isCached('productscategory.tpl', $this->getCacheId($cache_id))) { $category = false; if (isset($params['category']->id_category)) $category = $params['category']; else { if (isset($product->id_category_default) && $product->id_category_default > 1) $category = new Category((int)$product->id_category_default); } if (!Validate::isLoadedObject($category) || !$category->active) return false; // Get infos $category_products = $category->getProducts($this->context->language->id, 1, 100); /* 100 products max. */ $nb_category_products = (int)count($category_products); $middle_position = 0; // Remove current product from the list if (is_array($category_products) && count($category_products)) { foreach ($category_products as $key => $category_product) { if ($category_product['id_product'] == $id_product) { unset($category_products[$key]); break; } } $taxes = Product::getTaxCalculationMethod(); if (Configuration::get('PRODUCTSCATEGORY_DISPLAY_PRICE')) { foreach ($category_products as $key => $category_product) { if ($category_product['id_product'] != $id_product) { if ($taxes == 0 || $taxes == 2) { $category_products[$key]['displayed_price'] = Product::getPriceStatic( (int)$category_product['id_product'], true, null, 2 ); } elseif ($taxes == 1) { $category_products[$key]['displayed_price'] = Product::getPriceStatic( (int)$category_product['id_product'], false, null, 2 ); } } } } // Get positions $middle_position = (int)round($nb_category_products / 2, 0); $product_position = $this->getCurrentProduct($category_products, (int)$id_product); // Flip middle product with current product if ($product_position) { $tmp = $category_products[$middle_position - 1]; $category_products[$middle_position - 1] = $category_products[$product_position]; $category_products[$product_position] = $tmp; } // If products tab higher than 30, slice it if ($nb_category_products > 30) { $category_products = array_slice($category_products, $middle_position - 15, 30, true); $middle_position = 15; } } // Display tpl $this->smarty->assign( array( 'categoryProducts' => $category_products, 'middlePosition' => (int)$middle_position, 'ProdDisplayPrice' => Configuration::get('PRODUCTSCATEGORY_DISPLAY_PRICE') ) ); } return $this->display(__FILE__, 'productscategory.tpl', $this->getCacheId($cache_id)); } public function hookHeader($params) { if (!isset($this->context->controller->php_self) || $this->context->controller->php_self != 'product') return; $this->context->controller->addCSS($this->_path.'css/productscategory.css', 'all'); $this->context->controller->addJS($this->_path.'js/productscategory.js'); $this->context->controller->addJqueryPlugin(array('scrollTo', 'serialScroll', 'bxslider')); } public function hookAddProduct($params) { if (!isset($params['product'])) return; $id_product = (int)$params['product']->id; $product = $params['product']; $cache_id = 'productscategory|'.$id_product.'|'.(isset($params['category']->id_category) ? (int)$params['category']->id_category : (int)$product->id_category_default); $this->_clearCache('productscategory.tpl', $this->getCacheId($cache_id)); } public function hookUpdateProduct($params) { if (!isset($params['product'])) return; $id_product = (int)$params['product']->id; $product = $params['product']; $cache_id = 'productscategory|'.$id_product.'|'.(isset($params['category']->id_category) ? (int)$params['category']->id_category : (int)$product->id_category_default); $this->_clearCache('productscategory.tpl', $this->getCacheId($cache_id)); } public function hookDeleteProduct($params) { if (!isset($params['product'])) return; $id_product = (int)$params['product']->id; $product = $params['product']; $cache_id = 'productscategory|'.$id_product.'|'.(isset($params['category']->id_category) ? (int)$params['category']->id_category : (int)$product->id_category_default); $this->_clearCache('productscategory.tpl', $this->getCacheId($cache_id)); } public function renderForm() { $fields_form = array( 'form' => array( 'legend' => array( 'title' => $this->l('Settings'), 'icon' => 'icon-cogs' ), 'input' => array( array( 'type' => 'switch', 'label' => $this->l('Display products\' prices'), 'desc' => $this->l('Show the prices of the products displayed in the block.'), 'name' => 'PRODUCTSCATEGORY_DISPLAY_PRICE', 'values' => array( array( 'id' => 'active_on', 'value' => 1, 'label' => $this->l('Enabled') ), array( 'id' => 'active_off', 'value' => 0, 'label' => $this->l('Disabled') ) ), ), ), 'submit' => array( 'title' => $this->l('Save'), ) ), ); $helper = new HelperForm(); $helper->show_toolbar = false; $helper->table = $this->table; $lang = new Language((int)Configuration::get('PS_LANG_DEFAULT')); $helper->default_form_language = $lang->id; $helper->allow_employee_form_lang = Configuration::get('PS_BO_ALLOW_EMPLOYEE_FORM_LANG') ? Configuration::get( 'PS_BO_ALLOW_EMPLOYEE_FORM_LANG' ) : 0; $helper->identifier = $this->identifier; $helper->submit_action = 'submitCross'; $helper->currentIndex = $this->context->link->getAdminLink( 'AdminModules', false ).'&configure='.$this->name.'&tab_module='.$this->tab.'&module_name='.$this->name; $helper->token = Tools::getAdminTokenLite('AdminModules'); $helper->tpl_vars = array( 'fields_value' => $this->getConfigFieldsValues(), 'languages' => $this->context->controller->getLanguages(), 'id_language' => $this->context->language->id ); return $helper->generateForm(array($fields_form)); } public function getConfigFieldsValues() { return array( 'PRODUCTSCATEGORY_DISPLAY_PRICE' => Tools::getValue( 'PRODUCTSCATEGORY_DISPLAY_PRICE', Configuration::get('PRODUCTSCATEGORY_DISPLAY_PRICE') ), ); } }
  4. hi my site gives error after click to all payment confirmation buttons. my site gives error on validation page i did enable the debug mode but no error logs note: i did upgrade my prestashop recently to 1.6.1.7,problem is happend after this process my prestashop: 1.6.1.7
  5. hi when i remove cache from admin panel, site gives error on frontend, i have to remove public_html/cache/class_index.php, so sites is being active what is your idea? its happend when i did after upgrade my prestashop 1.6.1.0 to 1.6.1.11 Greetings PS3z [PrestaShopException] Dispatcher::createUrl() miss required parameter "categories" for route "category_rule" at line 661 in file classes/Dispatcher.php 656. if (!$data['required']) { 657. continue; 658. } 659. 660. if (!array_key_exists($key, $params)) { 661. throw new PrestaShopException('Dispatcher::createUrl() miss required parameter "'.$key.'" for route "'.$route_id.'"'); 662. } 663. if (isset($this->default_routes[$route_id])) { 664. $query_params[$this->default_routes[$route_id]['keywords'][$key]['param']] = $params[$key]; 665. } 666. } DispatcherCore->createUrl - [line 197 - classes/Link.php] - [6 Arguments] LinkCore->getCategoryLink - [line 1310 - modules/zeromanager/zeromanager.php] - [2 Arguments] ZeroManager->hookDisplayNav - [line 587 - classes/Hook.php] - [1 Arguments] HookCore::coreCallHook - [line 542 - classes/Hook.php] - [3 Arguments] HookCore::exec - [line 207 - config/smarty.config.inc.php] - [3 Arguments] smartyHook - [line - ] - [2 Arguments] call_user_func_array - [line 270 - config/smarty.config.inc.php] - [2 Arguments] SmartyLazyRegister->__call - [line 153 - tools/smarty/sysplugins/smarty_internal_templatebase.php(157) : eval()'d code] - [2 Arguments] Warning: file(/home/sitename/public_html/tools/smarty/sysplugins/smarty_internal_templatebase.php(157) : eval()'d code): failed to open stream: No such file or directory in /home/sitename/public_html/classes/exception/PrestaShopException.php on line 103 Warning: array_slice() expects parameter 1 to be array, boolean given in /home/sitename/public_html/classes/exception/PrestaShopException.php on line 110 SmartyLazyRegister->smartyHook - [line 153 - tools/smarty/sysplugins/smarty_internal_templatebase.php(157) : eval()'d code] - [2 Arguments] Warning: file(/home/sitename/public_html/tools/smarty/sysplugins/smarty_internal_templatebase.php(157) : eval()'d code): failed to open stream: No such file or directory in /home/sitename/public_html/classes/exception/PrestaShopException.php on line 103 Warning: array_slice() expects parameter 1 to be array, boolean given in /home/sitename/public_html/classes/exception/PrestaShopException.php on line 110 content_58af3f90cb5a86_78384183 - [line 188 - tools/smarty/sysplugins/smarty_internal_templatebase.php] - [1 Arguments] Smarty_Internal_TemplateBase->fetch - [line 317 - classes/SmartyCustom.php] - [7 Arguments] Smarty_Custom_Template->fetch - [line 303 - tools/smarty/sysplugins/smarty_internal_template.php] - [7 Arguments] Smarty_Internal_Template->getSubTemplate - [line 38 - tools/smarty/sysplugins/smarty_internal_templatebase.php(157) : eval()'d code] - [7 Arguments] Warning: file(/home/sitename/public_html/tools/smarty/sysplugins/smarty_internal_templatebase.php(157) : eval()'d code): failed to open stream: No such file or directory in /home/sitename/public_html/classes/exception/PrestaShopException.php on line 103 Warning: array_slice() expects parameter 1 to be array, boolean given in /home/sitename/public_html/classes/exception/PrestaShopException.php on line 110 content_58af3f90ad0e82_11797199 - [line 188 - tools/smarty/sysplugins/smarty_internal_templatebase.php] - [1 Arguments] Smarty_Internal_TemplateBase->fetch - [line 110 - classes/SmartyCustom.php] - [7 Arguments] SmartyCustomCore->fetch - [line 529 - classes/controller/Controller.php] - [1 Arguments] ControllerCore->smartyOutputContent - [line 723 - classes/controller/FrontController.php] - [1 Arguments] FrontControllerCore->display - [line 209 - classes/controller/Controller.php] ControllerCore->run - [line 367 - classes/Dispatcher.php] DispatcherCore->dispatch - [line 28 - index.php]
  6. yeah need to wait Prestashop gurus if they will investigate it as soon as possible
  7. i understand you are not able to save the products right? if yes...i have the same problem... what issue could be? its not saving the product usually... check this... problem with new version of chrome http://forge.prestashop.com/browse/PSCSX-8524
  8. hi im doing regenerate the thumbnails without keep high resoultion...i hope it will delete that one... but im not sure how to remove images for other languages. if i delete the languages.i think that will not delete the images...my produce website can down i need to be sure before to do something serious
  9. i have 150gb hdd but still have capacity issues...i suppose that duplicated images are make some issues...bcz of that i would to delete all.. but i should do it safety my language list http://c2n.me/3CvSNyN.png
  10. i have over 4000 products,prestshop is being timeout when i do regenerate my images. im using a 3rd party module for regenerate the images... i dont use another languages but its containing images per languages..how do i remove them? not:languages are disabled already on admin panel, i have to remove it?
  11. hi guys images are duplicated as 2x,i couldnt figure out,but you senior developers could figure out of this Regards Ps3z
  12. have one more issue forexample im selling " fifa 17 ps4 game" when i search on search box...its showing the old fifa titles like fifa 15-16 etc they have to change orderway as add_date but they show like default position.... note: we are typing here that improvements and necessary things...but im not sure the developers are reading all these things....
  13. hi Profs.. i have market website ,have many kind of products ,forexample selling game and home appliances too...but home appliances are showing on game category also its being weird like this is there possible to show the new products belong to same category? Best Regards Ps3z
  14. i didnt talk about the theme, if you read its about the admin
  15. hi guys fixed price setting as tax excluded on product page admin. that should be tax included... bcz we have to type there the final price as what we would to show on site. also it doesnt show strikeout the price Retail price with tax: 250 fixed price is : 220
×
×
  • Create New...