yii2-shopping-cart icon indicating copy to clipboard operation
yii2-shopping-cart copied to clipboard

Add product to the cart that has multiple prices

Open ArtMin96 opened this issue 2 years ago • 0 comments

Hi. Thanks for the package.

Can you please suggest how I can add the product to the cart that has 3 types of the price? I know that this code is responsible for implementing it.

// app\models\ProductCartPosition.php

class ProductCartPosition extends Object implements CartPositionInterface
{
    public $id;
    public $price;
    public $color;

    //...
    public function getId()
    {
        return md5(serialize([$this->id, $this->price, $this->color]));
    }

    //...
}

But I really can not understand the continuation, because it is not written in the documentation. How can I get this done? I saw that several people asked the same question but did not receive an exact answer.

ArtMin96 avatar Feb 03 '22 18:02 ArtMin96