This small script updates the product date and unsets the private checkbox, scheduling the product for a specific date in the future. I made this because I couldn't find a quicker way to bulk schedule products (none of the WooCommerce bulk product editor plugins support this), but I need to do this for a lot of products at a time as we rotate seasonal products in the shop.
Last active
September 2, 2023 13:04
-
-
Save gcsecsey/98ec6031a6744dc267a0349bb970859f to your computer and use it in GitHub Desktop.
WooCommerce quick edit schedule product
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// month | |
document.querySelector(".inline-edit-wrapper .inline-edit-date select[name='mm']").value = "09"; | |
// date | |
document.querySelector(".inline-edit-wrapper .inline-edit-date input[name='jj']").value = "02"; | |
// year | |
document.querySelector(".inline-edit-wrapper .inline-edit-date input[name='aa']").value = "2023"; | |
// hour | |
document.querySelector(".inline-edit-wrapper .inline-edit-date input[name='hh']").value = "18"; | |
// minutes | |
document.querySelector(".inline-edit-wrapper .inline-edit-date input[name='mn']").value = "00"; | |
// unset private | |
document.querySelector(".inline-edit-wrapper input[name='keep_private']").value = ""; | |
// click save button | |
document.querySelector(".inline-edit-wrapper .submit.inline-edit-save button.button-primary.save").click(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment