Viewing 13 replies - 1 through 13 (of 13 total)
  • Plugin Author allaerd

    (@allaerd)

    Can you provide me an example?

    Thread Starter Fahad Mahmood

    (@fahadmahmood)

    I have fixed that issue, in fact you didn’t observe the woocommerce gallery widget behavior. That is picking images from postmeta with key “_product_image_gallery” and values in CSV format. I am not sure that if anyone else imported CSV file which is exported from a joomla’s famous component. In which picture column contains multiple images with “|” pipe sign separator. If you say so i can give you the code correction.

    And one more thing, if you get empty elements in images array then why you iterate them? You should save execution time by filtering those empty elements or just apply a condition there.

    Plugin Author allaerd

    (@allaerd)

    I am always happy when people have good code suggestions! So please yes share them and i’ll review them and put them in the next version!

    Thread Starter Fahad Mahmood

    (@fahadmahmood)

    ok, i share it with exact line no.

    File: woocommerce-csvimport-functions.php
    Line no. 278
    Suggested Change:

    if($image=='')
    			continue;

    Note: It will save iterations.

    Line no. 274
    $attach_ids = array();
    Line no. 312
    $attach_ids[] = $attach_id;

    Line no. 322 (In fact outside the images foreach body)
    wce_gallery_update($post_id, $attach_ids);

    An additional function which will make this plugin work with multiple gallery images

    if(!function_exists('wce_gallery_update')){
    	function wce_gallery_update($post_id, $attach_ids){	
    
    			is_array($attach_ids)?$attach_ids:array();
    
    			if(!empty($attach_ids)){
    
    				$meta_value = implode(',', $attach_ids);
    				update_post_meta($post_id, '_product_image_gallery', $meta_value);
    			}
    		}
    	}
    Thread Starter Fahad Mahmood

    (@fahadmahmood)

    Can you please tell me that what can be the problem if i run import script ONLINE so i face timeout issue although i have set max_execution_time enough in seconds. But when i run this script on localhost(xampp) it works fine but take 1+ days with just 7000+ products.

    Any suggestions?

    Plugin Author allaerd

    (@allaerd)

    I will try out your code, thanks for sharing!

    The time out can be a few things:

    1. max execution time
    2. script execution time
    3. apache response time ( 30 sec…..)
    4. some proxy response time ( i had an nginx proxy causing this problem)

    What you can do to test is set the number of rows to process at the same time to a lower level or even to 1!

    Thread Starter Fahad Mahmood

    (@fahadmahmood)

    i tried with 10 items and it worked but its been crashed on 43rd row
    there are many products with avg. no. of images “3” or even exactly 5

    Plugin Author allaerd

    (@allaerd)

    If you can mail me your CSV file, i would be happy to test it out on my test server!

    Thread Starter Fahad Mahmood

    (@fahadmahmood)

    No problem, i am already running it on my localhost. I agree, server to server execution results will differ, but i am working on another API so meanwhile its importing.
    You know well that developers get relax time only when they are waiting for some delayed output. I am thinking that me should put some eye drops and take some rest ??

    Plugin Author allaerd

    (@allaerd)

    I think your code was for version 0.7.3. I added the gallery feature in 1.0.4. with the help of you function.

    Thanks for the code!

    Thread Starter Fahad Mahmood

    (@fahadmahmood)

    Yes exactly, i got the update notification but didn’t updated because import was still in process.

    How are you?
    I need to import 1,025 single product.
    I have been trying to import a csv file.
    I was sent to the FTP image files.

    As a result, the counts from the wp_posts table,
    product of post_type is 1025,
    but attachment is 185 stored.

    The remaining 840 image is not a link.
    I’ve tried several times, the result is the same.

    Advice please.

    Thank you.

    Oh, I have made a mistake.
    I found out too late.
    The file name and the file does not match.
    You do not need to test.
    Sorry.
    Your program is wonderful.

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘Multiple images are not importing to gallery!’ is closed to new replies.