• Resolved proadax

    (@proadax)


    Hello,
    is it possible to set various price ranges (added margins, e.g. 170% to prices), for example:
     0 – 50 PLN – 170%
    – 50 – 200 PLN – 160%
    – 200 – 150%.

    I am asking for information 🙂
    Regards
    Adam

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

    (@wpallimport)

    Hi @proadax

    I am marking this as resolved since I’ve found that we answered this question for you in our other ticket system. For anyone else wondering, the solution was using a PHP function (https://www.wpallimport.com/documentation/developers/custom-code/inline-php/) to calculate the prices. Example function:

    // Based on ranges
    function my_adjust_price( $price ) {
        $adjustment = null;
        if ( $price <= 50 ) {
            $adjustment = 1.70;
        } elseif ( $price > 50 && $price < 200 ) {
            $adjustment = 1.60;
        } elseif ( $price >= 200 ) {
          	$adjustment = 1.50;
        }
        return empty( $adjustment ) ? $price : number_format( $price * $adjustment, 2 );
    }
Viewing 1 replies (of 1 total)

The topic ‘Price ranges’ is closed to new replies.