Jump to content

Xtra Think

Members
  • Posts

    9
  • Joined

  • Last visited

Profile Information

  • First Name
    rachid
  • Last Name
    antipod

Xtra Think's Achievements

Newbie

Newbie (1/14)

1

Reputation

  1. If you do not find anything about your other problem, just open a new topic and link it with this in a comment to let me know, if i can do something for you Or send me your skype coords in PM
  2. This solution is not for ordring categories, it's for fixing the problem of products positions inside categories !!
  3. Not this one, the other in the CLASSES folder, Here : /public_html/classes/Tools.php Or if you already ovvridded your "classes" folder, you will find the file here : /public_html/override/classes/Tools.php Rachid chihabi
  4. My solution was for the old version of "blocklayered" module (PS version 1.6.0.14), So the correction is compatible up to PS version 1.6.0.14. If you have PS 1.6.1.x (the module is came out with the version of PS) here is what you have to do : 1- Go to blocklayered.php file 2- Go to getProductByFilters function 3 - Find this line of code "if (version_compare(_PS_VERSION_, '1.6.1', '>=') === true)" 4- Change all the ( IF and else ) statement by : if (version_compare(_PS_VERSION_, '1.6.1', '>=') === true) { $this->products = Db::getInstance()->executeS(' SELECT p.*, '.($alias_where == 'p' ? '' : 'product_shop.*,' ).' '.$alias_where.'.id_category_default, pl.*, image_shop.`id_image` id_image, il.legend, m.name manufacturer_name, '.(Combination::isFeatureActive() ? 'product_attribute_shop.id_product_attribute id_product_attribute,' : '').' DATEDIFF('.$alias_where.'.`date_add`, DATE_SUB("'.date('Y-m-d').' 00:00:00", INTERVAL '.(int)$nb_day_new_product.' DAY)) > 0 AS new, stock.out_of_stock, IFNULL(stock.quantity, 0) as quantity'.(Combination::isFeatureActive() ? ', product_attribute_shop.minimal_quantity AS product_attribute_minimal_quantity' : '').' FROM '._DB_PREFIX_.'cat_filter_restriction cp LEFT JOIN `'._DB_PREFIX_.'product` p ON p.`id_product` = cp.`id_product` '.Shop::addSqlAssociation('product', 'p'). (Combination::isFeatureActive() ? ' LEFT JOIN `'._DB_PREFIX_.'product_attribute_shop` product_attribute_shop ON (p.`id_product` = product_attribute_shop.`id_product` AND product_attribute_shop.`default_on` = 1 AND product_attribute_shop.id_shop='.(int)$context->shop->id.')':'').' LEFT JOIN '._DB_PREFIX_.'product_lang pl ON (pl.id_product = p.id_product'.Shop::addSqlRestrictionOnLang('pl').' AND pl.id_lang = '.(int)$cookie->id_lang.') LEFT JOIN `'._DB_PREFIX_.'category_product` p_cat ON (p.id_product = p_cat.id_product) LEFT JOIN `'._DB_PREFIX_.'image_shop` image_shop ON (image_shop.`id_product` = p.`id_product` AND image_shop.cover=1 AND image_shop.id_shop='.(int)$context->shop->id.') LEFT JOIN `'._DB_PREFIX_.'image_lang` il ON (image_shop.`id_image` = il.`id_image` AND il.`id_lang` = '.(int)$cookie->id_lang.') LEFT JOIN '._DB_PREFIX_.'manufacturer m ON (m.id_manufacturer = p.id_manufacturer) '.Product::sqlStock('p', 0).' WHERE '.$alias_where.'.`active` = 1 AND '.$alias_where.'.`visibility` IN ("both", "catalog") AND p_cat.id_category = '.(int)$id_parent.' ORDER BY '.Tools::getProductsOrder('by', Tools::getValue('orderby'), true).' '.Tools::getProductsOrder('way', Tools::getValue('orderway')).' , cp.id_product'. ' LIMIT '.(((int)$this->page - 1) * $n.','.$n)); } else { $this->products = Db::getInstance()->executeS(' SELECT p.*, '.($alias_where == 'p' ? '' : 'product_shop.*,' ).' '.$alias_where.'.id_category_default, pl.*, MAX(image_shop.`id_image`) id_image, il.legend, m.name manufacturer_name, '.(Combination::isFeatureActive() ? 'MAX(product_attribute_shop.id_product_attribute) id_product_attribute,' : '').' DATEDIFF('.$alias_where.'.`date_add`, DATE_SUB("'.date('Y-m-d').' 00:00:00", INTERVAL '.(int)$nb_day_new_product.' DAY)) > 0 AS new, stock.out_of_stock, IFNULL(stock.quantity, 0) as quantity'.(Combination::isFeatureActive() ? ', MAX(product_attribute_shop.minimal_quantity) AS product_attribute_minimal_quantity' : '').' FROM '._DB_PREFIX_.'cat_filter_restriction cp LEFT JOIN `'._DB_PREFIX_.'product` p ON p.`id_product` = cp.`id_product` '.Shop::addSqlAssociation('product', 'p'). (Combination::isFeatureActive() ? 'LEFT JOIN `'._DB_PREFIX_.'product_attribute` pa ON (p.`id_product` = pa.`id_product`) '.Shop::addSqlAssociation('product_attribute', 'pa', false, 'product_attribute_shop.`default_on` = 1 AND product_attribute_shop.id_shop='.(int)$context->shop->id):'').' LEFT JOIN '._DB_PREFIX_.'product_lang pl ON (pl.id_product = p.id_product'.Shop::addSqlRestrictionOnLang('pl').' AND pl.id_lang = '.(int)$cookie->id_lang.') LEFT JOIN `'._DB_PREFIX_.'category_product` p_cat ON (p.id_product = p_cat.id_product) LEFT JOIN `'._DB_PREFIX_.'image` i ON (i.`id_product` = p.`id_product`)'. Shop::addSqlAssociation('image', 'i', false, 'image_shop.cover=1').' LEFT JOIN `'._DB_PREFIX_.'image_lang` il ON (image_shop.`id_image` = il.`id_image` AND il.`id_lang` = '.(int)$cookie->id_lang.') LEFT JOIN '._DB_PREFIX_.'manufacturer m ON (m.id_manufacturer = p.id_manufacturer) '.Product::sqlStock('p', 0).' WHERE '.$alias_where.'.`active` = 1 AND '.$alias_where.'.`visibility` IN ("both", "catalog") AND p_cat.id_category = '.(int)$id_parent.' GROUP BY product_shop.id_product ORDER BY '.Tools::getProductsOrder('by', Tools::getValue('orderby'), true).' '.Tools::getProductsOrder('way', Tools::getValue('orderway')).' , cp.id_product'. ' LIMIT '.(((int)$this->page - 1) * $n.','.$n)); } 5 - Go to Tools.php and find "getProductsOrder"Change this : } elseif ($value == 'position' || empty($value)) { $order_by_prefix = 'cp.'; } By this : } elseif ($value == 'position' || empty($value)) { $order_by_prefix = 'p_cat.'; } Finally Save and don't foret to override your files. Sorry for my english its not my language Rachid Chihabi
  5. Hi, For those who still have this problem and if you have blocklayered module activated on your store then here is what i did to fix the problem. 1- Go to blocklayered.php file 2- Go to getProductByFilters function 3- line 2013/2014 add this "AND cp.id_category = '.(int)$id_parent.'" 4- Save and enjoy Rachid Chihabi
  6. Hi, For those who still have this problem and if you have blocklayered module activated on your store then here is what i did to fix the problem. 1- Go to blocklayered.php file 2- Go to getProductByFilters function 3- line 2013/2014 add this "AND cp.id_category = '.(int)$id_parent.'" 4- Save and enjoy Rachid Chihabi
  7. HI, for those who still interested in this topic. This is my solution and it works fine for me (PS 1.6) I changed this "generateReference" like this : /** * Gennerate a unique reference for orders generated with the same cart id * This references, is usefull for check payment * * @return String */ public static function generateReference() { $OrderMaxID = Db::getInstance()->getValue(' SELECT MAX(id_order) FROM '._DB_PREFIX_.'orders '); return str_pad((int)$OrderMaxID+1, 9, "0", STR_PAD_LEFT); // return strtoupper(Tools::passwdGen(9, 'NUMERIC')); } NOTA : the order reference will be incremented
  8. Bonjour tout le monde, J'ai besoin d'afficher les attribues d'un produit sur la liste des produits, pour que je puisse ajouter un produit avec une combinaison sélectionné depuis la liste des produits. Exemple : je sélectionne une TAILLE et je clique sur 'ajouter au panier' depuis la liste des produits, le produit doit s'ajouter avec la taille sélectionné. Merci d'avance. -------------------------------------- Hello everyone, I need to display attributes to a product on the product list, so I can add a product with a combination selected from the list of products. example: I select SIZE and I click on 'add to cart' from the list of products, the product should be added in the selected size. Thank you in advance.
×
×
  • Create New...