• Resolved hody71

    (@hody71)


    Hello,

    I would like to kindly ask you for support. I created condition which should disable one shipping method if purchase is less than 70. It works well but I would like to get this purchase value what I set in the condition. Is it somehow possible to get this value programmatically?

    Thank you in advance.

    Best regards
    Peter

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author WP Trio

    (@wooelements)

    Hi Peter,

    If you want to get that 70 (or whatever you set it to), you first need to find the correct ruleset and after that check it conditions. You can get all rulesets with this function:

    woo_conditional_shipping_get_rulesets

    It will return objects of type Woo_Conditional_Shipping_Ruleset in an array. You can find the correct ruleset by title for example ($ruleset->get_title()). After that you can get conditions like this:

    $ruleset->get_conditions()

    It will return conditions in an array. The value (70) should be found in $condition['value']. You will of course need to check type ($condition['type']) that it is subtotal.

    Hope this gives you some idea how it can be retviered programmatically. Closing this now but please reopen if you have any questions.

    Thread Starter hody71

    (@hody71)

    Hi

    Thank you for your help.
    It is working.

    Best regard
    Peter

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘How to get number from condition programmatically’ is closed to new replies.