Skip Navigation

[Resolved] Using Javascript for product loops

This support ticket is created 7 years, 1 month ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

This topic contains 1 reply, has 2 voices.

Last updated by Luo Yang 7 years, 1 month ago.

Assisted by: Luo Yang.

Author
Posts
#579723

I am trying to:
Hide the order but

Link to a page where the issue can be seen:
hidden link
All products/posts except MixPack

I'm using the following code and it works fine but as soon as one products colour is chosen it shows the button for all posts.

// Executed when DOM is loaded
$(document).ready(function() {
// Executed when select is changed
$(this).attr("data-postid")
$("select").on('change',function() {
var x = this.selectedIndex;

if (x == "") {
$(".hidden-button").hide();
} else {
$(".hidden-button").show();
}
});

// It must not be visible at first time
$(".hidden-button").css("display","none");
});

I have added it to JS section on Loop Output Editor but it effects the whole page not just that one post.

#579807

Dear Josh,

It is a custom Javascript question, which is out the range of Toolset support. According to our support policy, we don't provide custom codes support:
https://toolset.com/toolset-support-policy/
We cannot produce custom code solutions for you. When you need custom coding which extends Toolset functionality, we recommend contacting one of Toolset certified consultants:
https://toolset.com/consultant/