Jump to content

omixam

Members
  • Posts

    24
  • Joined

  • Last visited

Profile Information

  • Activity
    Freelancer

omixam's Achievements

Newbie

Newbie (1/14)

1

Reputation

  1. Hello, I want extend PrestaShop search for include category filter. Bu the PrestaShop Search.php class not has this option by default. I also know that I can override PrestaShop classes and controllers http://doc.prestashop.com/display/PS16/Overriding+default+behaviors But PrestaShop forbid override module fo distribute through addons. I need do something like the image attached. A dopdown for category list with text box by search. How can I do this without override? Can I create a new class or single php file in my module directory to extend Search behavior? What other alternative has PrestaShop to do this? --- My store is not online.
  2. 1. I tried but the same error. 2. No, I don't over ride Db classes, I only override Search.php class.
  3. Hello, I'm developing searching module and I'm overriding find method of Seach.php class, but I'm getting the following message: [PrestaShopDatabaseException] Db->executeS() must be used only with select, show, explain or describe queries at line 488 in file classes/db/Db.php I don't understand why this error if I only use SELECT clause. See the complete error in the image attached I also attached the file of override Search.php class. Anyone have an idea how can I solve this error? Thanks in Advanced! I'm working in localhost. Prestashop 1.6 Search.php
  4. 1. If you only want see the large phone number you can edit css the module that show the phone number, now I not using prestashop and I not remember what is the exact module but you can check with browser inspector. 2. If you want show your header like the reference, I beleive you going to need create a new module. Can be a simple module. I recomend this option.
  5. Hello, I need add to prestashop search module a dropdown with the categories available for be used as a filter, like show in the image attach... I have a few question: How can I get the category from dropdown? and pass it to search query.. How can I know What function of Search.php or SearchController I need override? Help, please! Thanks in avanced!
  6. Bellow hookHeader function is exactly like show in original blocksearch. I checked the path for css files and are correct... public function hookHeader($params) { if (Configuration::get('PS_SEARCH_AJAX')) $this->context->controller->addJqueryPlugin('autocomplete'); $this->context->controller->addCSS(_THEME_CSS_DIR_.'product_list.css'); $this->context->controller->addCSS(($this->_path).'blocksearchavanced.css', 'all'); if (Configuration::get('PS_SEARCH_AJAX')) { Media::addJsDef(array('search_url' => $this->context->link->getPageLink('search', Tools::usingSecureMode()))); $this->context->controller->addJS(($this->_path).'blocksearchavanced.js'); } }
  7. I only changed all names refer to blocksearch to blocksearchavanced it included: all files names (css,js,tpl,php) in the modules and my theme directory and also the variables that start with blocksearch_ to blocksearchavanced_... But not changed classes and id names... I see that my theme is not loading css of blocksearchavanced in <head></head>.. I working in local in develop mode (debug true,force recompilation selected,cache no, all ccc no)... I noted that the files that were override for my theme that work property for the original version of blocksearch not work for blocksearchavanced instead of I adapt for the copied to other folder and renamed for make coincide with their new reference module blocksearchavanced...
  8. Hello, I need add to prestashop search module with a dropdown with the categories available for be used as a filter. I know that I can't override php files of the modules... I copied all file of this module to other folder and rename like this: /modules/blocksearch changed to /modules/blocksearchavanced themes/bootstrap_theme/modules/blocksearch change to themes/bootstrap_theme/modules/blocksearchavanced I rename all files names and references inside of the files to blocksearchavanced, but when I installed the new module is not rendering neither css nor jquery and show like the image attach... I don't have any idea Why is passing that... I'm trying to debug for find the issue but yet I have can find it... Can any body help me?
  9. Of course... I want that use the css of my theme... Not that other module modify css of any module raddom....
  10. Hello, I'm developing this site http://megabaul.com and I have installed themeconfigurator module, but this module is override my css theme... when I check with firebug contact-link a I get the HTML <div id="contact-link"> <a title="Contáctenos" href="http://megabaul.com/contactenos">Contáctenos</a> </div> and I get the attach css how you can see #header #contact-link a comes from megabaul.com/modules/themeconfigurator/css/theme8.css and override the module's css that are in the theme #contact-link a comes from http://megabaul.com/themes/bootstrap_theme/css/modules/blockcontact/blockcontact.css Other css override for this module: search button new label of products (Nuevo for my case) product prices others minors Any body can help me?
  11. The second suggestion is that I asking... I copied classes/Product.php to override/classes/Product.php and change class name to class Product extends ProductCore like suggest the documentation... for prestashop 1.6.0.6 the getNewProducts function is like thats public static function getNewProducts($id_lang, $page_number = 0, $nb_products = 10, $count = false, $order_by = null, $order_way = null, Context $context = null) { if (!$context) $context = Context::getContext(); $front = true; if (!in_array($context->controller->controller_type, array('front', 'modulefront'))) $front = false; if ($page_number < 0) $page_number = 0; if ($nb_products < 1) $nb_products = 10; if (empty($order_by) || $order_by == 'position') $order_by = 'date_add'; if (empty($order_way)) $order_way = 'DESC'; if ($order_by == 'id_product' || $order_by == 'price' || $order_by == 'date_add' || $order_by == 'date_upd') $order_by_prefix = 'p'; else if ($order_by == 'name') $order_by_prefix = 'pl'; if (!Validate::isOrderBy($order_by) || !Validate::isOrderWay($order_way)) die(Tools::displayError()); $sql_groups = ''; if (Group::isFeatureActive()) { $groups = FrontController::getCurrentCustomerGroups(); $sql_groups = 'AND p.`id_product` IN ( SELECT cp.`id_product` FROM `'._DB_PREFIX_.'category_group` cg LEFT JOIN `'._DB_PREFIX_.'category_product` cp ON (cp.`id_category` = cg.`id_category`) WHERE cg.`id_group` '.(count($groups) ? 'IN ('.implode(',', $groups).')' : '= 1').' )'; } if (strpos($order_by, '.') > 0) { $order_by = explode('.', $order_by); $order_by_prefix = $order_by[0]; $order_by = $order_by[1]; } if ($count) { $sql = 'SELECT COUNT(p.`id_product`) AS nb FROM `'._DB_PREFIX_.'product` p '.Shop::addSqlAssociation('product', 'p').' WHERE product_shop.`active` = 1 AND product_shop.`date_add` > "'.date('Y-m-d', strtotime('-'.(Configuration::get('PS_NB_DAYS_NEW_PRODUCT') ? (int)Configuration::get('PS_NB_DAYS_NEW_PRODUCT') : 20).' DAY')).'" '.($front ? ' AND product_shop.`visibility` IN ("both", "catalog")' : '').' '.$sql_groups; return (int)Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue($sql); } $sql = new DbQuery(); $sql->select( 'p.*, product_shop.*, stock.out_of_stock, IFNULL(stock.quantity, 0) as quantity, pl.`description`, pl.`description_short`, pl.`link_rewrite`, pl.`meta_description`, pl.`meta_keywords`, pl.`meta_title`, pl.`name`, pl.`available_now`, pl.`available_later`, MAX(image_shop.`id_image`) id_image, il.`legend`, m.`name` AS manufacturer_name, product_shop.`date_add` > "'.date('Y-m-d', strtotime('-'.(Configuration::get('PS_NB_DAYS_NEW_PRODUCT') ? (int)Configuration::get('PS_NB_DAYS_NEW_PRODUCT') : 20).' DAY')).'" as new' ); $sql->from('product', 'p'); $sql->join(Shop::addSqlAssociation('product', 'p')); $sql->leftJoin('product_lang', 'pl', ' p.`id_product` = pl.`id_product` AND pl.`id_lang` = '.(int)$id_lang.Shop::addSqlRestrictionOnLang('pl') ); $sql->leftJoin('image', 'i', 'i.`id_product` = p.`id_product`'); $sql->join(Shop::addSqlAssociation('image', 'i', false, 'image_shop.cover=1')); $sql->leftJoin('image_lang', 'il', 'i.`id_image` = il.`id_image` AND il.`id_lang` = '.(int)$id_lang); $sql->leftJoin('manufacturer', 'm', 'm.`id_manufacturer` = p.`id_manufacturer`'); $sql->where('product_shop.`active` = 1'); if ($front) $sql->where('product_shop.`visibility` IN ("both", "catalog")'); $sql->where('product_shop.`date_add` > "'.date('Y-m-d', strtotime('-'.(Configuration::get('PS_NB_DAYS_NEW_PRODUCT') ? (int)Configuration::get('PS_NB_DAYS_NEW_PRODUCT') : 20).' DAY')).'"'); if (Group::isFeatureActive()) $sql->where('p.`id_product` IN ( SELECT cp.`id_product` FROM `'._DB_PREFIX_.'category_group` cg LEFT JOIN `'._DB_PREFIX_.'category_product` cp ON (cp.`id_category` = cg.`id_category`) WHERE cg.`id_group` '.$sql_groups.' )'); $sql->groupBy('product_shop.id_product'); $sql->orderBy((isset($order_by_prefix) ? pSQL($order_by_prefix).'.' : '').'`'.pSQL($order_by).'` '.pSQL($order_way)); $sql->limit($nb_products, $page_number * $nb_products); if (Combination::isFeatureActive()) { $sql->select('MAX(product_attribute_shop.id_product_attribute) id_product_attribute'); $sql->leftOuterJoin('product_attribute', 'pa', 'p.`id_product` = pa.`id_product`'); $sql->join(Shop::addSqlAssociation('product_attribute', 'pa', false, 'product_attribute_shop.default_on = 1')); } $sql->join(Product::sqlStock('p', Combination::isFeatureActive() ? 'product_attribute_shop' : 0)); $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($sql); if ($order_by == 'price') Tools::orderbyPrice($result, $order_way); if (!$result) return false; $products_ids = array(); foreach ($result as $row) $products_ids[] = $row['id_product']; // Thus you can avoid one query per product, because there will be only one query for all the products of the cart Product::cacheFrontFeatures($products_ids, $id_lang); return Product::getProductsProperties((int)$id_lang, $result); } A fews more question: How can I see the output for debug of the $result of this function? You suggest me that I only have to add one function like that you recomment not copy entire Product.php to override/classes? Thanks for your help!
  12. Hello, Recently I start this online store.... http://megabaul.com/ But I'm get in new products one product in the first line and the other in the second line... Bellow list when show the products in the home page... <ul id="blocknewproducts" class="product_list grid row blocknewproducts tab-pane active"> <li class="ajax_block_product col-xs-12 col-sm-4 col-md-3 last-item-of-mobile-line"> <li class="ajax_block_product col-xs-12 col-sm-4 col-md-3 first-in-line first-item-of-mobile-line"> <li class="ajax_block_product col-xs-12 col-sm-4 col-md-3 first-item-of-tablet-line first-item-of-mobile-line"> <li class="ajax_block_product col-xs-12 col-sm-4 col-md-3 last-in-line last-item-of-mobile-line"> </ul> But it suposse that for first product the css are: ajax_block_product col-xs-12 col-sm-4 col-md-3 first-in-line first-item-of-tablet-line first-item-of-mobile-line Somebody can help me?
  13. I have been reading the blocknewproducts php and tpl files but I didn't found the code that generate product that show in home page...
  14. Hello, I need hide some products from home page when don't have image... found in /themes/my_theme/index.tpl {$HOOK_HOME_TAB} $HOOK_HOME But I can't find where edit this.... How can I override for get thats?
×
×
  • Create New...