closeout example

static::markTestSkipped('The load method has been deprecated and will be removed in v6.6.0.0');
        }

        $products = (new ProductBuilder($this->ids, 'a.0'))
            ->manufacturer('m1')
            ->name('test')
            ->price(10)
            ->visibility(TestDefaults::SALES_CHANNEL)
            ->configuratorSetting('red', 'color')
            ->configuratorSetting('xl', 'size')
            ->stock(10)
            ->closeout($parentCloseout)
            ->variant(
                (new ProductBuilder($this->ids, 'a.1'))
                    ->visibility($differentChannel ? $this->ids->get('sales-channel') : TestDefaults::SALES_CHANNEL)
                    ->option('red', 'color')
                    ->option('xl', 'size')
                    ->stock($stock)
                    ->closeout($isCloseout)
                    ->add('minPurchase', $minPurchase)
                    ->build()
            )
            ->build();

        
->manufacturer('m1')
            ->name('test')
            ->price(10)
            ->visibility()
            ->configuratorSetting('red', 'color')
            ->configuratorSetting('green', 'color')
            ->configuratorSetting('blue', 'color')
            ->configuratorSetting('l', 'size')
            ->configuratorSetting('xl', 'size')
            ->configuratorSetting('m', 'size')
            ->stock(10)
            ->closeout()
            ->variant(
                (new ProductBuilder($this->ids, 'a.1'))
                    ->option('red', 'color')
                    ->option('xl', 'size')
                    ->stock(0)
                    ->closeout(false)
                    ->build()
            )
            ->variant(
                (new ProductBuilder($this->ids, 'a.2'))
                    ->option('green', 'color')
                    
->prices('rule-a', 220)
                            ->prices('rule-a', 210, 'default', null, 3)
                            ->prices('rule-b', 210)
                            ->prices('rule-b', 200, 'default', null, 3, false, 285)
                            ->build()
                    )
                    ->build(),

                // even not available variants/products should be calculated correctly                 (new ProductBuilder($ids, 'p.14'))
                    ->price(180)
                    ->closeout()
                    ->visibility(TestDefaults::SALES_CHANNEL)
                    ->variant(
                        (new ProductBuilder($ids, 'v.14.1'))
                            ->stock(0)
                            ->build()
                    )
                    ->variant(
                        (new ProductBuilder($ids, 'v.14.2'))
                            ->price(181)
                            ->stock(2)
                            ->build()
                    )
Home | Imprint | This part of the site doesn't use cookies.