Home Forums WoodMart support forum The gallery of the variable products I need to appear in the product feed.

The gallery of the variable products I need to appear in the product feed.

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #640895

    informatica-4758
    Participant

    Hello.
    We have a feed provider for the marketplace. Before changing to your theme we had a code put in the funtion.php to show the gallery of the variations of the variable products, now, when changing to your theme we have to change the code, but we don’t know the variables we have to put. I leave you the code that we had put and that no longer serves us, and the one that the feed provider has sent us to modify it .

    /**
    * Añadir imágenes personalizadas a las variaciones en un feed de compras
    *
    * @param array $images Las imágenes de la variación del producto
    * @param WC_Product $wc_product El objeto del producto de WooCommerce
    *
    * @return array
    */
    function custom_variation_images_function($images, $wc_product, $id_variation = 0) {
          
          
          $wc_product_variation = wc_get_product( $id_variation );
          
          $gallery = yith_wccl_get_variation_gallery($wc_product_variation);
          
          foreach ($gallery as $image) {
      $images[] = wp_get_attachment_image_url( $image, ‘full’);
          }
          

    return $images;
    }

    add_filter( ‘shopping_feed_variation_images’, ‘custom_variation_images_function’, 10, 3 );

    This is the code that they give us from shoppingfeed to modify it and to be able to extract the images.

    add_filter( ‘shopping_feed_variation_images’, ‘your_custom_variation_images_function’, 10, 2 );

    /** @return array */
    function your_custom_tracking_url_function($images, $wc_product) {
    $images[] = ‘https://domain.com/image1.jpg’;
    $images[] = ‘https://domain.com/image2.jpg’;

    return $images;
    }

    #641134

    Hung Pham
    Keymaster

    Hi informatica-4758,

    Thanks for reaching to us and appreciate your patience.

    According to your code, can you please try to install YITH WooCommerce Product Adds on and check again?

    Unfortunately, customization is out of our basic support and Please note that we do not give a guarantee for full theme compatibility with all existing 3rd party plugins. Sometimes, not always, you need additionally customize the theme or plugin to make them work together. Unfortunately, it’s not possible for the author to make the theme compatible with all the existing plugins and additional customization is outside the scope of our basic support

    Thanks for understanding our limitations. Let me know if you have any questions.

    Best Regards,

    #641136

    informatica-4758
    Participant

    Hello.
    No, this is not the problem, your theme allows to create galleries in the variable products. Right now we create those galleries with your theme, and I need to create the new code with the parameters of your theme that I don’t know what they are.
    I have sent you the code from yith as an example of what we had. But the code we have is the following and we need the values of your theme for the galleries of the variabelsprodcutos and to write the code correctly.

    add_filter( ‘shopping_feed_variation_images’, ‘custom_variation_images_function’, 10, 3 );

    This is the code that they give us from shoppingfeed to modify it and to be able to extract the images.

    add_filter( ‘shopping_feed_variation_images’, ‘your_custom_variation_images_function’, 10, 2 );

    /** @return array */
    function your_custom_tracking_url_function($images, $wc_product) {
    $images[] = ‘https://domain.com/image1.jpg;
    $images[] = ‘https://domain.com/image2.jpg;

    return $images;
    }

    #641331

    Hung Pham
    Keymaster

    Hi informatica-4758,

    Unfortunately, customization is out of our basic support.

    Thanks for understanding our limitations. Let me know if you have any questions.

    Best Regards,

    #643842

    informatica-4758
    Participant

    Hello,
    It is not about customization; I just want to know the function that handles the variation gallery so I can use it in the plugin feed code attached before.

    Best regards.

    #644216

    Hung Pham
    Keymaster

    Hi informatica-4758,

    I’ve passed this topic to one of our developers, and I will let you know once get an answer in the Monday.

    Thanks for your patience.

    Best Regards,

    #644590

    Hung Pham
    Keymaster

    Hi informatica-4758,

    Thanks for your patience.

    You are interested in how to add Variation Image Gallery during import/export, but in fact, if you export products from a site where our theme is active to a site where our theme is also active, these images are exported automatically.

    But if the WoodMart theme does not active on the site from which the products are exported, then in this case, in the export file, for Variation products, you need to add a custom meta field with the wd_additional_variation_images_data key in which to add the url of the images through the , separator.

    You can also familiarize yourself with the module Variation Image Gallery which is located here inc/integrations/woocommerce/modules/variation-gallery-new.php

    Regards,

Viewing 7 posts - 1 through 7 (of 7 total)