Jump to content

Some Issues with Cart class and MultiShipping


alain91

Recommended Posts

Prestashop 1.6.1.7

 

    public function setNoMultishipping()
    {
    .../...
        $sql = 'UPDATE `'._DB_PREFIX_.'cart_product`
SET `id_address_delivery` = (
SELECT `id_address_delivery` FROM `'._DB_PREFIX_.'cart`
WHERE `id_cart` = '.(int)$this->id.' AND `id_shop` = '.(int)$this->id_shop.'
)
WHERE `id_cart` = '.(int)$this->id.'
'.(Configuration::get('PS_ALLOW_MULTISHIPPING') ? ' AND `id_shop` = '.(int)$this->id_shop : '');
}
 
1/ I don't understand the relationship between MULTISHIPPING and MULTISHOP in the last statment.
2/ The Update should depend of the PS_ALLOW_MULTISHIPPING: if multishipping is allowed then id-adress-delivery have to be reset with the id-address-delivery of the cart but if not the id-adress-delivery of cart-product have to be reset to 0
 
 

 

Link to comment
Share on other sites

Prestashop 1.6.1.7

 

Cart Class

 

    public function updateAddressId($id_address, $id_address_new)
    {
}
 
1/ This method change either address-delivery and/or address-invoice and I think it could have unexpected effets on those addresses. We would have better to have two methods one for delivery and the other for invoice
 
2/ The method updates address-delivery of cart-product without checking that we have PS_ALLOW_MULTISHIPPING.
 
3/ The method updates address-delivery of customization without checking this feature is activated as setNoMultishipping does.
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...