Jump to content

Presta webservice combinations clear product in current customer cart


motabik
 Share

Recommended Posts

I Have litle problem with combinations,  when I using this method with webservice.

Everything working ok, but after update product attribute, all customers who doing shopping in shop lost this product from their carts.

After updating product via combinations, method combinations from webserwice delete this product from carts customer who now doing shopping.

How I can disable this option or how I can update product combination price via webservice, and clients not lost this product from theirs carts.

 

Edited by motabik (see edit history)

Share this post


Link to post
Share on other sites

problem solved
I changed one function in the combinations class.
I replaced it with a file in the overrides directory

class Combination extends CombinationCore
{
    public function deleteAssociations()
    {
        $result = Db::getInstance()->delete('product_attribute_combination', '`id_product_attribute` = '.(int) $this->id);
       // $result &= Db::getInstance()->delete('cart_product', '`id_product_attribute` = '.(int) $this->id);
        $result &= Db::getInstance()->delete('product_attribute_image', '`id_product_attribute` = '.(int) $this->id);

        if ($result) {
            Hook::exec('actionAttributeCombinationDelete', array('id_product_attribute' => (int)$this->id));
        }

        return $result;
    }
    
}

Share this post


Link to post
Share on other sites

  • 4 months later...

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
 Share

×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More