Save Mapping

Pending

Import WP Addon - WooCommerce Updated 2 weeks ago 16 Replies

Ash asked 3 weeks ago on September 20, 2026 at 11:36 am

Hi,

 

We use the below modifiers given by yourself. But I am trying to change a simple mapping for price but when saving it just reverts back. I did a few tests and removing the following measurement mappings

 

Weight

[iwp_convert_kg_to_g({8})]

 

Length

[iwphd1359_seperate_dimensions(“{9}”, “0”)]

 

Width

[iwphd1359_seperate_dimensions(“{9}”, “1”)]

 

Height

[iwphd1359_seperate_dimensions(“{9}”, “2”)]

 

One removed I can change price mappings and it saves correctly. But then won’t allow me to save the measurement mappings back, saving them wipes them blank. I have always used these but now are causing an issue.

 

// Importwp modifiers

function iwp_generate_image_urls_list($input_string) {

    

    // 1. First, attempt to extract the single URL from the Hyperlink() format.

    $pattern_hyperlink = ‘/Hyperlink\(“([^”]+)”\)/i’;

    

    $url_to_process = $input_string;

    

    if (preg_match($pattern_hyperlink, $input_string, $matches)) {

        // If it matches, use the extracted URL

        $url_to_process = $matches[1];

    }

    // If it doesn’t match, $url_to_process remains the original string (which might be a plain URL).

    

    

    // 2. Now, split the URL into its base path and extension.

    // This regex captures the URL path before the last dot/extension into $matches[1]

    // and the extension into $matches[2].

    $pattern_split_url = ‘/^(.+)\.(jpg|jpeg|png|gif|webp)$/i’;

    

    $base_url = ”;

    $extension = ”;

 

    if (preg_match($pattern_split_url, $url_to_process, $matches)) {

        $base_url = $matches[1]; // e.g., https://…/P100848

        $extension = $matches[2]; // e.g., jpg

    } else {

        // If the URL doesn’t look like a standard image path, return an empty string.

        return ”;

    }

 

    // 3. Generate the array of URLs.

    $urls = [];

 

    // Add the original URL (without any suffix)

    $urls[] = “{$base_url}.{$extension}”;

 

    // Add the URLs with suffixes from _1 to _10

    for ($i = 1; $i <= 10; $i++) {

        $urls[] = “{$base_url}_{$i}.{$extension}”;

    }

 

    // 4. Return the array as a comma-separated string.

    return implode(‘,’, $urls);

}

 

 

function iwp_convert_kg_to_g($weight_kg) {

    // Check if the input is a valid number

    if (!is_numeric($weight_kg)) {

        return $weight_kg; // Return original value if not a number

    }

    // Convert kg to g (multiply by 1000)

    $weight_g = floatval($weight_kg) * 1000;

    return $weight_g;

 

}

 

function iwphd1359_desc_list(…$texts)

{

 

    $output = ”;

 

    $texts = array_values(array_filter(array_map(‘trim’, (array)$texts)));

    if (empty($texts)) {

        return $output;

    }

 

    return ‘<ul><li>’ . implode(‘</li><li>’, $texts) . ‘</li></ul>’;

}

 

 

function split_dimension($value, $part = ‘length’) {

    if (empty($value)) {

        return ”;

    }

 

    // Convert possible weird input types

    if (is_array($value)) {

        $value = reset($value);

    } elseif (is_object($value) && property_exists($value, ‘value’)) {

        $value = $value->value;

    }

 

    // Normalize all separators and spaces

    $value = trim($value);

    $value = str_replace([‘×’, ‘X’, ‘x’, ‘ ‘], ‘x’, $value); // includes non-breaking space

    $value = preg_replace(‘/\s+/’, ”, $value); // remove all whitespace

 

    // Now should look like “9x9x9”

    $parts = explode(‘x’, strtolower($value));

 

    // Safety: make sure we have 3 parts

    $length = isset($parts[0]) ? floatval($parts[0]) : ”;

    $width  = isset($parts[1]) ? floatval($parts[1]) : ”;

    $height = isset($parts[2]) ? floatval($parts[2]) : ”;

 

    switch (strtolower($part)) {

        case ‘width’:

            return $width;

        case ‘height’:

            return $height;

        default:

            return $length;

    }

}

 

function iwphd1359_seperate_dimensions($input = ”, $part = 0)

{

    // Fix: Convert ImportWP preview array into a single text string

    if (is_array($input)) {

        $input = implode(‘ x ‘, $input);

    } elseif (is_object($input) && property_exists($input, ‘value’)) {

        $input = $input->value;

    }

 

    // Split by x / X / unicode ×

    $input = str_replace([‘×’, ‘X’], ‘x’, (string)$input);

    $parts = array_map(‘trim’, explode(‘x’, $input));

 

    return isset($parts[(int)$part]) ? $parts[(int)$part] : ”;

}

