Home Forums WoodMart support forum Duplicate product => additional variation images are not copied

Duplicate product => additional variation images are not copied

Viewing 21 posts - 1 through 21 (of 21 total)
  • Author
    Posts
  • #241642

    Jeriss Cloud Center
    Participant

    Dear,

    I made a duplicate of product (which has additional variation images) but the additional variation images are not there. Only the main variation image (from default woocommerce) is there, but the theme feature additional variation image isn’t available => please fix this

    Thanks

    #241837

    Artem Temos
    Keymaster

    Hello,

    It works only with the new method of storing variations data https://prnt.sc/vjvdzx
    Note that if you will switch the method, you will have to edit your products and add variations images again.

    Kind Regards

    #241938

    Jeriss Cloud Center
    Participant

    Hi Artem,

    I’ve been working on your theme for about 2 years now, I have about 600 products (simple & variables) + for those products that are variable I have like between 2 to 20 variations each of them. So imagine I have like maybe 1000 units in total. And I do have additional images for almost all my products, so I think that asking me to rework all of what I’ve worked on for 2 years is kind of a bit of a joke ๐Ÿ™‚

    Also, if I switch methods => I suppose everything gets lost at once, so it’s not like as if I can perform the change slowly one by one, product by product, variation by variation => everything gets lost and I have to start all over, so that’s really an unworkable situation.

    Kindlyl investigate on a method to perform an automatic query or generator system to automatically perfrom the transfer of images across storing method. I can’t suddenly re-do all the work I’ve done because you’ve created a new system that isn’t backward compatible, please do the necessary to fix such kind of situation.

    Please put yourself as a user, this can’t happen…

    Thanks a lot
    Gevcen

    #242179

    Artem Temos
    Keymaster

    Hello,

    Try to add the following PHP code snippet to the child theme functions.php file to run the automatic transfer. Then reload your website once, remove the code switch the method in Theme Settings.

    add_action(
    	'wp',
    	function() {
    		$products = new WP_Query(
    			array(
    				'post_type'    => 'product',
    				'numberposts'  => -1,
    				'meta_key'     => 'woodmart_variation_gallery_data',
    				'meta_compare' => 'EXISTS',
    			)
    		);
    		foreach ( $products as $product ) {
    			$meta_data = get_post_meta( $product->ID, 'woodmart_variation_gallery_data', true );
    			if ( ! $meta_data ) {
    				continue;
    			}
    			foreach ( $meta_data as $key => $value ) {
    				update_post_meta( $key, 'wd_additional_variation_images_data', $value );
    			}
    		}
    	},
    	10
    );

    Kind Regards

    #245784

    Jeriss Cloud Center
    Participant

    Hi Artem,

    If I apply this shortcode in a staging to test first, it won’t impact images on live site right?

    Thanks

    #245976

    Artem Temos
    Keymaster

    Hello,

    Yes, you can run it on the staging website first and your live one will not be impacted.

    Regards

    #247505

    Jeriss Cloud Center
    Participant

    Dear,

    I tried this and process has failed unfortunately on staging where all customizations are disabled already there.

    1) Add the shortcode in functions.php
    2) Load the homepage of the staging
    3) Remove the shortcode in functions.php
    4) Switch the data storage to “variations”
    5) Load a product page on the staging

    AS IS : the variations images are not loading anymore

    TO BE : there must be variations images loading

    #247616

    Artem Temos
    Keymaster

    Please, provide us your admin and FTP access so we would check.

    #247652

    Jeriss Cloud Center
    Participant

    Credentials below. Please use only STAGING in the ftp (don’t touch live site please)

    #247656

    Artem Temos
    Keymaster

    Put the code to the child theme please.

    #247727

    Jeriss Cloud Center
    Participant

    It’s already what I’ve done, but your process said that I must remove the code from the child theme after the homepage being loaded…

    #247731

    Artem Temos
    Keymaster

    Keep the code for now. We will remove it when necessary.

    #247732

    Jeriss Cloud Center
    Participant

    It’s added

    #247733

    Artem Temos
    Keymaster

    It looks like the staging website works not in the way as live. Do you have some customizations or plugins there?
    https://gyazo.com/86d6a025d47d390010e627c1c50a9b13
    https://gyazo.com/ecb6a3e8cad93bbac8e5af0651ec6a5c

    #247801

    Jeriss Cloud Center
    Participant

    I’ve deleted and recreated the staging. Same links & credentials. Try again.

    #247804

    Artem Temos
    Keymaster
    #247834

    Jeriss Cloud Center
    Participant

    ????? Of course itโ€™s different ! You re asking me to disable customization !!! So obviously staging wont be same as live site anymore !! Forget the live site and just look the staging, your process didnt work on staging without customization

    #247836

    Artem Temos
    Keymaster

    Try to add the following PHP code snippet to the child theme functions.php file

    function wd_wc_ajax_variation_threshold( $qty, $product ) {
        return 350;
    }
    add_filter( 'woocommerce_ajax_variation_threshold', 'wd_wc_ajax_variation_threshold', 10, 2 );
    #247931

    Jeriss Cloud Center
    Participant

    So I add the previous code + this one after too? or only this one alone?

    #247933

    Jeriss Cloud Center
    Participant

    I just added it after the first shortocode provided in functions.php

    #248459

    Artem Temos
    Keymaster

    Be sure that you have activated the child theme to make the code work.

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