setRuleId example

$ruleIds = $this->getIds('rule');

        if ($parent->getActionName() !== null) {
            return $this->buildActionSequence($parent);
        }

        $randomRuleId = $this->faker->randomElement($ruleIds);

        $sequence = FlowSequenceEntity::createFrom($parent);
        $sequence->setId(Uuid::randomHex());
        $sequence->setParentId($parent->getId());
        $sequence->setRuleId($randomRuleId);
        $sequence->setPosition($parent->getPosition() + 1);
        $sequence->setTrueCase($trueCase);
        $sequence->assign([
            'actionName' => null,
        ]);

        $this->ids['rule'] = array_filter($ruleIdsfn ($ruleId) => $ruleId !== $randomRuleId);

        return $sequence;
    }

    
$hasRange = true;
            }

            if ($current < $reference) {
                $reference = $current;
                $cheapest = $price;
            }
        }
        // @codeCoverageIgnoreEnd
        $object = new CheapestPrice();
        $object->setRuleId($cheapest['rule_id']);
        $object->setVariantId($cheapest['variant_id']);
        $object->setParentId($cheapest['parent_id']);
        $object->setHasRange($hasRange);
        $object->setPurchase($cheapest['purchase_unit'] ? (float) $cheapest['purchase_unit'] : null);
        $object->setReference($cheapest['reference_unit'] ? (float) $cheapest['reference_unit'] : null);
        $object->setUnitId($cheapest['unit_id'] ?? null);

        $prices = [];

        $blueprint = new Price('', 1, 1, true);

        
foreach ([42, 23, 8, 10, 14] as $price) {
            $priceEntity = new ShippingMethodPriceEntity();
            $priceEntity->setUniqueIdentifier(Uuid::randomHex());
            $priceEntity->setCurrencyPrice(new PriceCollection([
                new Price(
                    Defaults::CURRENCY,
                    $price,
                    $price,
                    false
                ),
            ]));
            $priceEntity->setRuleId(Uuid::randomHex());
            $prices->add($priceEntity);
        }

        $shippingMethod->setPrices($prices);

        $context = $this->createMock(SalesChannelContext::class);
        $context->expects(static::atLeastOnce())->method('getShippingMethod')->willReturn($shippingMethod);
        $lineItem = new LineItem(Uuid::randomHex(), 'product', null, 50);
        $lineItem->setDeliveryInformation(
            new DeliveryInformation(
                50,
                
Home | Imprint | This part of the site doesn't use cookies.