Jump to content

Recommended Posts

Buenas tardes, entre los muchos fallos que tengo, y los cuales iré poniendo solicitando vuestra ayuda, está éste, entro en productos, filtro por el nombre, poniendo "vestido", ordeno los resultados por cantidad y sale lo siguiente:

 

[PrestaShopDatabaseException]

Column 'quantity' in order clause is ambiguous
 

        SELECT SQL_CALC_FOUND_ROWS
        a.`id_product`,b.name as name,`reference`,a.price as price,a.active as active
        , MAX(i.id_image) id_image,cl.name `name_category` , a.`price`, 0 AS price_final, sav.`quantity` as sav_quantity, a.`active`
        FROM `ps_product` a
        LEFT JOIN `ps_product_lang` b ON (b.`id_product` = a.`id_product` AND b.`id_lang` = 1 AND b.`id_shop` = 1)
        LEFT JOIN `ps_image` i ON (i.`id_product` = a.`id_product` AND i.cover=1)LEFT JOIN `ps_category_lang` cl ON (a.`id_category_default` = cl.`id_category` AND b.`id_lang` = cl.`id_lang` AND cl.id_shop = 1)
        LEFT JOIN `ps_stock_available` sav ON (sav.`id_product` = a.`id_product` AND sav.`id_product_attribute` = 0
         AND sav.id_shop = 1 )
        
        WHERE 1 AND b.`name` LIKE '%vestido%'
        GROUP BY a.id_product
        
        ORDER BY quantity desc LIMIT 300,300

at line 607 in file classes/db/Db.php

 

601.             WebserviceRequest::getInstance()->setError(500, '
 '.$this->getMsgError().'. From '.(isset($dbg[3]['class']) ? $dbg[3]['class'] : '').'->'.$dbg[3]['function'].'() Query was : '.$sql, 97);
602.         }
603.         else if (_PS_DEBUG_SQL_ && $errno && !defined('PS_INSTALLATION_IN_PROGRESS'))
604.         {
605.             if ($sql)
606.                 throw new PrestaShopDatabaseException($this->getMsgError().'<br /><br /><pre>'.$sql.'</pre>');
607.             throw new PrestaShopDatabaseException($this->getMsgError());
608.         }
609.     }
610.
611.     /**
Link to comment
Share on other sites

Una pregunta: ¿Que versión exacta de Prestashop usas?

Buscando en google, tu error, me salen varios posts:

 

http://www.prestashop.com/forums/topic/242458-duplicar-column-quantity-in-order-clause-is-ambiguous/?do=findComment&comment=1261540

http://www.prestashop.com/forums/topic/259752-column-quantity-in-order-clause-is-ambiguous-1541/

http://forge.prestashop.com/browse/PSCFV-9329

 

 

Me da pensar que usas Prestashop 1.5.4.1 (jeje lo digo por el otro error que comentabas en otro tema: http://www.prestashop.com/forums/topic/388286-%C2%BFpor-qu%C3%A9-falla-prestashop-al-actualizar-los-m%C3%B3dulos/ donde indicabas la version de prestashop que usas xD) o alguna version que este cercana la comentada, en el enlace que te he pasado de forgue, prueba lo que dicen en el enlace de foruge de aplicar este parche: 

 

https://github.com/PrestaShop/PrestaShop/commit/a7f6e91ac03baeadeacaeff9d34a57ec1cc6e466

---

 

Tambien he leido algo de limpiar cache...

Edited by galindogadea (see edit history)
  • Like 1
Link to comment
Share on other sites

  • 1 month later...
  • nadie locked this topic
Guest
This topic is now closed to further replies.
×
×
  • Create New...