• Resolved iantomarcello

    (@iantomarcello)


    Hey there.

    First of all, lovely plugin, thanks for making this available for all of us.

    Having an issue with Conditional Expression:
    After setting up the logic, at the frontend (customer) side, the total can’t be calculated and got ExpressionParser: Prepared expression has incorrect type. instead.

    Here’s the logic:
    if {width} * {height} > 1000 = {width} * {height} * {product_price} * 0.5
    else {width} * {height} * {product_price}

    Where width and height are Number Field type.

    Whereas using Single Line Formula with {width} * {height} * {product_price} works.

    Here’s debug.log:

    width = 1
    height = 2
    product_price = 2
    product_weight = 
    product_width = 
    product_height = 
    product_length = 
    product_regular_price = 2
    is_user_logged = 1
    quantity = 1
    PHP Warning:  Array to string conversion in path\to\my\weird\wordpress\wp-content\plugins\wc-kalkulator\src\ExpressionParser.php on line 96

    Using version 1.3.2

Viewing 1 replies (of 1 total)
  • Plugin Author Krzysztof Piątkowski

    (@wckalkulator)

    Hi, Thanks for reporting that issue. It’s problem with str_replace on array. It works on PHP7.4, but throws an error in PHP8. I will fix that in a short time.

Viewing 1 replies (of 1 total)

The topic ‘Conditional Expression – ExpressionParser error’ is closed to new replies.