Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: WooCommerce downloadable product update problem #1392

Merged
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
2 changes: 1 addition & 1 deletion admin/posting.php
Original file line number Diff line number Diff line change
@@ -16,7 +16,7 @@ public function __construct() {
add_action( 'add_meta_boxes', [ $this, 'add_meta_box_form_select'] );
add_action( 'add_meta_boxes', [ $this, 'add_meta_box_post_lock'] );
add_action( 'admin_enqueue_scripts', [ $this, 'enqueue_script'] );
add_action( 'save_post', [ $this, 'save_meta'], 100, 2 ); // save the custom fields
add_action( 'save_post', [ $this, 'save_meta' ], 100, 2 ); // save the custom fields
add_action( 'save_post', [ $this, 'form_selection_metabox_save' ], 1, 2 ); // save edit form id
add_action( 'save_post', [ $this, 'post_lock_metabox_save' ], 1, 2 ); // save post lock option
add_action( 'wp_ajax_wpuf_clear_schedule_lock', [$this, 'clear_schedule_lock'] );
3 changes: 0 additions & 3 deletions assets/js/wpuf-admin.js
Original file line number Diff line number Diff line change
@@ -198,16 +198,13 @@ jQuery(function($) {
// align with WooCommerce _downloadable meta key
var downloadableRadio = $('.wpuf-fields input[type="radio"][name="_downloadable"]');
var downloadableCheckbox = $('#woocommerce-product-data input[type="checkbox"][name="_downloadable"]');
var virtualCheckbox = $('#woocommerce-product-data input[type="checkbox"][name="_virtual"]');
downloadableRadio.click(function() {
var downloadable = $(this).val();

if ($(this).is(':checked') && downloadable === 'yes') {
downloadableCheckbox.prop('checked', true);
virtualCheckbox.prop('checked', true);
} else {
downloadableCheckbox.prop('checked', false);
virtualCheckbox.prop('checked', false);
}
});

Loading