Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Product customization - delete from cart issue #1191

Closed
getdatakick opened this issue May 19, 2020 · 1 comment
Closed

Product customization - delete from cart issue #1191

getdatakick opened this issue May 19, 2020 · 1 comment
Labels

Comments

@getdatakick
Copy link
Contributor

When cart contains several versions of customizable product, then deletion of one version from the cart can deletes other versions as well

Reprosteps:

  1. Create a product with one file field and a text field
  2. in the store go to that product, upload a file, write something and press Save.
  3. Add the product
  4. Keep buying, and then buy the same product, but without any custom field.
  5. go to checkout and try to delete the last item.

Expected result:

The cart should contain product with customization

Actual result

The whole cart becomes empty.

@wartinw
Copy link

wartinw commented May 21, 2020

I was trying to see why happen this bug. I believe it has something to do with:

   protected function processDeleteProductInCart()
    {
        if(isset($this->id_customization)){  
        $customizationProduct = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS(
            (new DbQuery())
                ->select('*')
                ->from('customization')
                ->where('`id_cart` = '.(int) $this->context->cart->id)
                ->where('`id_product` = '.(int) $this->id_product)
                ->where('`id_customization` = '.(int) $this->customization_id)
        );  

Because if there is one entry of that same product with customization but you want to delete the customization-less one it returns one row.

But couldn't fix it :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants