• Resolved eninunez

    (@eninunez)


    Hello, i have a csv feed with products and i want to compare two values from csv before added to field.
    How can i get in php function the others values from my csv?
    e.g.
    csv
    {undefined1[1]} price 1
    {undefined2[1]} price 2

    <?php
    function my_convert_price($value1){
    $value2='{undefined2[1]}’; ///<— how can i get and read this value
    in function?
    $value1='{undefined1[1]}’;

    if ($value1 – $svalue2 < 0 ){
    return $value1*0.038;
    }}
    ?>

    Thanks you.

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

    (@wpallimport)

    Hi @eninunez,

    How can i get in php function the others values from my csv?

    You can pass both elements to your function like this:

    [my_convert_price({undefined1[1]},{undefined2[1]})]

    Then, you can access the values in the function code like this:

    function my_convert_price( $value1, $value2 ) {
         // Do something with the values.
    }
    Thread Starter eninunez

    (@eninunez)

    Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘wp all import function’ is closed to new replies.