• Resolved Yousystem

    (@yousystem)


    Hi,

    sorry for my bad English.
    I use a Hook Filter to calculate some fields.
    All work ok, but now i want to add Shipping Price to some field, ex: line_total
    Now, I dont fin anithyng to set shipping order.
    Can someone help me?
    Thanks

Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Author algol.plus

    (@algolplus)

    hi

    Do you want to add order shipping cost to each item ?
    You can use $order->get_shipping_total()

    Thread Starter Yousystem

    (@yousystem)

    At the begin i want to try to view a simple data.
    I use this function in custom field and functions.php of my child theme.

    add_filter(‘woe_get_order_product_value_comm_test’, function ($value, $order, $item, $product,$item_meta) {
    $sped1=$order->get_shipping_total();
    return $sped1;
    }, 10, 3);

    Nothing to show only colum blank.
    I use a Pro version of the plugin.
    This is for me the first step for begin a second step and introduce certain calculate.
    Sorry for my bad english

    Thread Starter Yousystem

    (@yousystem)

    I want to extract the same data in ORDER SHIPPING AMOUNT, this field display correct data. But Why i dont extract this data from my code?
    Is importan for me to manipulate this data.
    Thanks.

    Plugin Author algol.plus

    (@algolplus)

    Hello

    have you read https://algolplus.freshdesk.com/support/solutions/articles/25000018287-add-calculated-field-for-product- ?

    Did you add field using key “comm_test” ?

    thanks, Alex

    Thread Starter Yousystem

    (@yousystem)

    Yes.
    I just used this method for other value and all works fine excpet for shipping price.

    Plugin Author algol.plus

    (@algolplus)

    please, attach your settings(.txt file!) as new ticket to https://algolplus.freshdesk.com/

    use tab “Tools” to get them

    Thread Starter Yousystem

    (@yousystem)

    I’ve just solved the problem.

    This is the correct code:

    add_filter(‘woe_get_order_product_value_comm_test’, function ($value, $order, $item, $product,$item_meta) {
    $sped1=$order->get_shipping_total();
    return $sped1;
    }, 10, 5);

    Plugin Author algol.plus

    (@algolplus)

    good news πŸ˜‰

    Thread Starter Yousystem

    (@yousystem)

    Another Question.
    Is possible to import data from another plugin?
    Example:
    I’ve $vendor_shipping_default_price from another plugin, is possibile to import this data in a column?
    Thanks

    Plugin Author algol.plus

    (@algolplus)

    yes.

    If you know which external functions/classes(added by Vendor plugin) you should use.

    or you can just read details directly from database using global object $wpdb

    thanks, Alex

    • This reply was modified 5 years, 7 months ago by algol.plus.
Viewing 10 replies - 1 through 10 (of 10 total)

The topic ‘Hook for extract Shipping Order’ is closed to new replies.