pimcore / ecommerce-framework-bundle

Ecommerce Framework community bundle provides e-commerce functionality such as product listing and filtering, pricing, carts and checkouts for Pimcore.
https://pimcore.com/docs/platform/Ecommerce_Framework/
Other
11 stars 33 forks source link

[Bug]: Pricing Rule Brackets don't work #174

Closed arrabiata-asanz closed 7 months ago

arrabiata-asanz commented 7 months ago

Expected behavior

I can group Pricing Rule Conditions with Brackets and add a preceding operator.

Actual behavior

After saving the Pricing Rule an error is thrown:

Timestamp: Tue Apr 02 2024 15:51:37 GMT+0200 (Central European Summer Time)
Status: 500 | Internal Server Error
URL: /admin/ecommerceframework/pricing/save
Method: PUT
Message: Pimcore\Bundle\EcommerceFrameworkBundle\PricingManager\Condition\Bracket::addCondition(): Argument #2 ($operator) must be of type string, null given, called in /var/www/html/vendor/pimcore/ecommerce-framework-bundle/src/PricingManager/Condition/Bracket.php on line 141

Steps to reproduce

These Conditions are just examples, i tried with other Conditions too and couldn't make them work.

  1. Create a new Pricing Rule
  2. Go to Conditions Tab
  3. Add Voucher Condition with an example voucher
  4. After Voucher add a DateRange Condition, enter values
  5. After DateRange Add CartAmount Condition, enter value
  6. Group DateRange and CartAmount with the big "(" on the left and ")" on the right
  7. Save

In this example i want to match the Voucher and then either DateRange or CartAmount grouped.

in PHP syntax -> Voucher && ( DateRange || CartAmount )

where can i add the && before the Conditions Group ( DateRange || CartAmount )?

image

blankse commented 7 months ago

@arrabiata-asanz I created a PR: https://github.com/pimcore/ecommerce-framework-bundle/pull/175