Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 5 additions & 17 deletions experimental/gpfup-count-files.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,5 @@
jQuery(function() {
// Update "123" to your form ID and "4" to your File Upload field ID.
if (typeof window['GPFUP_123_4'] === 'undefined') {
return;
}

// Update "123" to your form ID and "4" to your File Upload field ID.
var store = window.GPFUP_123_4.$store;

store.subscribe(function(mutation, state) {
if (mutation.type !== 'SET_FILES') {
return;
}
// Update "5" to your Single Product field ID - or - update `#input_123_5_1` to your desired input's HTML ID.
jQuery( '#input_123_5_1' ).val( state.files.length ).change();
});
});
/**
* We're no longer using the experimental folder for experimental snippets. 🚧
* You can now find the snippet here:
* https://github.com/gravitywiz/snippet-library/blob/master/gp-file-upload-pro/gpfup-count-files.js
*/
Loading