• Resolved rakapujo2

    (@rakapujo2)


    hello i just try your demo to import the order from woocomerce
    but i need to add some arithmetic function ex. item totoal price – (minus)item cost to get margin, or Anything is can calculate automatically

    i see your feature for custom export field
    but in this case i set like image bellow to get margin = strong> item totoal price – (minus)item cost
    https://ibb.co/tcqfcZJ

    but if i priview the number is not calculating, it just showing
    like image bellow
    https://ibb.co/tHG0rf7

    i dont know php code to much, for that can you help me ?

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

    (@wpallimport)

    Hi @rakapujo2,

    but if i priview the number is not calculating, it just showing like image bellow

    You’d have to use a custom PHP function (see documentation) to do the math instead. Here’s an example function for your use case:

    function my_get_margin( $total, $cost ) {
    	return $total - $cost;
    }

    You would pass the total and cost to the function in a custom export field like so:

    [my_get_margin({Item Total},{Item Cost})]

    Plugin Author WP All Import

    (@wpallimport)

    Hi @rakapujo2,

    I’m marking this thread as resolved since it’s been inactive for quite some time. Please feel free to open up a new topic if you still have questions.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘how to add arithmetic in 2 field’ is closed to new replies.