woocommerce-bookings

Change Woocommerce booking status on Custom Order Status change

故事扮演 提交于 2019-12-11 16:59:47
问题 I have some custom order statuses (made with WooCommerce Order Status Manager). But when I use a custom paid status, the booking status is not updated to "paid". I've cobbled together some code from various references but it results in a fatal error. Or maybe I am missing something where custom statuses are supposed to update the booking paid status without extra code? My code: add_action('woocommerce_order_status_pool-payment-rec','auto_change_booking_status_to_paid', 10, 1); function auto

Get pricing data for a bookable product with date ranges in WooCommerce

百般思念 提交于 2019-12-11 07:34:25
问题 I would like to show to customers the price according to a date range. In on of my bookable product with date rage pricing I have: the base price: 100$ for the first day, adds $60 to the base price for two days (in a date range), adds 90$ to the base price for three days (in a date range). And so on… This is done in the backend of the woocommerce bookable product edit settings page. My problem is now, that I cannot find those additions (60, 90) anywhere in the database. With: $product = wc

Deposit based on a percentage of total cart amount

天大地大妈咪最大 提交于 2019-12-11 06:08:22
问题 I've taken this code from another post and basically from my understanding, this code is trying to force the cart price to change to a fixed amount of $40 and charge it as a booking fee. What I want to do is force the cart amount to be 20% of what the total would be based on adding up all the products in the cart. My site is for reservations , so I only want to charge a deposit and then have them pay when they use their reservation. Here is the code from this post: Woocommerce cart deposit

Set bookable product base cost programatically in Woocommerce Bookings

删除回忆录丶 提交于 2019-12-11 03:56:21
问题 I am trying to calculate the Base cost of a WooCommerce bookable product and managed to get it done using this: function modify_baseprice() { global $post; $productid = $post->ID; $product = new WC_Product($productid); $product_block_price = $product->wc_booking_block_cost; $product->wc_booking_cost = ($product_block_price*0.6) + 100; $pricing_data = update_post_meta( $productid, '_wc_booking_cost', $product->wc_booking_cost); return $pricing_data; } add_action( 'woocommerce_bookings_after

Conditionally alter specific product price in Woocommerce

╄→尐↘猪︶ㄣ 提交于 2019-11-29 16:10:09
I would like to alter a specific product in Woocommerce, adding programmatically to its original an amount of $10, EXCEPT in those cases : On specific product pages that are bookable products for hire (Woocommerce Bookings) that belongs to a certain Category "C". If any cart item belongs to that category "C". I was using this answer code to one of my questions until now. But I should need to display this specific product altered price everywhere except on that product pages that are bookable products, in front end. I have also this code that displays the Force Sells price beside the titles.