Answer the question
In order to leave comments, you need to log in
How can I customize the 'sync' method?
I'm trying to use this method to update cart data. Everything would be fine, but the cart table is built in such a way that the product id is repeated, because the product has a color attribute. That is, this option will not work because the id is duplicated.
$arr = ['43'=>[ 'product_quantity'=>'1,'product_color'=>'red'], '43'=>[ 'product_quantity'=>'3,'product_color'=>'green']];
$cart->product()->sync($arr);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question