Skip to content

Commit a5a36f0

Browse files
authored
gpfup-count-files.js: Migrated from experimental folder.
1 parent e21b59b commit a5a36f0

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
jQuery(function() {
2+
// Update "123" to your form ID and "4" to your File Upload field ID.
3+
if (typeof window['GPFUP_123_4'] === 'undefined') {
4+
return;
5+
}
6+
7+
// Update "123" to your form ID and "4" to your File Upload field ID.
8+
var store = window.GPFUP_123_4.$store;
9+
10+
store.subscribe(function(mutation, state) {
11+
if (mutation.type !== 'SET_FILES') {
12+
return;
13+
}
14+
// Update "5" to your Single Product field ID - or - update `#input_123_5_1` to your desired input's HTML ID.
15+
jQuery( '#input_123_5_1' ).val( state.files.length ).change();
16+
});
17+
});

0 commit comments

Comments
 (0)