Home Forums Pre-Sale Import product reviews for Wocommerce image

Import product reviews for Wocommerce image

  • Author
    Posts
  • #186426

    Emre Sarıyıldız
    Participant

    Hello, I’m thinking of getting the paid version of your plugin, but I need to pull the comments in the excel file I have, I use the wpallimport plugin for this process, but I need to pull the pictures from the url and save them into my own website, I need to make a setting related to your plugin in the sample code block, can you help me with this?

    // The custom field used for the gallery.
    $key = ‘reviews-images’;

    Named Key Arrays ([image_id_1 => “image_url_1″]):

    function gallery_id_url($post_id, $att_id, $filepath, $is_keep_existing_images = ”)
    {

    // The custom field used by the gallery.
    $key = ‘_gallery’;

    // The image size to list in the gallery.
    $size = ‘full’;

    // Retrieve the current gallery value.
    $gallery = get_post_meta($post_id, $key, TRUE);

    // If it’s empty declare a new array.
    if (empty($gallery)) {
    $gallery = array();
    }

    // Check if image is already in the gallery.
    if (!isset($gallery[$att_id])) {

    // If not, retrieve the image’s URL.
    $src = wp_get_attachment_image_src($att_id, $size);

    // Add the image ID and URL to our gallery.
    $gallery[$att_id] = $src[0];

    // Save the gallery.
    update_post_meta($post_id, $key, $gallery);

    }
    }

    add_action(‘pmxi_gallery_image’, ‘gallery_id_url’, 10, 4);

You must be logged in to see replies to this topic. Click here to login or register