ps3z Posted October 26, 2013 Share Posted October 26, 2013 (edited) Top sellers are not listed in page, but its displaying in the right column http://screencast.com/t/eoZmAJ4uxHJ http://www.worldbazaar.com.tr/en/best-sales Edited October 29, 2013 by ps3z (see edit history) Link to comment Share on other sites More sharing options...
PascalVG Posted October 26, 2013 Share Posted October 26, 2013 Hi ps3z, Do you have the same problem, when changing to the default theme? What Prestashop version do you use? Is your theme721 up to date? Are there any source code-changes made to your PrestaShop? pascal Link to comment Share on other sites More sharing options...
Rolige Posted October 26, 2013 Share Posted October 26, 2013 I think this is problem from your custome theme, like @PascalVG say, try this firstly with the default theme and see what happen. Link to comment Share on other sites More sharing options...
ps3z Posted October 26, 2013 Author Share Posted October 26, 2013 I think this is problem from your custome theme, like @PascalVG say, try this firstly with the default theme and see what happen. ok i will check soon. i have to do migration process right now.i will share with you about the news. Link to comment Share on other sites More sharing options...
ps3z Posted October 26, 2013 Author Share Posted October 26, 2013 i changed theme to default. result is same. Link to comment Share on other sites More sharing options...
ps3z Posted October 26, 2013 Author Share Posted October 26, 2013 Hi ps3z, Do you have the same problem, when changing to the default theme? What Prestashop version do you use? Is your theme721 up to date? Are there any source code-changes made to your PrestaShop? pascal Hi Pascal my presta is 1.5.4.1, i think its happend after upgrading from 1.5.3.1 Link to comment Share on other sites More sharing options...
Rolige Posted October 27, 2013 Share Posted October 27, 2013 Try activate debug mode to see if throw some error. Link to comment Share on other sites More sharing options...
ps3z Posted October 27, 2013 Author Share Posted October 27, 2013 Try activate debug mode to see if throw some error. ok Link to comment Share on other sites More sharing options...
ps3z Posted October 27, 2013 Author Share Posted October 27, 2013 (edited) theres no any error,could possible to something wrong in db after upgrade? Edited October 27, 2013 by ps3z (see edit history) Link to comment Share on other sites More sharing options...
Rolige Posted October 27, 2013 Share Posted October 27, 2013 The theme that youre using is the same before the upgrade ?, most of theme use on blockfeatured modified, take a look if is the default module or one modified, if this yes, then try with the default. Link to comment Share on other sites More sharing options...
ps3z Posted October 27, 2013 Author Share Posted October 27, 2013 (edited) The theme that youre using is the same before the upgrade ?, most of theme use on blockfeatured modified, take a look if is the default module or one modified, if this yes, then try with the default. i moved to Vps lastnight because of that,i couldnt check well. i checked now. Default theme also have this same problem.i got an error in debug mode.please check at below http://screencast.com/t/cHy3EFlR Edited October 27, 2013 by ps3z (see edit history) Link to comment Share on other sites More sharing options...
Rolige Posted October 28, 2013 Share Posted October 28, 2013 Just like a comment, why don't upgrade to 1.5.6.0 ?, ps 1.5.4.1 have some important bugs and maybe you will have more in the further, try to upgrade, if the problem persist I can help you to solve but I don't think so that happen. Link to comment Share on other sites More sharing options...
ps3z Posted October 28, 2013 Author Share Posted October 28, 2013 Just like a comment, why don't upgrade to 1.5.6.0 ?, ps 1.5.4.1 have some important bugs and maybe you will have more in the further, try to upgrade, if the problem persist I can help you to solve but I don't think so that happen. my some modules not compatible with 1.5.6 Link to comment Share on other sites More sharing options...
Rolige Posted October 28, 2013 Share Posted October 28, 2013 Delete the override file in: override/classes/controller/FronControler.php I think these is the problem, make a backup of the file first. Tell me what happened. Link to comment Share on other sites More sharing options...
ps3z Posted October 28, 2013 Author Share Posted October 28, 2013 Delete the override file in: override/classes/controller/FronControler.php I think these is the problem, make a backup of the file first. Tell me what happened. ill try and let you know Link to comment Share on other sites More sharing options...
ps3z Posted October 28, 2013 Author Share Posted October 28, 2013 i delete it ,problem still existing. Link to comment Share on other sites More sharing options...
Rolige Posted October 28, 2013 Share Posted October 28, 2013 Please active mode debug to see the error Link to comment Share on other sites More sharing options...
ps3z Posted October 28, 2013 Author Share Posted October 28, 2013 its activated now. Link to comment Share on other sites More sharing options...
PascalVG Posted October 28, 2013 Share Posted October 28, 2013 Hi ps3z, can you try something for me? 1) Backup file classes/ProductSale.php 2) Edit the file, and find the function : public static function getBestSales(...) 3) scroll down until you see: GROUP BY product_shop.id_product ORDER BY `'.pSQL($order_by).'` '.pSQL($order_way).' LIMIT '.(int)($page_number * $nb_products).', '.(int)$nb_products; then do this: GROUP BY product_shop.id_product ORDER BY `'.pSQL($order_by).'` '.pSQL($order_way).' <- take this line out LIMIT '.(int)($page_number * $nb_products).', '.(int)$nb_products; Why I try this: The error message you gave us complains about an ambiguous field date_add (as there is a field date_add in both ps_product and ps_product_shop ). This field is used for ordering the list, therefore if we take out the order by clause from the SQL query, this may 'solve' it. We may need to fix it differently when this indeed solves the problem of not showing the products. We may just have to add the p.date_add in the order field to really fix it correctly. But let's first see if this solves the initial problem. pascal. Link to comment Share on other sites More sharing options...
Rolige Posted October 28, 2013 Share Posted October 28, 2013 Looks like a problem with your producst table, check if your table have all of this columns: `id_product` int(10) unsigned NOT NULL AUTO_INCREMENT, `id_supplier` int(10) unsigned DEFAULT NULL, `id_manufacturer` int(10) unsigned DEFAULT NULL, `id_category_default` int(10) unsigned DEFAULT NULL, `id_shop_default` int(10) unsigned NOT NULL DEFAULT '1', `id_tax_rules_group` int(11) unsigned NOT NULL, `on_sale` tinyint(1) unsigned NOT NULL DEFAULT '0', `online_only` tinyint(1) unsigned NOT NULL DEFAULT '0', `ean13` varchar(13) DEFAULT NULL, `upc` varchar(12) DEFAULT NULL, `ecotax` decimal(17,6) NOT NULL DEFAULT '0.000000', `quantity` int(10) NOT NULL DEFAULT '0', `minimal_quantity` int(10) unsigned NOT NULL DEFAULT '1', `price` decimal(20,6) NOT NULL DEFAULT '0.000000', `wholesale_price` decimal(20,6) NOT NULL DEFAULT '0.000000', `unity` varchar(255) DEFAULT NULL, `unit_price_ratio` decimal(20,6) NOT NULL DEFAULT '0.000000', `additional_shipping_cost` decimal(20,2) NOT NULL DEFAULT '0.00', `reference` varchar(32) DEFAULT NULL, `supplier_reference` varchar(32) DEFAULT NULL, `location` varchar(64) DEFAULT NULL, `width` decimal(20,6) NOT NULL DEFAULT '0.000000', `height` decimal(20,6) NOT NULL DEFAULT '0.000000', `depth` decimal(20,6) NOT NULL DEFAULT '0.000000', `weight` decimal(20,6) NOT NULL DEFAULT '0.000000', `out_of_stock` int(10) unsigned NOT NULL DEFAULT '2', `quantity_discount` tinyint(1) DEFAULT '0', `customizable` tinyint(2) NOT NULL DEFAULT '0', `uploadable_files` tinyint(4) NOT NULL DEFAULT '0', `text_fields` tinyint(4) NOT NULL DEFAULT '0', `active` tinyint(1) unsigned NOT NULL DEFAULT '0', `redirect_type` enum('','404','301','302') NOT NULL DEFAULT '', `id_product_redirected` int(10) unsigned NOT NULL DEFAULT '0', `available_for_order` tinyint(1) NOT NULL DEFAULT '1', `available_date` date NOT NULL, `condition` enum('new','used','refurbished') NOT NULL DEFAULT 'new', `show_price` tinyint(1) NOT NULL DEFAULT '1', `indexed` tinyint(1) NOT NULL DEFAULT '0', `visibility` enum('both','catalog','search','none') NOT NULL DEFAULT 'both', `cache_is_pack` tinyint(1) NOT NULL DEFAULT '0', `cache_has_attachments` tinyint(1) NOT NULL DEFAULT '0', `is_virtual` tinyint(1) NOT NULL DEFAULT '0', `cache_default_attribute` int(10) unsigned DEFAULT NULL, `date_add` datetime NOT NULL, `date_upd` datetime NOT NULL, `advanced_stock_management` tinyint(1) NOT NULL DEFAULT '0', Link to comment Share on other sites More sharing options...
ps3z Posted October 28, 2013 Author Share Posted October 28, 2013 Hi ps3z, can you try something for me? 1) Backup file classes/ProductSale.php 2) Edit the file, and find the function : public static function getBestSales(...) 3) scroll down until you see: GROUP BY product_shop.id_product ORDER BY `'.pSQL($order_by).'` '.pSQL($order_way).' LIMIT '.(int)($page_number * $nb_products).', '.(int)$nb_products; then do this: GROUP BY product_shop.id_product ORDER BY `'.pSQL($order_by).'` '.pSQL($order_way).' <- take this line out LIMIT '.(int)($page_number * $nb_products).', '.(int)$nb_products; Why I try this: The error message you gave us complains about an ambiguous field date_add (as there is a field date_add in both ps_product and ps_product_shop ). This field is used for ordering the list, therefore if we take out the order by clause from the SQL query, this may 'solve' it. We may need to fix it differently when this indeed solves the problem of not showing the products. We may just have to add the p.date_add in the order field to really fix it correctly. But let's first see if this solves the initial problem. pascal. ok ill try now Link to comment Share on other sites More sharing options...
ps3z Posted October 28, 2013 Author Share Posted October 28, 2013 (edited) Hi ps3z, can you try something for me? 1) Backup file classes/ProductSale.php 2) Edit the file, and find the function : public static function getBestSales(...) 3) scroll down until you see: GROUP BY product_shop.id_product ORDER BY `'.pSQL($order_by).'` '.pSQL($order_way).' LIMIT '.(int)($page_number * $nb_products).', '.(int)$nb_products; then do this: GROUP BY product_shop.id_product ORDER BY `'.pSQL($order_by).'` '.pSQL($order_way).' <- take this line out LIMIT '.(int)($page_number * $nb_products).', '.(int)$nb_products; Why I try this: The error message you gave us complains about an ambiguous field date_add (as there is a field date_add in both ps_product and ps_product_shop ). This field is used for ordering the list, therefore if we take out the order by clause from the SQL query, this may 'solve' it. We may need to fix it differently when this indeed solves the problem of not showing the products. We may just have to add the p.date_add in the order field to really fix it correctly. But let's first see if this solves the initial problem. pascal. Hey you solved it. remained to do anything? Many thanks Edited October 28, 2013 by ps3z (see edit history) Link to comment Share on other sites More sharing options...
PascalVG Posted October 28, 2013 Share Posted October 28, 2013 Hi ps3z, Glad it worked! What you can do is try if the 1.5.6.0 version of the function works (I'll copy it here. Paste it by replacing the whole function in the file we just edited) I just noticed that they did try to fix it there already. If that doesn't work, I'm not sure if you care about the order of your list, but you can quickly/for now fix it by just adding ORDER BY p.`date_add` it then just always orders by date, instead of all kind of order options that can be set. function from 1.5.6.1: /* ** Get required informations on best sales products ** ** @param integer $id_lang Language id ** @param integer $page_number Start from (optional) ** @param integer $nb_products Number of products to return (optional) ** @return array from Product::getProductProperties */ public static function getBestSales($id_lang, $page_number = 0, $nb_products = 10, $order_by = null, $order_way = null) { if ($page_number < 0) $page_number = 0; if ($nb_products < 1) $nb_products = 10; $final_order_by = $order_by; $order_table = ''; if (is_null($order_by) || $order_by == 'position' || $order_by == 'price') $order_by = 'sales'; if ($order_by == 'date_add' || $order_by == 'date_upd') $order_table = 'product_shop'; if (is_null($order_way) || $order_by == 'sales') $order_way = 'DESC'; $groups = FrontController::getCurrentCustomerGroups(); $sql_groups = (count($groups) ? 'IN ('.implode(',', $groups).')' : '= 1'); $interval = Validate::isUnsignedInt(Configuration::get('PS_NB_DAYS_NEW_PRODUCT')) ? Configuration::get('PS_NB_DAYS_NEW_PRODUCT') : 20; $prefix = ''; if ($order_by == 'date_add') $prefix = 'p.'; $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`, m.`name` AS manufacturer_name, p.`id_manufacturer` as id_manufacturer, MAX(image_shop.`id_image`) id_image, il.`legend`, ps.`quantity` AS sales, t.`rate`, pl.`meta_keywords`, pl.`meta_title`, pl.`meta_description`, DATEDIFF(p.`date_add`, DATE_SUB(NOW(), INTERVAL '.$interval.' DAY)) > 0 AS new FROM `'._DB_PREFIX_.'product_sale` ps LEFT JOIN `'._DB_PREFIX_.'product` p ON ps.`id_product` = p.`id_product` '.Shop::addSqlAssociation('product', 'p', false).' LEFT JOIN `'._DB_PREFIX_.'product_lang` pl ON p.`id_product` = pl.`id_product` AND pl.`id_lang` = '.(int)$id_lang.Shop::addSqlRestrictionOnLang('pl').' 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 (i.`id_image` = il.`id_image` AND il.`id_lang` = '.(int)$id_lang.') LEFT JOIN `'._DB_PREFIX_.'manufacturer` m ON (m.`id_manufacturer` = p.`id_manufacturer`) LEFT JOIN `'._DB_PREFIX_.'tax_rule` tr ON (product_shop.`id_tax_rules_group` = tr.`id_tax_rules_group`) AND tr.`id_country` = '.(int)Context::getContext()->country->id.' AND tr.`id_state` = 0 LEFT JOIN `'._DB_PREFIX_.'tax` t ON (t.`id_tax` = tr.`id_tax`) '.Product::sqlStock('p').' WHERE product_shop.`active` = 1 AND product_shop.`visibility` != \'none\' 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` '.$sql_groups.' ) GROUP BY product_shop.id_product ORDER BY '.(!empty($order_table) ? '`'.pSQL($order_table).'`.' : '').'`'.pSQL($order_by).'` '.pSQL($order_way).' LIMIT '.(int)($page_number * $nb_products).', '.(int)$nb_products; $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($sql); if ($final_order_by == 'price') Tools::orderbyPrice($result, $order_way); if (!$result) return false; return Product::getProductsProperties($id_lang, $result); } Just copy the whole function, delete the function in the file we just edited and replace with above one. save and see if it works. if not, copy the original backed up file over the one we just changed (Still keep a backup of the original one!) and either change the function by deleting the ORDER BY line entirely , or change it by the suggested ORDER BY p.`date_add` line Hope that's it! pascal Link to comment Share on other sites More sharing options...
ps3z Posted October 28, 2013 Author Share Posted October 28, 2013 Hi ps3z, Glad it worked! What you can do is try if the 1.5.6.0 version of the function works (I'll copy it here. Paste it by replacing the whole function in the file we just edited) I just noticed that they did try to fix it there already. If that doesn't work, I'm not sure if you care about the order of your list, but you can quickly/for now fix it by just adding ORDER BY p.`date_add` it then just always orders by date, instead of all kind of order options that can be set. function from 1.5.6.1: /* ** Get required informations on best sales products ** ** @param integer $id_lang Language id ** @param integer $page_number Start from (optional) ** @param integer $nb_products Number of products to return (optional) ** @return array from Product::getProductProperties */ public static function getBestSales($id_lang, $page_number = 0, $nb_products = 10, $order_by = null, $order_way = null) { if ($page_number < 0) $page_number = 0; if ($nb_products < 1) $nb_products = 10; $final_order_by = $order_by; $order_table = ''; if (is_null($order_by) || $order_by == 'position' || $order_by == 'price') $order_by = 'sales'; if ($order_by == 'date_add' || $order_by == 'date_upd') $order_table = 'product_shop'; if (is_null($order_way) || $order_by == 'sales') $order_way = 'DESC'; $groups = FrontController::getCurrentCustomerGroups(); $sql_groups = (count($groups) ? 'IN ('.implode(',', $groups).')' : '= 1'); $interval = Validate::isUnsignedInt(Configuration::get('PS_NB_DAYS_NEW_PRODUCT')) ? Configuration::get('PS_NB_DAYS_NEW_PRODUCT') : 20; $prefix = ''; if ($order_by == 'date_add') $prefix = 'p.'; $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`, m.`name` AS manufacturer_name, p.`id_manufacturer` as id_manufacturer, MAX(image_shop.`id_image`) id_image, il.`legend`, ps.`quantity` AS sales, t.`rate`, pl.`meta_keywords`, pl.`meta_title`, pl.`meta_description`, DATEDIFF(p.`date_add`, DATE_SUB(NOW(), INTERVAL '.$interval.' DAY)) > 0 AS new FROM `'._DB_PREFIX_.'product_sale` ps LEFT JOIN `'._DB_PREFIX_.'product` p ON ps.`id_product` = p.`id_product` '.Shop::addSqlAssociation('product', 'p', false).' LEFT JOIN `'._DB_PREFIX_.'product_lang` pl ON p.`id_product` = pl.`id_product` AND pl.`id_lang` = '.(int)$id_lang.Shop::addSqlRestrictionOnLang('pl').' 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 (i.`id_image` = il.`id_image` AND il.`id_lang` = '.(int)$id_lang.') LEFT JOIN `'._DB_PREFIX_.'manufacturer` m ON (m.`id_manufacturer` = p.`id_manufacturer`) LEFT JOIN `'._DB_PREFIX_.'tax_rule` tr ON (product_shop.`id_tax_rules_group` = tr.`id_tax_rules_group`) AND tr.`id_country` = '.(int)Context::getContext()->country->id.' AND tr.`id_state` = 0 LEFT JOIN `'._DB_PREFIX_.'tax` t ON (t.`id_tax` = tr.`id_tax`) '.Product::sqlStock('p').' WHERE product_shop.`active` = 1 AND product_shop.`visibility` != \'none\' 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` '.$sql_groups.' ) GROUP BY product_shop.id_product ORDER BY '.(!empty($order_table) ? '`'.pSQL($order_table).'`.' : '').'`'.pSQL($order_by).'` '.pSQL($order_way).' LIMIT '.(int)($page_number * $nb_products).', '.(int)$nb_products; $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($sql); if ($final_order_by == 'price') Tools::orderbyPrice($result, $order_way); if (!$result) return false; return Product::getProductsProperties($id_lang, $result); } Just copy the whole function, delete the function in the file we just edited and replace with above one. save and see if it works. if not, copy the original backed up file over the one we just changed (Still keep a backup of the original one!) and either change the function by deleting the ORDER BY line entirely , or change it by the suggested ORDER BY p.`date_add` line Hope that's it! pascal im checking. i think you mean delete all codes inside of productsale.php and replace with yours righ? Link to comment Share on other sites More sharing options...
PascalVG Posted October 28, 2013 Share Posted October 28, 2013 No, only the function we edited Link to comment Share on other sites More sharing options...
ps3z Posted October 28, 2013 Author Share Posted October 28, 2013 (edited) No, only the function we edited i did paste your 1.5.6.1 codes to productsale.php Fatal error: Cannot redeclare ProductSaleCore::getBestSales() in /home/worldbaz/public_html/classes/ProductSale.php on line 127 Edited October 28, 2013 by ps3z (see edit history) Link to comment Share on other sites More sharing options...
PascalVG Posted October 28, 2013 Share Posted October 28, 2013 Probably forgot to delete the old function. Let try this. Replace the whole file contents with this one: <?php /* * 2007-2013 PrestaShop * * NOTICE OF LICENSE * * This source file is subject to the Open Software License (OSL 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/osl-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-2013 PrestaShop SA * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) * International Registered Trademark & Property of PrestaShop SA */ class ProductSaleCore { /* ** Fill the `product_sale` SQL table with data from `order_detail` ** @return bool True on success */ public static function fillProductSales() { $sql = 'REPLACE INTO '._DB_PREFIX_.'product_sale (`id_product`, `quantity`, `sale_nbr`, `date_upd`) SELECT od.product_id, COUNT(od.product_id), SUM(od.product_quantity), NOW() FROM '._DB_PREFIX_.'order_detail od GROUP BY od.product_id'; return Db::getInstance()->execute($sql); } /* ** Get number of actives products sold ** @return int number of actives products listed in product_sales */ public static function getNbSales() { $sql = 'SELECT COUNT(ps.`id_product`) AS nb FROM `'._DB_PREFIX_.'product_sale` ps LEFT JOIN `'._DB_PREFIX_.'product` p ON p.`id_product` = ps.`id_product` '.Shop::addSqlAssociation('product', 'p', false).' WHERE product_shop.`active` = 1'; return (int)Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue($sql); } /* ** Get required informations on best sales products ** ** @param integer $id_lang Language id ** @param integer $page_number Start from (optional) ** @param integer $nb_products Number of products to return (optional) ** @return array from Product::getProductProperties */ public static function getBestSales($id_lang, $page_number = 0, $nb_products = 10, $order_by = null, $order_way = null) { if ($page_number < 0) $page_number = 0; if ($nb_products < 1) $nb_products = 10; $final_order_by = $order_by; $order_table = ''; if (is_null($order_by) || $order_by == 'position' || $order_by == 'price') $order_by = 'sales'; if ($order_by == 'date_add' || $order_by == 'date_upd') $order_table = 'product_shop'; if (is_null($order_way) || $order_by == 'sales') $order_way = 'DESC'; $groups = FrontController::getCurrentCustomerGroups(); $sql_groups = (count($groups) ? 'IN ('.implode(',', $groups).')' : '= 1'); $interval = Validate::isUnsignedInt(Configuration::get('PS_NB_DAYS_NEW_PRODUCT')) ? Configuration::get('PS_NB_DAYS_NEW_PRODUCT') : 20; $prefix = ''; if ($order_by == 'date_add') $prefix = 'p.'; $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`, m.`name` AS manufacturer_name, p.`id_manufacturer` as id_manufacturer, MAX(image_shop.`id_image`) id_image, il.`legend`, ps.`quantity` AS sales, t.`rate`, pl.`meta_keywords`, pl.`meta_title`, pl.`meta_description`, DATEDIFF(p.`date_add`, DATE_SUB(NOW(), INTERVAL '.$interval.' DAY)) > 0 AS new FROM `'._DB_PREFIX_.'product_sale` ps LEFT JOIN `'._DB_PREFIX_.'product` p ON ps.`id_product` = p.`id_product` '.Shop::addSqlAssociation('product', 'p', false).' LEFT JOIN `'._DB_PREFIX_.'product_lang` pl ON p.`id_product` = pl.`id_product` AND pl.`id_lang` = '.(int)$id_lang.Shop::addSqlRestrictionOnLang('pl').' 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 (i.`id_image` = il.`id_image` AND il.`id_lang` = '.(int)$id_lang.') LEFT JOIN `'._DB_PREFIX_.'manufacturer` m ON (m.`id_manufacturer` = p.`id_manufacturer`) LEFT JOIN `'._DB_PREFIX_.'tax_rule` tr ON (product_shop.`id_tax_rules_group` = tr.`id_tax_rules_group`) AND tr.`id_country` = '.(int)Context::getContext()->country->id.' AND tr.`id_state` = 0 LEFT JOIN `'._DB_PREFIX_.'tax` t ON (t.`id_tax` = tr.`id_tax`) '.Product::sqlStock('p').' WHERE product_shop.`active` = 1 AND product_shop.`visibility` != \'none\' 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` '.$sql_groups.' ) GROUP BY product_shop.id_product ORDER BY '.(!empty($order_table) ? '`'.pSQL($order_table).'`.' : '').'`'.pSQL($order_by).'` '.pSQL($order_way).' LIMIT '.(int)($page_number * $nb_products).', '.(int)$nb_products; $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($sql); if ($final_order_by == 'price') Tools::orderbyPrice($result, $order_way); if (!$result) return false; return Product::getProductsProperties($id_lang, $result); } /* ** Get required informations on best sales products ** ** @param integer $id_lang Language id ** @param integer $page_number Start from (optional) ** @param integer $nb_products Number of products to return (optional) ** @return array keys : id_product, link_rewrite, name, id_image, legend, sales, ean13, upc, link */ public static function getBestSalesLight($id_lang, $page_number = 0, $nb_products = 10, Context $context = null) { if (!$context) $context = Context::getContext(); if ($page_number < 0) $page_number = 0; if ($nb_products < 1) $nb_products = 10; $groups = FrontController::getCurrentCustomerGroups(); $sql_groups = (count($groups) ? 'IN ('.implode(',', $groups).')' : '= 1'); $sql = 'SELECT p.id_product, pl.`link_rewrite`, pl.`name`, pl.`description_short`, MAX(image_shop.`id_image`) id_image, il.`legend`, ps.`quantity` AS sales, p.`ean13`, p.`upc`, cl.`link_rewrite` AS category, ps.`date_upd` FROM `'._DB_PREFIX_.'product_sale` ps LEFT JOIN `'._DB_PREFIX_.'product` p ON ps.`id_product` = p.`id_product` '.Shop::addSqlAssociation('product', 'p').' LEFT JOIN `'._DB_PREFIX_.'product_lang` pl ON p.`id_product` = pl.`id_product` AND pl.`id_lang` = '.(int)$id_lang.Shop::addSqlRestrictionOnLang('pl').' 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 (i.`id_image` = il.`id_image` AND il.`id_lang` = '.(int)$id_lang.') LEFT JOIN `'._DB_PREFIX_.'category_lang` cl ON cl.`id_category` = product_shop.`id_category_default` AND cl.`id_lang` = '.(int)$id_lang.Shop::addSqlRestrictionOnLang('cl').' WHERE product_shop.`active` = 1 AND p.`visibility` != \'none\' 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` '.$sql_groups.' ) GROUP BY product_shop.id_product ORDER BY ps.`date_upd` DESC LIMIT '.(int)($page_number * $nb_products).', '.(int)$nb_products; if (!$result = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($sql)) return false; foreach ($result as &$row) { $row['link'] = $context->link->getProductLink($row['id_product'], $row['link_rewrite'], $row['category'], $row['ean13']); $row['id_image'] = Product::defineProductImage($row, $id_lang); } return $result; } public static function addProductSale($product_id, $qty = 1) { return Db::getInstance()->execute(' INSERT INTO '._DB_PREFIX_.'product_sale (`id_product`, `quantity`, `sale_nbr`, `date_upd`) VALUES ('.(int)$product_id.', '.(int)$qty.', 1, NOW()) ON DUPLICATE KEY UPDATE `quantity` = `quantity` + '.(int)$qty.', `sale_nbr` = `sale_nbr` + 1, `date_upd` = NOW()'); } public static function getNbrSales($id_product) { $result = Db::getInstance()->getRow('SELECT `sale_nbr` FROM '._DB_PREFIX_.'product_sale WHERE `id_product` = '.(int)$id_product); if (!$result || empty($result) || !key_exists('sale_nbr', $result)) return -1; return (int)$result['sale_nbr']; } public static function removeProductSale($id_product, $qty = 1) { $total_sales = ProductSale::getNbrSales($id_product); if ($total_sales > 1) return Db::getInstance()->execute(' UPDATE '._DB_PREFIX_.'product_sale SET `quantity` = `quantity` - '.(int)$qty.', `sale_nbr` = `sale_nbr` - 1, `date_upd` = NOW() WHERE `id_product` = '.(int)$id_product ); elseif ($total_sales == 1) return Db::getInstance()->delete('product_sale', 'id_product = '.(int)$id_product); return true; } } 1 Link to comment Share on other sites More sharing options...
ps3z Posted October 28, 2013 Author Share Posted October 28, 2013 (edited) Probably forgot to delete the old function. Let try this. Replace the whole file contents with this one: <?php /* * 2007-2013 PrestaShop * * NOTICE OF LICENSE * * This source file is subject to the Open Software License (OSL 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/osl-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-2013 PrestaShop SA * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) * International Registered Trademark & Property of PrestaShop SA */ class ProductSaleCore { /* ** Fill the `product_sale` SQL table with data from `order_detail` ** @return bool True on success */ public static function fillProductSales() { $sql = 'REPLACE INTO '._DB_PREFIX_.'product_sale (`id_product`, `quantity`, `sale_nbr`, `date_upd`) SELECT od.product_id, COUNT(od.product_id), SUM(od.product_quantity), NOW() FROM '._DB_PREFIX_.'order_detail od GROUP BY od.product_id'; return Db::getInstance()->execute($sql); } /* ** Get number of actives products sold ** @return int number of actives products listed in product_sales */ public static function getNbSales() { $sql = 'SELECT COUNT(ps.`id_product`) AS nb FROM `'._DB_PREFIX_.'product_sale` ps LEFT JOIN `'._DB_PREFIX_.'product` p ON p.`id_product` = ps.`id_product` '.Shop::addSqlAssociation('product', 'p', false).' WHERE product_shop.`active` = 1'; return (int)Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue($sql); } /* ** Get required informations on best sales products ** ** @param integer $id_lang Language id ** @param integer $page_number Start from (optional) ** @param integer $nb_products Number of products to return (optional) ** @return array from Product::getProductProperties */ public static function getBestSales($id_lang, $page_number = 0, $nb_products = 10, $order_by = null, $order_way = null) { if ($page_number < 0) $page_number = 0; if ($nb_products < 1) $nb_products = 10; $final_order_by = $order_by; $order_table = ''; if (is_null($order_by) || $order_by == 'position' || $order_by == 'price') $order_by = 'sales'; if ($order_by == 'date_add' || $order_by == 'date_upd') $order_table = 'product_shop'; if (is_null($order_way) || $order_by == 'sales') $order_way = 'DESC'; $groups = FrontController::getCurrentCustomerGroups(); $sql_groups = (count($groups) ? 'IN ('.implode(',', $groups).')' : '= 1'); $interval = Validate::isUnsignedInt(Configuration::get('PS_NB_DAYS_NEW_PRODUCT')) ? Configuration::get('PS_NB_DAYS_NEW_PRODUCT') : 20; $prefix = ''; if ($order_by == 'date_add') $prefix = 'p.'; $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`, m.`name` AS manufacturer_name, p.`id_manufacturer` as id_manufacturer, MAX(image_shop.`id_image`) id_image, il.`legend`, ps.`quantity` AS sales, t.`rate`, pl.`meta_keywords`, pl.`meta_title`, pl.`meta_description`, DATEDIFF(p.`date_add`, DATE_SUB(NOW(), INTERVAL '.$interval.' DAY)) > 0 AS new FROM `'._DB_PREFIX_.'product_sale` ps LEFT JOIN `'._DB_PREFIX_.'product` p ON ps.`id_product` = p.`id_product` '.Shop::addSqlAssociation('product', 'p', false).' LEFT JOIN `'._DB_PREFIX_.'product_lang` pl ON p.`id_product` = pl.`id_product` AND pl.`id_lang` = '.(int)$id_lang.Shop::addSqlRestrictionOnLang('pl').' 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 (i.`id_image` = il.`id_image` AND il.`id_lang` = '.(int)$id_lang.') LEFT JOIN `'._DB_PREFIX_.'manufacturer` m ON (m.`id_manufacturer` = p.`id_manufacturer`) LEFT JOIN `'._DB_PREFIX_.'tax_rule` tr ON (product_shop.`id_tax_rules_group` = tr.`id_tax_rules_group`) AND tr.`id_country` = '.(int)Context::getContext()->country->id.' AND tr.`id_state` = 0 LEFT JOIN `'._DB_PREFIX_.'tax` t ON (t.`id_tax` = tr.`id_tax`) '.Product::sqlStock('p').' WHERE product_shop.`active` = 1 AND product_shop.`visibility` != \'none\' 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` '.$sql_groups.' ) GROUP BY product_shop.id_product ORDER BY '.(!empty($order_table) ? '`'.pSQL($order_table).'`.' : '').'`'.pSQL($order_by).'` '.pSQL($order_way).' LIMIT '.(int)($page_number * $nb_products).', '.(int)$nb_products; $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($sql); if ($final_order_by == 'price') Tools::orderbyPrice($result, $order_way); if (!$result) return false; return Product::getProductsProperties($id_lang, $result); } /* ** Get required informations on best sales products ** ** @param integer $id_lang Language id ** @param integer $page_number Start from (optional) ** @param integer $nb_products Number of products to return (optional) ** @return array keys : id_product, link_rewrite, name, id_image, legend, sales, ean13, upc, link */ public static function getBestSalesLight($id_lang, $page_number = 0, $nb_products = 10, Context $context = null) { if (!$context) $context = Context::getContext(); if ($page_number < 0) $page_number = 0; if ($nb_products < 1) $nb_products = 10; $groups = FrontController::getCurrentCustomerGroups(); $sql_groups = (count($groups) ? 'IN ('.implode(',', $groups).')' : '= 1'); $sql = 'SELECT p.id_product, pl.`link_rewrite`, pl.`name`, pl.`description_short`, MAX(image_shop.`id_image`) id_image, il.`legend`, ps.`quantity` AS sales, p.`ean13`, p.`upc`, cl.`link_rewrite` AS category, ps.`date_upd` FROM `'._DB_PREFIX_.'product_sale` ps LEFT JOIN `'._DB_PREFIX_.'product` p ON ps.`id_product` = p.`id_product` '.Shop::addSqlAssociation('product', 'p').' LEFT JOIN `'._DB_PREFIX_.'product_lang` pl ON p.`id_product` = pl.`id_product` AND pl.`id_lang` = '.(int)$id_lang.Shop::addSqlRestrictionOnLang('pl').' 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 (i.`id_image` = il.`id_image` AND il.`id_lang` = '.(int)$id_lang.') LEFT JOIN `'._DB_PREFIX_.'category_lang` cl ON cl.`id_category` = product_shop.`id_category_default` AND cl.`id_lang` = '.(int)$id_lang.Shop::addSqlRestrictionOnLang('cl').' WHERE product_shop.`active` = 1 AND p.`visibility` != \'none\' 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` '.$sql_groups.' ) GROUP BY product_shop.id_product ORDER BY ps.`date_upd` DESC LIMIT '.(int)($page_number * $nb_products).', '.(int)$nb_products; if (!$result = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($sql)) return false; foreach ($result as &$row) { $row['link'] = $context->link->getProductLink($row['id_product'], $row['link_rewrite'], $row['category'], $row['ean13']); $row['id_image'] = Product::defineProductImage($row, $id_lang); } return $result; } public static function addProductSale($product_id, $qty = 1) { return Db::getInstance()->execute(' INSERT INTO '._DB_PREFIX_.'product_sale (`id_product`, `quantity`, `sale_nbr`, `date_upd`) VALUES ('.(int)$product_id.', '.(int)$qty.', 1, NOW()) ON DUPLICATE KEY UPDATE `quantity` = `quantity` + '.(int)$qty.', `sale_nbr` = `sale_nbr` + 1, `date_upd` = NOW()'); } public static function getNbrSales($id_product) { $result = Db::getInstance()->getRow('SELECT `sale_nbr` FROM '._DB_PREFIX_.'product_sale WHERE `id_product` = '.(int)$id_product); if (!$result || empty($result) || !key_exists('sale_nbr', $result)) return -1; return (int)$result['sale_nbr']; } public static function removeProductSale($id_product, $qty = 1) { $total_sales = ProductSale::getNbrSales($id_product); if ($total_sales > 1) return Db::getInstance()->execute(' UPDATE '._DB_PREFIX_.'product_sale SET `quantity` = `quantity` - '.(int)$qty.', `sale_nbr` = `sale_nbr` - 1, `date_upd` = NOW() WHERE `id_product` = '.(int)$id_product ); elseif ($total_sales == 1) return Db::getInstance()->delete('product_sale', 'id_product = '.(int)$id_product); return true; } } order way been different than block,also its not correct for top seller Edited October 28, 2013 by ps3z (see edit history) Link to comment Share on other sites More sharing options...
PascalVG Posted October 28, 2013 Share Posted October 28, 2013 Not sure if I understand what you mean. The order way of the column block may be different, as the call to the function may be with different parameters. What do you mean with "it's not correct for top seller"?? Link to comment Share on other sites More sharing options...
ps3z Posted October 28, 2013 Author Share Posted October 28, 2013 Not sure if I understand what you mean. The order way of the column block may be different, as the call to the function may be with different parameters. What do you mean with "it's not correct for top seller"?? i mean its not show top seller results. theres have i never sold products http://screencast.com/t/RPnZoJlx Link to comment Share on other sites More sharing options...
PascalVG Posted October 28, 2013 Share Posted October 28, 2013 hmmm, sounds strange, as it takes it's product ID's from the sale table... maybe search your sales table for the product id you didn't think you sold Not sure what to recommend here.. Link to comment Share on other sites More sharing options...
ps3z Posted October 28, 2013 Author Share Posted October 28, 2013 (edited) hmmm, sounds strange, as it takes it's product ID's from the sale table... maybe search your sales table for the product id you didn't think you sold Not sure what to recommend here.. top sellers block shows right , i checked products sorting is added as date Edited October 28, 2013 by ps3z (see edit history) Link to comment Share on other sites More sharing options...
ps3z Posted October 28, 2013 Author Share Posted October 28, 2013 im doing upgrade it for check. but i think i have newsletter module it will not work .bcz developer is too careless for make an update Link to comment Share on other sites More sharing options...
ps3z Posted October 28, 2013 Author Share Posted October 28, 2013 (edited) . Edited October 29, 2013 by ps3z (see edit history) Link to comment Share on other sites More sharing options...
ps3z Posted October 29, 2013 Author Share Posted October 29, 2013 i solved that like this.who will have this problem can fix it easily http://forge.prestashop.com/browse/PSCFV-9039 if you see no top sellers in the page ,you can change options in pagination like at below http://screencast.com/t/gp1RkNjvBd Link to comment Share on other sites More sharing options...
PascalVG Posted October 30, 2013 Share Posted October 30, 2013 To add to this: In 1.5.6 they fixed it a little other way, and actually they used not p. (which is the ps_product table) but ps_product_shop table. if ($order_by == 'date_add' || $order_by == 'date_upd') $order_table = 'product_shop'; and then: ORDER BY '.(!empty($order_table) ? '`'.pSQL($order_table).'`.' : '').'`'.pSQL($order_by).'` '.pSQL($order_way).' the solution above as limited to only `date_add`, not `date_upd` as well, (and they used ps_product, which may or may not be correct, not sure about that) (N.B. some legacy code of the solution given in post #35 is left in 1.5.6.0, where they do fill $prefix with 'p.', but it's never used after that... ) My 2 cents, pascal 1 Link to comment Share on other sites More sharing options...
indus Posted December 2, 2013 Share Posted December 2, 2013 (edited) This is not fixed for me with 1.5.6. I have upgraded from 1.4.11 to 1.5.6 and my top sellers page shows no top sellers. Though there are 4 products in the block itself. Fixed after replacing with the latest github version : https://raw.github.com/PrestaShop/PrestaShop/development/classes/ProductSale.php Edited December 2, 2013 by indus (see edit history) 1 Link to comment Share on other sites More sharing options...
onlinegore Posted December 14, 2013 Share Posted December 14, 2013 (edited) Thanks, Pascal! This helped me get my best sellers page to work! I'm using 1.5.6. and I just copy-pasted the entire piece of code like you adviced. Wow, if only every problem could be fixed with a simple copy-paste action. Edited December 14, 2013 by onlinegore (see edit history) Link to comment Share on other sites More sharing options...
PascalVG Posted December 16, 2013 Share Posted December 16, 2013 ;-) Glad it worked! Link to comment Share on other sites More sharing options...
Arh Posted January 29, 2014 Share Posted January 29, 2014 I have the same problem. Where do I find "products table" ? Link to comment Share on other sites More sharing options...
PascalVG Posted January 31, 2014 Share Posted January 31, 2014 Hi Arh, Tables are part of your database. The tables hold the data you add in Back office and front office, like Products, categories, orders, shipping methods etc. Normally you get to your database by loggin in to your host and use some application like PHPMyAdmin or so, or some other database manager your host provides. Then you need to open your database and open de table needed. However, it's not recommended to hack into your database tables if you're not very sure what you're doing, as the whole system can come to a hold. If you insist doing so, please make sure you have a working database Backup, so you can recover from any mistake... What do you need the products table? What do you want to try to do there? Normally, you don't have to change anything inside the tables directly, only through PrestaShop. If you want to loo at the table info, you can do that here, or use the SQL Manager inside PrestaShop (Advanced Parameters menu) Here you can make a command: Name: products info: request: SELECT * FROM ps_product to get the raw contents of your product table Let me know what info exactly you are looking for, then I can try to help you finding it. pascal. Link to comment Share on other sites More sharing options...
Arh Posted January 31, 2014 Share Posted January 31, 2014 Hi Arh, Tables are part of your database. The tables hold the data you add in Back office and front office, like Products, categories, orders, shipping methods etc. Normally you get to your database by loggin in to your host and use some application like PHPMyAdmin or so, or some other database manager your host provides. Then you need to open your database and open de table needed. However, it's not recommended to hack into your database tables if you're not very sure what you're doing, as the whole system can come to a hold. If you insist doing so, please make sure you have a working database Backup, so you can recover from any mistake... What do you need the products table? What do you want to try to do there? Normally, you don't have to change anything inside the tables directly, only through PrestaShop. If you want to loo at the table info, you can do that here, or use the SQL Manager inside PrestaShop (Advanced Parameters menu) Here you can make a command: Name: products info: request: SELECT * FROM ps_product to get the raw contents of your product table Let me know what info exactly you are looking for, then I can try to help you finding it. pascal. Link to comment Share on other sites More sharing options...
Arh Posted January 31, 2014 Share Posted January 31, 2014 Thank you for your reply. (Version 1561, Norwegian edition)I am finishing setting up my webshop. The only thing that is not working properly is the PayPal-module. This is what happens: Internal 500 server error,1. Customer put products in the basket2. Finally they come to PayPal and click "Pay".3. The screen becomes totally white.4. By clicking "Update" in Exploer, the following message appear:INTERNAL 500 SERVER ERROR1. <b>PayPal response:</b>2. CHECKOUTSTATUS -> PaymentActionCompleted3. TIMESTAMP -> 2014-01-30T23:08:52Z4. EMAIL -> [email protected]5. PAYERID -> ME4XNCCDAMKQQ6. PAYERSTATUS -> verified7. BUSINESS -> E-dental8. FIRSTNAME -> Arild Rode9. LASTNAME -> Hansen10. COUNTRYCODE -> NO11. SHIPTONAME -> Arild Hansen12. SHIPTOSTREET -> Øvre Mastemyr 1513. SHIPTOCITY -> Skien14. SHIPTOZIP -> 373615. SHIPTOCOUNTRYCODE -> NO16. SHIPTOCOUNTRYNAME -> Norway17. ADDRESSSTATUS -> Unconfirmed18. CURRENCYCODE -> NOK19. AMT -> 78.0020. ITEMAMT -> 29.0021. SHIPPINGAMT -> 49.0022. HANDLINGAMT -> 0.0023. TAXAMT -> 0.0024. INSURANCEAMT -> 0.0025. SHIPDISCAMT -> 0.0026. L_NAME0 -> Piercing Cube Orange27. L_NUMBER0 -> 11128. L_QTY0 -> 129. L_TAXAMT0 -> 0.0030. L_AMT0 -> 29.0031. L_DESC0 -> Øre, øye, leppe.Tilfredsstiller EU og US kvalitetsstandard.Størrelse: Pin 8x1mm, Kube 3x3x3mm Tot. 1...32. L_ITEMWEIGHTVALUE0 -> 0.0000033. L_ITEMLENGTHVALUE0 -> 0.0000034. L_ITEMWIDTHVALUE0 -> 0.0000035. L_ITEMHEIGHTVALUE0 -> 0.0000036. PAYMENTREQUEST_0_CURRENCYCODE -> NOK37. PAYMENTREQUEST_0_AMT -> 78.0038. PAYMENTREQUEST_0_ITEMAMT -> 29.0039. PAYMENTREQUEST_0_SHIPPINGAMT -> 49.0040. PAYMENTREQUEST_0_HANDLINGAMT -> 0.0041. PAYMENTREQUEST_0_TAXAMT -> 0.0042. PAYMENTREQUEST_0_INSURANCEAMT -> 0.0043. PAYMENTREQUEST_0_SHIPDISCAMT -> 0.0044. PAYMENTREQUEST_0_TRANSACTIONID -> 9VC32234ME358981P45. PAYMENTREQUEST_0_INSURANCEOPTIONOFFERED -> false46. PAYMENTREQUEST_0_SHIPTONAME -> Arild Hansen47. PAYMENTREQUEST_0_SHIPTOSTREET -> Øvre Mastemyr 1548. PAYMENTREQUEST_0_SHIPTOCITY -> Skien49. PAYMENTREQUEST_0_SHIPTOZIP -> 373650. PAYMENTREQUEST_0_SHIPTOCOUNTRYCODE -> NO51. PAYMENTREQUEST_0_SHIPTOCOUNTRYNAME -> Norway52. PAYMENTREQUEST_0_ADDRESSSTATUS -> Unconfirmed53. L_PAYMENTREQUEST_0_NAME0 -> Piercing Cube Orange54. L_PAYMENTREQUEST_0_NUMBER0 -> 11155. L_PAYMENTREQUEST_0_QTY0 -> 156. L_PAYMENTREQUEST_0_TAXAMT0 -> 0.0057. L_PAYMENTREQUEST_0_AMT0 -> 29.0058. L_PAYMENTREQUEST_0_DESC0 -> Øre, øye, leppe.Tilfredsstiller EU og US kvalitetsstandard.Størrelse: Pin 8x1mm, Kube 3x3x3mm Tot. 1...59. L_PAYMENTREQUEST_0_ITEMWEIGHTVALUE0 -> 0.0000060. L_PAYMENTREQUEST_0_ITEMLENGTHVALUE0 -> 0.0000061. L_PAYMENTREQUEST_0_ITEMWIDTHVALUE0 -> 0.0000062. L_PAYMENTREQUEST_0_ITEMHEIGHTVALUE0 -> 0.0000063. PAYMENTREQUESTINFO_0_TRANSACTIONID -> 9VC32234ME358981P64. PAYMENTREQUESTINFO_0_ERRORCODE -> 065. Cart changed since the last checkout express, please make a new Paypal checkout payment66. Your cart is empty.I have spent so many hours with the shop and really need some help with this problem. I appreciate if you have any suggestions ? Link to comment Share on other sites More sharing options...
PascalVG Posted January 31, 2014 Share Posted January 31, 2014 Apparently some error 500 appears. Let's try to turn on debugging to see if you get a more detailed error: www.prestashop.com/forums/topic/224525-how-to-turn-on-error-reporting-for-debug-information/ and let us know if you get more info on the error. pascal. N.B. Apparently, the 500 error empties the basket, so then if you want to pay, it is noticed that the basket has changed and complains when you want to pay (line 65+66): 65. Cart changed since the last checkout express, please make a new Paypal checkout payment66. Your cart is empty. Link to comment Share on other sites More sharing options...
Arh Posted January 31, 2014 Share Posted January 31, 2014 (edited) Yes, I will try to do that. All server configurations seems to be ok. The customer receive email from PayPal, and so do I. That means that the only thing that does not appear is the page that says "Your order on Tiva is complete" ++++ PayPal has also been deleted and re-installed. I will try debugging... Edited January 31, 2014 by Arh (see edit history) Link to comment Share on other sites More sharing options...
Arh Posted January 31, 2014 Share Posted January 31, 2014 I have now seen the error log on the server and there are 2 lines: [Fri Jan 31 15:26:09.166578 2014] [:error] [pid 706730] [client 37.9.53.126:63546] File does not exist: /home/tivano/public_html/admin.php, referer: www.tiva.no [Fri Jan 31 15:26:07.336602 2014] [:error] [pid 705243] [client 37.9.53.126:61813] File does not exist: /home/tivano/public_html/wp-login.php, referer: www.tiva.no Do you know what this means ? Link to comment Share on other sites More sharing options...
PascalVG Posted February 8, 2014 Share Posted February 8, 2014 Hi Ahr, sorry for replying so late. Was sick for a while and busy with some sites. These errors don't seem to have anything to do with the Prestashop error. Seems that you tried to do something with wordpress or so in the afternoon (at 15:35 hours, not in the evening). The Error message should be shown on the screen when turning debug mode on and going through the process of paying using paypal... Let me know how things go. pascal. Link to comment Share on other sites More sharing options...
Arh Posted February 10, 2014 Share Posted February 10, 2014 (edited) I really appreciate your answers to my questions. I am familiar with html, perl and office/access. I am using Paypal and database on 3 other websites. I have little experience with php, but I am learning every day. (I hope). 1. 100% shure that the server configurations are ok, including Mcrypt. 2. Checked the database (on the server), it is not easy, without results. 3. Replaced all other files than the database, and the problems are still there. 4. Not knowing when these thing accured. 5. I have red the error log on the server. Before I rebuilt/shut down/choose other cart/ask for paid help, I want to try one more time. There are 2 misconfigurations: Bestsellers and PayPal. Let me Choose only the Bestsellers. The bestsellers are on the FO (reduced from 5 to 3). When I click "Show all bestsellers", something like "No bestsellers yet (Norwegian: Ingen bestelgere enda)". I read from the error log: PHP Notice: Use of undefined constant _RIJNDAEL_KEY_ - assumed '_RIJNDAEL_KEY_' in /home/tivano/public_html/classes/Cookie.php on line 80 and PHP Notice: Use of undefined constant _RIJNDAEL_IV_ - assumed '_RIJNDAEL_IV_' in /home/tivano/public_html/classes/Cookie.php on line 80 Do you think that it is better to rebuilt the site? Edited February 10, 2014 by Arh (see edit history) Link to comment Share on other sites More sharing options...
Arh Posted February 11, 2014 Share Posted February 11, 2014 1.5.6.1 The problem about Bestsellers is solved. Why ? I am not sure. I have tried allmost everything and finally I did the following: 1. Replaced the hole catalog "Classes". Used the "Classes" from 1.5.6.2. (From 1.5.6.1 didn`t work). 2. Cleared Cache 3. Changed the status for an order. (Changed from Paymant accepted to Delivered). In Bestsalescontroller.php in line 40 I changed the number of "Show all bestsellers" to 8. If anyone is interesred, line 40 now looks like this: 'products' => ProductSale::getBestSales($this->context->language->id, $this->p - 1, 8, $this->orderBy, $this->orderWay), Now I have the PayPal issue to deal with. Maybe it is solved as a result of the above, I don`t know. Link to comment Share on other sites More sharing options...
Arh Posted February 13, 2014 Share Posted February 13, 2014 (edited) The phpinfo.php displayed wrong results. The free modul from Superstar displayed the correct results. Than I understood that I might tell the .htaccess file were to look for my self-made php.ini. I put the suPHP_ConfigPath /home/xxxxxx/ in my .htaccess file and all errors are now gone. Thank you for all tips and ideas. Without this forum thing had been very difficult. Edited February 13, 2014 by Arh (see edit history) Link to comment Share on other sites More sharing options...
temuchin Posted May 29, 2014 Share Posted May 29, 2014 Hi! I have a similar problem in my e-shop. I read the whole topic, but I could not understand a clear recipe, how this problem can be solved. Can anyone write specifically what to do to fix this bug? Thanks Link to comment Share on other sites More sharing options...
Recommended Posts