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

Customer Roles and Swatches

Matt Williams

Hi,

I just upgraded to your guys Pro version of the plug-in so that we can display attribute images on the catalog and store pages. Before installing pro, certain attributes were hidden from different user roles so that you had to be logged-in or have a certain roll to get the discounted attribute. (Screenshots Provided) These are shown now to all users. Is there a way to fix this again so it hides from unique roles?

Also, the attribute image size for individual attributes seems to default to global even if I change it, am I doing something incorrectly?

Thank you,

Matt @ Never Summer

Hakik Zaman

Hello Matt Williams,

Thanks for reaching to us. Sorry for the inconvenience.

Unfortunately, your screenshot was not attached. Actually, we don’t have any feature to display swatch based on user role.

Could you record me reproducing your issue using tool like this? https://www.useloom.com
It helps me to quickly figure out your issue.

Thank you

Hakik Zaman

Hi Matt,

Really sorry for the inconvenience.

Just for clarification, these PROFORM options should display for specific user not to all. And after activating the Swatches PRO version, those options are displaying to all not for specific user anymore. But without Swatches PRO it worked fine, Right?

If it is the issue, could you please reproduce this issue to our development server? Please let me know if you are ready, I will install the other plugins and insert some dummy products as well. You have to install the ELEX Roles Plug-in and reproduce this issue there (for one product only). So that I can refer it to my development team.

I hope you will cooperate.

Thanks in advance for your cooperation.

Matt Williams

Hello Hakik,

Thank you for getting back to me in this.

Correct, the “PROFORM” options should only display to certain roles.

You are also correct. Before upgrading to the “PRO” version, we did not have this problem just using the “Variation Swatches for WooCommerce”

That sounds fantastic and I am ready to move forward with that. Please let me know when the development server is ready for me to reproduce this.

Thank you,

Matt

Hakik Zaman

Hi Matt,

I really appreciate your help. Thanks for your interest. Here is the login credentials for you-

https://wptestbox.com/91956/wp-admin/

user: admin

pass: xy(@Q5qFecb(CYU43u

Please let me know, while you reproduce your issue there. I will wait for your next response.

Thanks

Matt Williams

Hi Hakik,

Sorry for problems.

Thank you for getting back to me on this. I have uploaded the ELEX Roles Plugin to the test site that is set up.

We have custom PHP code on the ELEX Plugin, and I believe this is what is interfering with the swatches plugin. It also will not display correctly on the test site.

LINK TO CUSTOM PHP CODE

You can find the custom code in the role plugin at ELEX WooCommerce Role-based Pricing > includes > elex-price-discount-admin.php on line 1667.

I have setup a development test site on our local server as well that is completely set up for you and your developers may use, if that is in your interest. You can access the development site HERE and the login credentials are within the original ticket above.

Thank you for all your time,

Matt

Hakik Zaman

Hi Matt,

Thanks for uploading the plugin to our development server.

Did you check by disabling your custom code? It is working with PRO version or not.

Could you please tell me, on which product you have applied the role (from our development server)?

It will be easier to navigate for our development team, if they know where it is happening.

I really appreciate for giving us the another development site. They will use it also, if they need 🙂

Hope to hearing from you soon.

Thanks

Matt Williams

Hi Hakik,

The custom code in the ELEX plugin is what allows us to hide the “PROFORM” Variation from certain roles. When I disable the custom code, the “PROFORM” Variations show up for everybody. Disabling the code, did not fix the issue.

I think the Swatches PRO is overwriting some part of the custom code. I have also tried to reorder the load priority of my plugins, and that does not fix it either.

I have added the role to the “T-Shirt with Logo” product.

Thank you!

 

Hakik Zaman

Hi Matt,

Again sorry, You have reproduced it on a simple product. Could you please reproduce it for a variable product as like your live site?

It will be great if you also give us a screencast on “What’s going on after PRO activated/deactivated”. You know I have to refer it to development team. They will ask me very specific. I hope you will understand.

Indeed, your cooperation is remarkable.

Thanks in advance for your cooperation.

Hakik Zaman

Hello Matt,

Thank you very much for your cooperation.

Please activate Swatches PRO and uncheck this option (in our development site it is unchecked now), with dropdown layout Role base variation are working fine.

I have already referred your screencast to the development team. They will look into it. Please be patient.

Once I get any information from them, I will get back to you.

Thanks for your patience.

Matt Williams

Hello Hakik,

For some reason on my site, the dropdown menu does not change the fact that other roles can see the product.

Have you heard any updates from the developers?

Thank you,

Matt

Hakik Zaman

Hello Matt,

It is Eid vacation here and we are on leave. It may take some more time.

I didn’t get any update from them yet. But don’t worry, I will push them again for you.

Thanks

Matt Williams

Hello Hakik,

I understand it has been over two months since this ticket has been addressed. Can I request a refund for the PRO version of the plugin. It does not work with our website.

Thank you,

Matt

Hakik Zaman

Hello Matt,

We are apologizing for our late response.

I have contacted our development team, they have added a snippet WVS test for you. You will get there two filter hooks- wvs_variable_item_remove_term, wvs_default_variable_item_remove_term.

Inside your Individual Roles snippet, you have applied some conditions for <select> <option> based on roles. Please apply your conditions inside the WVS test snippet.

If it works for you, we will release an update. You will get everything inside here as it was-

https://wptestbox.com/91956/wp-admin/

user: admin

pass: xy(@Q5qFecb(CYU43u

Hope to hear from you soon.

Thanks

Matt Williams

Hello Hakik,

I am not sure what you guys did, but since a recent update of the plugin, the Roles and variations seem to function perfectly now. I don’t even need to add in the hooks!

We are now having an issue with the swatches working on the shop archive page. When clicking on a variation anytime after leaving page one of the store, the variation image does not switch. Page one works great, yet after switching pages, the variations will not change at all to display the correct color-way. Here is a Loom to explain it a bit more.

https://www.loom.com/share/8c5fd07d9dcd49a5ae2b6ed9581258e5

Thank you,

Matt

Hakik Zaman

Hello Matt,

We are very glad that your first issue is resolved.

I am not sure what you guys did, but since a recent update of the plugin, the Roles and variations seem to function perfectly now. I don’t even need to add in the hooks!

Inside the latest version, we have added two filter hooks with priority.

For your second issue-

We need an event from the plugin/theme that should be triggered after new products are loaded.

Just send this plugin to your plugin/theme developer: https://wordpress.org/plugins/malinky-ajax-pagination/

And ask them to send triggers like the following as the Malinky Ajax Pagination plugin provides.
document.addEventListener(‘malinkyLoadPostsComplete’, function(e) {
   console.log(‘LoadPostsComplete’);
});

Like this filter plugin: https://woocommerce.com/products/product-filters/
jQuery(document).ready(function( $ ){
   // Your code in here
   jQuery(window).on(‘wcpf_update_products’, function () {
      console.log(‘Hi’);
   });
});

Thank You