Title: bug when using [wpcvs_archive] shortcode
Last modified: February 2, 2023

---

# bug when using [wpcvs_archive] shortcode

 *  Resolved [thanasisxan](https://wordpress.org/support/users/thanasisxan/)
 * (@thanasisxan)
 * [3 years, 4 months ago](https://wordpress.org/support/topic/bug-when-using-wpcvs_archive-shortcode/)
 * At first, thanks for this very useful and high quality free plugin, I will definitely
   check all the options you have paid or not!
 * The bug I am referring to happens when using Oxygen Builder repeater field for
   product archive. I use the [wpcvs_archive] shortcode in each product (repeater
   field) and figured that it doesn’t work as expected.
 * After some debugging I managed to find the problem and it is the **wrong id of
   select field** or **data-attribute** value at **closest .wpcvs-terms** generated
   for the equivalent variation select, maybe this should be pa_color-2 for example
   or the select id be pa_color?
 * Thanks in advance
 * > [View post on imgur.com](https://imgur.com/a/cLDsamE)

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Thread Starter [thanasisxan](https://wordpress.org/support/users/thanasisxan/)
 * (@thanasisxan)
 * [3 years, 4 months ago](https://wordpress.org/support/topic/bug-when-using-wpcvs_archive-shortcode/#post-16434712)
 * btw I temporarily solve it like this (since pa_color and pa_megethos are the 
   only attributes I have)
 *     ```wp-block-code
       jQuery("select[id^='pa_color']").each(function (i, el) {
       	let correct_id=jQuery(this).attr('id');
       	jQuery(this).parent().find('.wpcvs-terms').attr('data-attribute',correct_id);
        });
   
       jQuery("select[id^='pa_megethos']").each(function (i, el) {
       	let correct_id=jQuery(this).attr('id');
       	jQuery(this).parent().find('.wpcvs-terms').attr('data-attribute',correct_id);
        });
       ```
   
 *  Plugin Author [WPClever](https://wordpress.org/support/users/wpclever/)
 * (@wpclever)
 * [3 years, 4 months ago](https://wordpress.org/support/topic/bug-when-using-wpcvs_archive-shortcode/#post-16435621)
 * Hi [@thanasisxan](https://wordpress.org/support/users/thanasisxan/)
 * Thanks for informing me of this issue!
 * Please update this plugin to the latest version 2.2.4, and clear the cache before
   testing again. I’ve fixed it.
 * Now I’ll use three ways to find the dropdown for ensure 🙂
 *     ```wp-block-code
       $select = $this.closest('.wpcvs-terms').parent().find('select#' + attr);
   
       if (!$select.length) {
         $select = $this.closest('.wpcvs-terms').parent().find('select[data-attribute_name="attribute_' + attr + '"]');
       }
   
       if (!$select.length) {
         $select = $this.closest('.wpcvs-terms').parent().find('select[name="attribute_' + attr + '"]');
       }
       ```
   
 *  Thread Starter [thanasisxan](https://wordpress.org/support/users/thanasisxan/)
 * (@thanasisxan)
 * [3 years, 4 months ago](https://wordpress.org/support/topic/bug-when-using-wpcvs_archive-shortcode/#post-16438716)
 * Thanks for the immediate response and the fix!

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘bug when using [wpcvs_archive] shortcode’ is closed to new replies.

 * ![](https://ps.w.org/wpc-variation-swatches/assets/icon-128x128.png?rev=2524746)
 * [WPC Variation Swatches for WooCommerce](https://wordpress.org/plugins/wpc-variation-swatches/)
 * [Support Threads](https://wordpress.org/support/plugin/wpc-variation-swatches/)
 * [Active Topics](https://wordpress.org/support/plugin/wpc-variation-swatches/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wpc-variation-swatches/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wpc-variation-swatches/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [thanasisxan](https://wordpress.org/support/users/thanasisxan/)
 * Last activity: [3 years, 4 months ago](https://wordpress.org/support/topic/bug-when-using-wpcvs_archive-shortcode/#post-16438716)
 * Status: resolved