Pricing Customization

Pending

Import WP Updated 2 weeks ago 1 Reply

Saiyed asked 2 weeks ago on May 25, 2025 at 12:08 pm

Hi,
i am importing the product data from a csv file provided by my supplier but I wish to add 20% to the retail price and then reduce 10% how can I do that

J

James replied Support Agent

2 weeks ago on May 27, 2025 at 9:10 pm

Hi Saiyed,

You would first connect the pricing field to your csv/xml file, for this example it would have the selector of {1} in the importer template field.

You would then create a php function on your website: https://www.importwp.com/docs/using-code-snippets-in-wordpress/ with the following code:

function adjustValue($input = 0) {

    $increased = $input * 1.2;  // Adds 20%

    $reduced = $increased * 0.9; // Reduces by 10%

    return $reduced;

}

Then you would replace the original file selector {1} with the following:

[adjustValue("{1}")]

This will then use the function during importing.

James