public function onCreatePropertyCondition(CreatePropertyConditionEvent $event)
    {
        if (!$this->scopeMatcher->currentScopeIsFrontend()) {
            return;
        }

        $meta = $event->getData();

        if ('conditionpropertyvalueis' !== $meta['type']) {
            return;
        }

        $metaModel = $event->getMetaModel();
        $attribute = $metaModel->getAttributeById($meta['attr_id']);
        if (!($attribute instanceof Checkbox)) {
            return;
        }

        if ((bool) $meta['value']) {
            $event->setInstance(new PropertyTrueCondition($attribute->getColName()));
            return;
        }
        $event->setInstance(new PropertyFalseCondition($attribute->getColName()));
    }
public function onCreatePropertyCondition(CreatePropertyConditionEvent $event)
    {
        if (!$this->scopeMatcher->currentScopeIsFrontend()) {
            return;
        }

        $meta = $event->getData();

        if ('conditionpropertyvalueis' !== $meta['type']) {
            return;
        }

        $metaModel = $event->getMetaModel();
        $attribute = $metaModel->getAttributeById($meta['attr_id']);
        if (!($attribute instanceof Checkbox)) {
            return;
        }

        if ((bool) $meta['value']) {
            $event->setInstance(new PropertyTrueCondition($attribute->getColName()));
            return;
        }
        $event->setInstance(new PropertyFalseCondition($attribute->getColName()));
    }
public function onCreatePropertyCondition ( CreatePropertyConditionEvent $ event ) { if ( ! $ this -> scopeMatcher -> currentScopeIsFrontend ( ) ) { return ; } $ meta = $ event -> getData ( ) ; if ( 'conditionpropertyvalueis' !== $ meta [ 'type' ] ) { return ; } $ metaModel = $ event -> getMetaModel ( ) ; $ attribute = $ metaModel -> getAttributeById ( $ meta [ 'attr_id' ] ) ; if ( ! ( $ attribute instanceof Checkbox ) ) { return ; } if ( ( bool ) $ meta [ 'value' ] ) { $ event -> setInstance ( new PropertyTrueCondition ( $ attribute -> getColName ( ) ) ) ; return ; } $ event -> setInstance ( new PropertyFalseCondition ( $ attribute -> getColName ( ) ) ) ; }
Handle the CreatePropertyConditionEvent event.

@param CreatePropertyConditionEvent $event The event.

@return void
Handle the CreatePropertyConditionEvent event .