fbpx
Want To Add Extra Images Per Product Variation? Download This Free Plugin

Inquiry About Variation Image and Price Display in Variation Swatches

Dear Variation Swatches Development Team,

I am reaching out to ask about an issue related to the display of variation images and prices in WooCommerce when using your Variation Swatches plugin.

Issue Details:

When adding a product with variations, some variation options automatically display images and prices, while others do not.

  • Upon inspection, I found that for attributes (e.g., “Capacity”) where no image is assigned, the system pulls the main product image to display in the variation option.
  • I also tested adding an additional attribute (e.g., “Color”) to a product experiencing this issue, and found that in this case, the variation selection no longer displayed images or prices.

Questions:

  1. Is this display behavior controlled by your plugin, WooCommerce, or the theme?
  2. Is there a way to hide variation images and prices from the selection options?
  3. Could you provide any recommendations or settings adjustments to resolve this?

Example of a product where variation images and prices are not displayed (red box):

  1. Product: XPG RAM PC GAMMIX D35 UDIMM DDR4 3200 Duel
    Link: https://www.gaminggearsthailand.com/product/xpg-%E0%B9%81%E0%B8%A3%E0%B8%A1-pc-gammix-d35-udimm-ddr4-3200-duel/

Example of a product where variation images and prices are displayed (red box):

  1. Product: Kingston Flash Drive 128GB USB-C 3.2 Gen 1 DataTraveler 70
    Link: https://www.gaminggearsthailand.com/product/kingston-%E0%B9%81%E0%B8%9F%E0%B8%A5%E0%B8%8A%E0%B9%84%E0%B8%94%E0%B8%A3%E0%B9%8C%E0%B8%9F-128gb-usb-c-3-2-gen-1-datatraveler-70/

If you could check this and provide guidance on resolving this issue, I would greatly appreciate it.

Thank you for your support.

Best regards,
Mr. Suwatthana Woranithiyaowapa
[email protected]

Screenshot_1.pngScreenshot_2.png

Golam Kibria

Hi Suwatthana,

Thanks a lot for your interest in our plugin.

When a product has a single attribute, the images and prices are included with the radio-type attributes.

Please add the following snippet your child theme’s functions.php file

add_filter('woo_variation_swatches_global_item_radio_label_template', 'override_radio_display_parameter', 10, 2);
add_filter('woo_variation_swatches_variable_item_radio_label_template', 'override_radio_display_parameter', 10, 2);
function override_radio_display_parameter($template, $data){
$new_label_template = apply_filters( 'woo_variation_swatches_global_item_radio_label_template_new', '%variation%', $data );
return $new_label_template;
}

You can try the Code Snippets plugin if you don’t have the child theme.

I will wait for your feedback.

Thank You