wordpress - Edit booking duration for multiple products on WooCommerce -
i've imported on 200 products system using csv import suite but, see, cannot edit booking duration nor product availability automatically. meaning have go each product individually if want set proper booking duration.
is there way edit 1 (or any) of options below?
- change default booking settings. if possible, where?
- using simple
update
query in database. if possible, table? - add fields in csv file. if possible, fields?
i found properties needed in db , created script update. see code below in case needs. remember adapt needs.
replace `db_site`.one_postmeta (post_id, meta_key, meta_value) (select id, '_wc_booking_base_cost', '' `db_site`.one_posts post_type = 'product'); replace `db_site`.one_postmeta (post_id, meta_key, meta_value) (select id, '_wc_booking_calendar_display_mode', 'always_visible' `db_site`.one_posts post_type = 'product'); replace `db_site`.one_postmeta (post_id, meta_key, meta_value) (select id, '_wc_booking_duration_type', 'fixed' `db_site`.one_posts post_type = 'product'); replace `db_site`.one_postmeta (post_id, meta_key, meta_value) (select id, '_wc_booking_duration', 21 `db_site`.one_posts post_type = 'product'); replace `db_site`.one_postmeta (post_id, meta_key, meta_value) (select id, '_wc_booking_duration_unit', 'day' `db_site`.one_posts post_type = 'product'); replace `db_site`.one_postmeta (post_id, meta_key, meta_value) (select id, '_wc_booking_user_can_cancel', 'yes' `db_site`.one_posts post_type = 'product'); replace `db_site`.one_postmeta (post_id, meta_key, meta_value) (select id, '_wc_booking_cancel_limit', 8 `db_site`.one_posts post_type = 'product'); replace `db_site`.one_postmeta (post_id, meta_key, meta_value) (select id, '_wc_booking_cancel_limit_unit', 'day' `db_site`.one_posts post_type = 'product'); replace `db_site`.one_postmeta (post_id, meta_key, meta_value) (select id, '_wc_booking_min_date', 2 `db_site`.one_posts post_type = 'product'); replace `db_site`.one_postmeta (post_id, meta_key, meta_value) (select id, '_wc_booking_min_date_unit', 'week' `db_site`.one_posts post_type = 'product'); replace `db_site`.one_postmeta (post_id, meta_key, meta_value) (select id, '_wc_booking_buffer_period', 8 `db_site`.one_posts post_type = 'product'); replace `db_site`.one_postmeta (post_id, meta_key, meta_value) (select id, '_wc_review_count', 0 `db_site`.one_posts post_type = 'product'); replace `db_site`.one_postmeta (post_id, meta_key, meta_value) (select id, '_wc_booking_cost', '' `db_site`.one_posts post_type = 'product'); replace `db_site`.one_postmeta (post_id, meta_key, meta_value) (select id, '_wc_display_cost', '' `db_site`.one_posts post_type = 'product'); replace `db_site`.one_postmeta (post_id, meta_key, meta_value) (select id, '_wc_booking_min_duration', 1 `db_site`.one_posts post_type = 'product'); replace `db_site`.one_postmeta (post_id, meta_key, meta_value) (select id, '_wc_booking_max_duration', 1 `db_site`.one_posts post_type = 'product'); replace `db_site`.one_postmeta (post_id, meta_key, meta_value) (select id, '_wc_booking_enable_range_picker', 'no' `db_site`.one_posts post_type = 'product'); replace `db_site`.one_postmeta (post_id, meta_key, meta_value) (select id, '_wc_booking_qty', 1 `db_site`.one_posts post_type = 'product'); replace `db_site`.one_postmeta (post_id, meta_key, meta_value) (select id, '_wc_booking_has_persons', 'no' `db_site`.one_posts post_type = 'product'); replace `db_site`.one_postmeta (post_id, meta_key, meta_value) (select id, '_wc_booking_person_qty_multiplier', 'no' `db_site`.one_posts post_type = 'product'); replace `db_site`.one_postmeta (post_id, meta_key, meta_value) (select id, '_wc_booking_person_cost_multiplier', 'no' `db_site`.one_posts post_type = 'product'); replace `db_site`.one_postmeta (post_id, meta_key, meta_value) (select id, '_wc_booking_min_persons_group', 1 `db_site`.one_posts post_type = 'product'); replace `db_site`.one_postmeta (post_id, meta_key, meta_value) (select id, '_wc_booking_max_persons_group', '' `db_site`.one_posts post_type = 'product'); replace `db_site`.one_postmeta (post_id, meta_key, meta_value) (select id, '_wc_booking_has_person_types', 'no' `db_site`.one_posts post_type = 'product'); replace `db_site`.one_postmeta (post_id, meta_key, meta_value) (select id, '_wc_booking_has_resources', 'no' `db_site`.one_posts post_type = 'product'); replace `db_site`.one_postmeta (post_id, meta_key, meta_value) (select id, '_wc_booking_resources_assignment', 'customer' `db_site`.one_posts post_type = 'product'); replace `db_site`.one_postmeta (post_id, meta_key, meta_value) (select id, '_wc_booking_max_date', 12 `db_site`.one_posts post_type = 'product'); replace `db_site`.one_postmeta (post_id, meta_key, meta_value) (select id, '_wc_booking_max_date_unit', 'month' `db_site`.one_posts post_type = 'product'); replace `db_site`.one_postmeta (post_id, meta_key, meta_value) (select id, '_wc_booking_first_block_time', '' `db_site`.one_posts post_type = 'product'); replace `db_site`.one_postmeta (post_id, meta_key, meta_value) (select id, '_wc_booking_requires_confirmation', 'no' `db_site`.one_posts post_type = 'product'); replace `db_site`.one_postmeta (post_id, meta_key, meta_value) (select id, '_wc_booking_default_date_availability', 'available' `db_site`.one_posts post_type = 'product'); replace `db_site`.one_postmeta (post_id, meta_key, meta_value) (select id, '_wc_booking_check_availability_against', '' `db_site`.one_posts post_type = 'product'); replace `db_site`.one_postmeta (post_id, meta_key, meta_value) (select id, '_wc_booking_resouce_label', '' `db_site`.one_posts post_type = 'product'); replace `db_site`.one_postmeta (post_id, meta_key, meta_value) (select id, '_wc_booking_availability', 'a:0:{}' `db_site`.one_posts post_type = 'product'); replace `db_site`.one_postmeta (post_id, meta_key, meta_value) (select id, '_wc_booking_pricing', 'a:0:{}' `db_site`.one_posts post_type = 'product'); replace `db_site`.one_postmeta (post_id, meta_key, meta_value) (select id, '_wc_memberships_product_viewing_restricted_message', '' `db_site`.one_posts post_type = 'product'); replace `db_site`.one_postmeta (post_id, meta_key, meta_value) (select id, '_wc_memberships_use_custom_product_viewing_restricted_message', 'no' `db_site`.one_posts post_type = 'product'); replace `db_site`.one_postmeta (post_id, meta_key, meta_value) (select id, '_wc_memberships_product_purchasing_restricted_message', '' `db_site`.one_posts post_type = 'product'); replace `db_site`.one_postmeta (post_id, meta_key, meta_value) (select id, '_wc_memberships_use_custom_product_purchasing_restricted_message', 'no' `db_site`.one_posts post_type = 'product'); replace `db_site`.one_postmeta (post_id, meta_key, meta_value) (select id, '_wc_memberships_force_public', 'no' `db_site`.one_posts post_type = 'product'); replace `db_site`.one_postmeta (post_id, meta_key, meta_value) (select id, '_wc_memberships_exclude_discounts', 'no' `db_site`.one_posts post_type = 'product');
not best sql script i've created job :)
Comments
Post a Comment