sistemeslinux Posted July 28, 2015 Share Posted July 28, 2015 Buenas a todos, Tengo un prestashop en la version 1.6.0.14 y al generar las facturas de los pedidos me las genera correctamente, pero cuando un pedido tiene un bono descuento, al generar la factura me genera una pantalla en blanco y no puedo descargar la factura. Podeis ayudarme? Gracias Link to comment Share on other sites More sharing options...
ventura Posted July 28, 2015 Share Posted July 28, 2015 Activa el modo de visualizacion de errores para ver que te muestra al generar la factura Busca el archivo config/defines.inc.php Y en esta parta cambia el false por true, asi define('_PS_MODE_DEV_', true); 1 Link to comment Share on other sites More sharing options...
sistemeslinux Posted July 28, 2015 Author Share Posted July 28, 2015 Da este error: Fatal error: Call to a member function getOrderTotal() on a non-object in /var/www/vhosts/talaku.es/httpdocs/classes/CartRule.php on line 1050 Link to comment Share on other sites More sharing options...
ventura Posted July 28, 2015 Share Posted July 28, 2015 Segun el error que te aparece en el archivo /classes/CartRule.php de tu instalacion no se realiza correctamente la llamada a una funcion. Has realizado alguna modificacion en dicho archivo¿?, has realizado actualizacion de version de prestashop recientemente ¿? 1 Link to comment Share on other sites More sharing options...
sistemeslinux Posted July 28, 2015 Author Share Posted July 28, 2015 (edited) No, es la plantilla original, sin cambios ni en código, ni en nada... pero lo raro del caso es que no existe ese problema en todas las facturas, solo las que llevan asociado un bono descuento, elk resto de pedidos genera correctamente la factura Edited July 28, 2015 by voodoo_sat (see edit history) Link to comment Share on other sites More sharing options...
ventura Posted July 28, 2015 Share Posted July 28, 2015 No se que version de prestashop tienes instalada, pero si el problema viene de la clase que genera los vales y reglas de compra CartRule.php Prueba a cambiar el archivo CartRule.php que estas utilizando por el original de la version que tengas. https://www.prestashop.com/en/developers-versions Link to comment Share on other sites More sharing options...
sistemeslinux Posted July 28, 2015 Author Share Posted July 28, 2015 Eso he hecho, pero sigue con el mismo problema... Link to comment Share on other sites More sharing options...
ventura Posted July 29, 2015 Share Posted July 29, 2015 (edited) Parece que es un bug de esa version, prueba a actualizar de version de Prestashop o cambia la funcion en el archivo classes/CartRule.php public function getCartAverageVatRate() { $context = Context::getContext(); $cart_amount_ti = $context->cart->getOrderTotal(true, Cart::ONLY_PRODUCTS); $cart_amount_te = $context->cart->getOrderTotal(false, Cart::ONLY_PRODUCTS); $cart_vat_amount = $cart_amount_ti - $cart_amount_te; if ($cart_vat_amount == 0 || $cart_amount_te == 0) $cart_average_vat_rate = 0; else $cart_average_vat_rate = Tools::ps_round($cart_vat_amount / $cart_amount_te, 3); return (float)$cart_average_vat_rate; } Por esta public function getCartAverageVatRate() { //$context = Context::getContext(); $cart=new Cart(Context::getContext()->cart->id); $cart_amount_ti = $cart->getOrderTotal(true, Cart::ONLY_PRODUCTS); $cart_amount_te = $cart->getOrderTotal(false, Cart::ONLY_PRODUCTS); $cart_vat_amount = $cart_amount_ti - $cart_amount_te; if ($cart_vat_amount == 0 || $cart_amount_te == 0) $cart_average_vat_rate = 0; else $cart_average_vat_rate = Tools::ps_round($cart_vat_amount / $cart_amount_te, 3); return (float)$cart_average_vat_rate; } Edited July 29, 2015 by ventura (see edit history) Link to comment Share on other sites More sharing options...
tuk66 Posted August 12, 2015 Share Posted August 12, 2015 Asegúrese de que el archivo /classes/CartRule.php que es correcto, completo y tiene los permisos adecuados. La función getOrderTotal llegó en PrestaShop 1.5 por lo que debería tener. Be sure that the /classes/CartRule.php file is right, complete and has proper permissions. The getOrderTotal function came in PrestaShop 1.5 so you should have it. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now