Last active
April 4, 2023 17:17
-
-
Save raftaar1191/1b57bd184e8c785f4efd4c1f5de72ddd to your computer and use it in GitHub Desktop.
Update All LearnDash courses price by using mysql statement
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
Main query run on the live site: | |
Chagne the open to paynow | |
UPDATE wpig_postmeta as pm | |
SET pm.meta_value = 'paynow' | |
WHERE pm.meta_key = '_ld_price_type'; | |
For 300: | |
UPDATE wpig_postmeta as pm | |
SET pm.meta_value = 'a:31:{i:0;s:0:"";s:30:"sfwd-courses_course_price_type";s:6:"paynow";s:40:"sfwd-courses_course_prerequisite_enabled";s:0:"";s:32:"sfwd-courses_course_prerequisite";s:0:"";s:40:"sfwd-courses_course_prerequisite_compare";s:3:"ANY";s:34:"sfwd-courses_course_points_enabled";s:0:"";s:26:"sfwd-courses_course_points";s:0:"";s:33:"sfwd-courses_course_points_access";s:0:"";s:26:"sfwd-courses_expire_access";s:0:"";s:31:"sfwd-courses_expire_access_days";i:0;s:42:"sfwd-courses_expire_access_delete_progress";s:0:"";s:36:"sfwd-courses_course_price_billing_p3";s:0:"";s:31:"sfwd-courses_course_trial_price";s:0:"";s:37:"sfwd-courses_course_trial_duration_t1";s:0:"";s:37:"sfwd-courses_course_trial_duration_p1";s:0:"";s:36:"sfwd-courses_course_price_billing_t3";s:0:"";s:25:"sfwd-courses_course_price";s:3:"500";s:30:"sfwd-courses_custom_button_url";s:0:"";s:37:"sfwd-courses_course_materials_enabled";s:0:"";s:29:"sfwd-courses_course_materials";s:0:"";s:24:"sfwd-courses_certificate";s:0:"";s:27:"sfwd-courses_exam_challenge";i:0;s:41:"sfwd-courses_course_disable_content_table";s:0:"";s:35:"sfwd-courses_course_lesson_per_page";s:0:"";s:42:"sfwd-courses_course_lesson_per_page_custom";s:0:"";s:41:"sfwd-courses_course_topic_per_page_custom";s:0:"";s:40:"sfwd-courses_course_lesson_order_enabled";s:0:"";s:34:"sfwd-courses_course_lesson_orderby";s:0:"";s:32:"sfwd-courses_course_lesson_order";s:0:"";s:46:"sfwd-courses_course_disable_lesson_progression";s:0:"";s:52:"sfwd-courses_course_price_type_paynow_enrollment_url";s:0:"";}' | |
WHERE pm.meta_key = '_sfwd-courses'; | |
For 400: | |
UPDATE wpig_postmeta as pm left JOIN wpig_posts as p ON p.ID = pm.post_id | |
SET pm.meta_value = 'a:31:{i:0;s:0:"";s:30:"sfwd-courses_course_price_type";s:6:"paynow";s:40:"sfwd-courses_course_prerequisite_enabled";s:0:"";s:32:"sfwd-courses_course_prerequisite";s:0:"";s:40:"sfwd-courses_course_prerequisite_compare";s:3:"ANY";s:34:"sfwd-courses_course_points_enabled";s:0:"";s:26:"sfwd-courses_course_points";s:0:"";s:33:"sfwd-courses_course_points_access";s:0:"";s:26:"sfwd-courses_expire_access";s:0:"";s:31:"sfwd-courses_expire_access_days";i:0;s:42:"sfwd-courses_expire_access_delete_progress";s:0:"";s:36:"sfwd-courses_course_price_billing_p3";s:0:"";s:31:"sfwd-courses_course_trial_price";s:0:"";s:37:"sfwd-courses_course_trial_duration_t1";s:0:"";s:37:"sfwd-courses_course_trial_duration_p1";s:0:"";s:36:"sfwd-courses_course_price_billing_t3";s:0:"";s:25:"sfwd-courses_course_price";s:3:"450";s:30:"sfwd-courses_custom_button_url";s:0:"";s:37:"sfwd-courses_course_materials_enabled";s:0:"";s:29:"sfwd-courses_course_materials";s:0:"";s:24:"sfwd-courses_certificate";s:0:"";s:27:"sfwd-courses_exam_challenge";i:0;s:41:"sfwd-courses_course_disable_content_table";s:0:"";s:35:"sfwd-courses_course_lesson_per_page";s:0:"";s:42:"sfwd-courses_course_lesson_per_page_custom";s:0:"";s:41:"sfwd-courses_course_topic_per_page_custom";s:0:"";s:40:"sfwd-courses_course_lesson_order_enabled";s:0:"";s:34:"sfwd-courses_course_lesson_orderby";s:0:"";s:32:"sfwd-courses_course_lesson_order";s:0:"";s:46:"sfwd-courses_course_disable_lesson_progression";s:0:"";s:52:"sfwd-courses_course_price_type_paynow_enrollment_url";s:0:"";}' | |
WHERE p.post_type = 'sfwd-courses' and pm.meta_key = '_sfwd-courses' and p.post_title LIKE '%with Dependants%'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment