Jump to content

Idiotic

Members
  • Posts

    7
  • Joined

  • Last visited

Profile Information

  • Activity
    Other

Idiotic's Achievements

Newbie

Newbie (1/14)

1

Reputation

  1. Hello, in 1.6.1.6 I am trying to check if user is in group with id 6 using this: controller: 'hisGroup' => ($this->context->customer->logged AND (Customer::getDefaultGroupId((int)$this->context->customer->id) == 6) ? true : false) tpl: {if $hisGroup}...{/if} although its not working. Do you have any idea why is that? Thanks for reply.
  2. Cool, bless the founder ) saved my life man. Little tip for these who were fighting the searchcontroller and didnt solve it after all - should look like this (1.6.1.6): class SearchControllerCore extends FrontController { public $php_self = 'search'; public $instant_search; public $ajax_search; /** * Initialize search controller * @see FrontController::init() */ public function init() { parent::init(); $this->instant_search = Tools::getValue('instantSearch'); $this->ajax_search = Tools::getValue('ajaxSearch'); if ($this->instant_search || $this->ajax_search) { $this->display_header = false; $this->display_footer = false; } } /** * Assign template vars related to page content * @see FrontController::initContent() */ public function initContent() { $original_query = Tools::getValue('q'); $query = Tools::replaceAccentedChars(urldecode($original_query)); if ($this->ajax_search) { $searchResults = Search::find((int)(Tools::getValue('id_lang')), $query, 1, 10, 'position', 'desc', true); if (is_array($searchResults)) { foreach ($searchResults as &$product) { $product['product_link'] = $this->context->link->getProductLink($product['id_product'], $product['prewrite'], $product['crewrite']); } Hook::exec('actionSearch', array('expr' => $query, 'total' => count($searchResults))); } $this->ajaxDie(Tools::jsonEncode($searchResults)); } //Only controller content initialization when the user use the normal search parent::initContent(); $product_per_page = isset($this->context->cookie->nb_item_per_page) ? (int)$this->context->cookie->nb_item_per_page : Configuration::get('PS_PRODUCTS_PER_PAGE'); if ($this->instant_search && !is_array($query)) { $this->productSort(); $this->n = abs((int)(Tools::getValue('n', $product_per_page))); $this->p = abs((int)(Tools::getValue('p', 1))); $search = Search::find($this->context->language->id, $query, 1, 10, 'position', 'desc'); Hook::exec('actionSearch', array('expr' => $query, 'total' => $search['total'])); $nbProducts = $search['total']; $this->pagination($nbProducts); $this->addColorsToProductList($search['result']); $products = $search['result']; foreach($products as &$pro) { $pro['combinations'] = Product::getProductAttributeCombinations($pro['id_product']); } $this->context->smarty->assign(array( 'products' => $search['result'], // DEPRECATED (since to 1.4), not use this: conflict with block_cart module 'combinations' => $combinations, 'search_products' => $products, 'nbProducts' => $search['total'], 'search_query' => $original_query, 'instant_search' => $this->instant_search, 'homeSize' => Image::getSize(ImageType::getFormatedName('home')))); } elseif (($query = Tools::getValue('search_query', Tools::getValue('ref'))) && !is_array($query)) { $this->productSort(); $this->n = abs((int)(Tools::getValue('n', $product_per_page))); $this->p = abs((int)(Tools::getValue('p', 1))); $original_query = $query; $query = Tools::replaceAccentedChars(urldecode($query)); $search = Search::find($this->context->language->id, $query, $this->p, $this->n, $this->orderBy, $this->orderWay); if (is_array($search['result'])) { foreach ($search['result'] as &$product) { $product['link'] .= (strpos($product['link'], '?') === false ? '?' : '&').'search_query='.urlencode($query).'&results='.(int)$search['total']; } } Hook::exec('actionSearch', array('expr' => $query, 'total' => $search['total'])); $nbProducts = $search['total']; $this->pagination($nbProducts); $this->addColorsToProductList($search['result']); $products = $search['result']; foreach($products as &$pro) { $pro['combinations'] = Product::getProductAttributeCombinations($pro['id_product']); } $this->context->smarty->assign(array( 'products' => $search['result'], // DEPRECATED (since to 1.4), not use this: conflict with block_cart module 'search_products' => $products, //'combinations' => $combinations, 'nbProducts' => $search['total'], 'search_query' => $original_query, 'homeSize' => Image::getSize(ImageType::getFormatedName('home')))); } elseif (($tag = urldecode(Tools::getValue('tag'))) && !is_array($tag)) { $nbProducts = (int)(Search::searchTag($this->context->language->id, $tag, true)); $this->pagination($nbProducts); $result = Search::searchTag($this->context->language->id, $tag, false, $this->p, $this->n, $this->orderBy, $this->orderWay); Hook::exec('actionSearch', array('expr' => $tag, 'total' => count($result))); $this->addColorsToProductList($result); $products = $result; foreach($products as &$pro) { $pro['combinations'] = Product::getProductAttributeCombinations($pro['id_product']); } $this->context->smarty->assign(array( 'search_tag' => $tag, 'products' => $result, // DEPRECATED (since to 1.4), not use this: conflict with block_cart module 'combinations' => $combinations, 'search_products' => $products, 'nbProducts' => $nbProducts, 'homeSize' => Image::getSize(ImageType::getFormatedName('home')))); } else { $products = array(); foreach($products as &$pro) { $pro['combinations'] = Product::getProductAttributeCombinations($pro['id_product']); } $this->context->smarty->assign(array( 'products' => array(), 'combinations' => $combinations, 'search_products' => $products, 'pages_nb' => 1, 'nbProducts' => 0)); } $this->context->smarty->assign(array('add_prod_display' => Configuration::get('PS_ATTRIBUTE_CATEGORY_DISPLAY'), 'comparator_max_item' => Configuration::get('PS_COMPARATOR_MAX_ITEM'))); $this->setTemplate(_PS_THEME_DIR_.'search.tpl'); } public function displayHeader($display = true) { if (!$this->instant_search && !$this->ajax_search) { parent::displayHeader(); } else { $this->context->smarty->assign('static_token', Tools::getToken(false)); } } public function displayFooter($display = true) { if (!$this->instant_search && !$this->ajax_search) { parent::displayFooter(); } } public function setMedia() { parent::setMedia(); if (!$this->instant_search && !$this->ajax_search) { $this->addCSS(_THEME_CSS_DIR_.'product_list.css'); } } }
  3. i found smthng interesting: now its working, although: http://seamo.entwick.eu/cs/home/9-brzdny-odpor-400w.html (selected variant without switch + galvanized steel ip20) a/ in CZK currency it works ok, although when changing desired amount product price shows "-" before price b/ in EUR currency when changing desired amount it takes prices in CZK and shows it as EUR
  4. lets say we set 3 specif. prices for one product combination: 1piece ---100€ 5pcs------75€ 10pcs----50€ In this case, adding 10pcs to cart really adds 10pcs and price in the cart is ok, although: 1/ the price shown as a product price is not correct, when I reach first quantity condition (write to quantity form 5 and more pcs) In my post on core developers cat., I thought I was doing something wrong, now I am sure it is a bug. Started task on forge. My question is, have you experienced this? Only similar post I found is https://www.prestashop.com/forums/topic/540999-combination-specific-price-problem/ and he did not find anything.
  5. update: first part of solution: https://www.prestashop.com/forums/topic/540999-combination-specific-price-problem/
  6. UPDATE: I found out that volume discount lines on product combination detail are not displayed no matter what, if you add special price to this product combination. If you add the special price for all combinations, everything works fine. Zero price is not likely reason. Any idea?
  7. Hello, I think malfunction of these two are somehow related, although I would like to confirm it. I am setting new shop in here: http://seamo.entwick.eu/. Because every customer is gonna have different prices for product combinations, I set up ZERO PRICES for products and give prices through combinations only. Other reason is, when there is 0 price, Im gonna rewrite this 0 to "price to ask" or such. It is not possible to set up product price to anything, because there is no universal price level for all users. So, in the catalog - product in "prices" tab there are set 3 price rules, for one specific combination. This combination - from amount 1: price 800, from 11: price 600, from: 51: price 200. On product detail it is not showing all these volume discounts, there are even mistakes in the volume discount lines. See it in here (only switch to CZK currency): ************** http://seamo.entwick.eu/gb/home/9-braking-resistor-400w.html#/27-housing-galvanized_steel_ip20/29-temperature_switch-without_switch ************** My question is: is it possible to approach it like this / is it bug / is there a bypass possible? Thanks for reply. M
×
×
  • Create New...