Jump to content

Bug while adding order


Orinoko

Recommended Posts

Prestashop 1.6.1.2

 

If create order $order->add(); and not specify id_cart or set it to 0, it will delete all rows in ps_specific_price where idcart=0

 

Override:

class SpecificPrice extends SpecificPriceCore
{
    public static function deleteByIdCart($id_cart, $id_product = false, $id_product_attribute = false)
    {
	if(!empty($id_cart)){
	     return Db::getInstance()->execute('
		DELETE FROM `'._DB_PREFIX_.'specific_price`
		WHERE id_cart='.(int)$id_cart.
	            ($id_product ? ' AND id_product='.(int)$id_product.' AND id_product_attribute='.(int)$id_product_attribute : ''));
        }else{
	     return true;
        }
    }
}
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...