• Resolved Tom

    (@atomiktd)


    Hi,

    I have an issue with images update to Woocommerce products.

    1. XML file from URL imported and all products are fine including images,
    2. updated one product price only (it can be anything else) in XML file
    3. run cron (trigger & processing) to import XML

    The result is that the featured image of the updated product is gone and shows up as a gallery image.

    FYI
    When I use Run Import button, everything is fine.

    What should I do?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter Tom

    (@atomiktd)

    additional info…

    I have an option: Set the first image to the Featured Image (_thumbnail_id)

    S E T

    • This reply was modified 3 years, 7 months ago by Tom.
    Plugin Author WP All Import

    (@wpallimport)

    Hi @atomiktd,

    The result is that the featured image of the updated product is gone and shows up as a gallery image. FYI When I use Run Import button, everything is fine.

    This sounds like a conflict. The first thing I’d suggest trying is disabling do_action calls in the import settings, see: https://d.pr/i/c8LRQ.

    If that doesn’t help, you should set up a staging copy of the site and run a full conflict test: https://www.wpallimport.com/documentation/troubleshooting/plugin-theme-conflicts/.

    Please let me know what you find out.

    Thread Starter Tom

    (@atomiktd)

    Thank you for your reply.

    Unfortunately, what you suggested wasn’t the case.

    After a lot of investigations I discovered, that the problem was, that a function I wanted to use to extract image file name from a path, didn’t want to work in “SEO & Advanced options -> Change image file names to”

    [preg_replace("/^.*render\/(.*)\/.*$/", "$1",{imgs[1]/main[1]/@url}, -1)]

    It works like a charm now, when used in a custom function

    function image_name($path, $code) {
    	// extract image name from file path and product code
    	$new_name = $code . "_" . preg_replace("/^.*render\/(.*)\/.*$/", "$1",$path, -1);
    	return $new_name;
    }

    and then a function called in a field

    [image_name({imgs[1]/main[1]/@url}, {attrs[1]/a[3]})]

    I’m not sure if I did everything right before or messed up something.

    At least it works now.

    • This reply was modified 3 years, 5 months ago by Tom.
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Image import issue’ is closed to new replies.