/* Increase by 1.00 and round .99 – use [iwp_increase_and_round_price({price_column_name})] */

function iwp_increase_and_round_price($price) {

    $increased_price = floatval($price) + 1.00;

    

    $rounded_price = ceil($increased_price) – 0.01;

    

    return number_format($rounded_price, 2, ‘.’, ”);

}

J

James replied Support Agent

3 weeks ago on September 21, 2026 at 8:19 am

Hi,

Just to check something, is the issue with saving any field on that importer does not get saved? if so this sounds like you need to increase your php max_input_vars on the server?

James

AM

Ash replied

3 weeks ago on September 21, 2026 at 8:26 am

Hi James,

 

No changes will save on that importer with the dimensions mappings there. All my other importers are fine.

max_input_vars is at 10,000 I did test by raising it to 50,000.

 

Thanks

J

James replied Support Agent

3 weeks ago on September 21, 2026 at 8:39 am

Is there any way i can get access to this to see why why it cant save (login or temporary url)?

The only other option would be if you could export and attach your importer settings to this ticket by going to Tools > Import WP > Settings / Tools > Import / Export and select and export your importer as a JSON file. 

 

AM

Ash replied

3 weeks ago on September 21, 2026 at 8:47 am

Please see export attached, thanks

J

James replied Support Agent

3 weeks ago on September 21, 2026 at 9:06 am

Thanks,

Cany ou send me the version numbers of all importwp plugins you have installed and active?

James

AM

Ash replied

3 weeks ago on September 21, 2026 at 9:10 am

Import WP 2.14.24

Woo Addon 2.3.11

Pro 2.11.3

 

Though woocommerce addon shows update. Says it needs an update and shows update sucess but then shows update required straight away.

You have version 2.3.11 installed. Update to v2.3.11. View version v2.3.11 details.

J

James replied Support Agent

3 weeks ago on September 21, 2026 at 1:25 pm

Thank you Ash,

I was able to replicate the issue, this was caused the latest released version of the plugin when trying to allow servers to not be limited by the previously mentioned max_input_vars.

I have attached a new version that is still being tested before release, but it is a minor plugin increase e.g. 2.14 to 2.15, this release has many fixes but i would recommend backing up your database before activating the attached version so that if an issue does occur you can easily recover as recommended before any plugin update.

The main thing to note is custom functions that are using in importers now require a prefix to call them for example you already use

[iwphd1359_seperate_dimensions("{9}", "0")]

this would going forward be changed to have the iwp: prefix of the function e.g. 

[iwp:iwphd1359_seperate_dimensions("{9}", "0")]

There is a migration script that should update to these automatically when you activate and visit the importer page.

This should then fix the issue with saving the data, if you an test this out and let me know how it goes.

Thanks
James

AM

Ash replied

3 weeks ago on September 21, 2026 at 2:15 pm

Thanks James, That's seems to be working fine now!

J

James replied Support Agent

2 weeks ago on September 26, 2026 at 8:27 am

Hi Ash,

I have checked your importer locally with importwp 2.15.1 and the only one that appears broken for me is the product gallery, which is broken because there is no closing ")".

Can you confirm you are on 2.15.1

James

AM

Ash replied

2 weeks ago on September 26, 2026 at 8:35 am

J

James replied Support Agent

2 weeks ago on September 26, 2026 at 8:46 am

Can you take a screenshot of the product name field, and wrap the {1} selector in iwp:strtoupper ,

e.g.

[iwp:strtoupper("{1}")]

and then do it again without the iwp: prefix so i can see if either are working

[strtoupper("{1}")]

Screenshot attached showing both

J

James replied Support Agent

2 weeks ago on September 26, 2026 at 8:57 am

Thanks,

From that i wanted to confirm that the iwp prefix on funtions worked, which is why the [iwp:strtoupper()] worked and set the text to uppercase.

Based on this it suggests that the plugin cant find the custom functions (which is why the screenshot you set still showed the function name instead of running it), can you confirm they still exist and if they were added via a custom plugin or something that it is still active?

AM

Ash replied

2 weeks ago on September 26, 2026 at 9:00 am

Good spot, Really sorry it's me being stupid, I have changed themes and didn't copy functions.php. I have now done and they are working!

J

James replied Support Agent

2 weeks ago on September 26, 2026 at 9:05 am

Glad its working, you had me worried that the update had bricked all importers.

James