woocommerce-bookings

Dynamic checkout custom fields per persons and items in Woocommerce bookings

折月煮酒 提交于 2021-02-18 17:55:44
问题 For a bookings website I'm trying to create a function which makes it possible to add an attendee list, based on the amount of persons. I've already got the code for a single booking, thanks to LoicTheAztec. That part is working fine. I also need the same functionality for multiple bookings. How can I achieve this? Here is the code: //* Add a new checkout field add_filter( 'woocommerce_checkout_fields', 'ppp_filter_checkout_fields' ); function ppp_filter_checkout_fields($fields){ $fields[

WooCommerce 4.0 custom checkout & ACF field value on email, admin order, and thank you page

怎甘沉沦 提交于 2021-01-28 17:52:30
问题 I'm having a hard time printing my custom field value to the email notifications, order admin and thank you page. I've browsed through StackOverflow, tried every single answer I found but unfortunately not working and I couldn't figure out the problem: I am trying to pass the value of the additional checkout field, it only prints the strong label with a blank value, and in the emails nothing shows, here is my code so far: //new pickup location checkout field add_action( 'woocommerce_before

WooCommerce 4.0 custom checkout & ACF field value on email, admin order, and thank you page

与世无争的帅哥 提交于 2021-01-28 17:47:28
问题 I'm having a hard time printing my custom field value to the email notifications, order admin and thank you page. I've browsed through StackOverflow, tried every single answer I found but unfortunately not working and I couldn't figure out the problem: I am trying to pass the value of the additional checkout field, it only prints the strong label with a blank value, and in the emails nothing shows, here is my code so far: //new pickup location checkout field add_action( 'woocommerce_before

Custom email subject placeholders for WooCommerce order related bookings

為{幸葍}努か 提交于 2021-01-28 03:56:37
问题 Woocommerce gives the option to add placeholders to the subject of an email. I'd like to expand on that ability by creating a custom placeholder that pulls information from woocommerce gravity forms product addons and woocommerce bookings. I've tried Create additional variables/placeholders for Woocommerce email notifications subject code making some changes to see if I could make it work. Also, I tried getting the woocommerce meta fields but that didn't work either. On this code I am not

Replace Qty in cart for Bookable Product at the backend with persons for all subsequent actions

梦想与她 提交于 2020-06-17 09:42:16
问题 I am using the following code to replaced the quantity column in cart with persons for bookable products (i am using WooCommerce Bookings plugin). However, it only changes the cart Qty in the front end but other actions like shipping costs / cart fees set based on qty in cart is not getting updated. Can i add some more code to the above to even replace the qty with persons at the backend for other operations like shipping cost and cart fees. function replace_cart_quantity_for_bookings(

Show only specific Woocommerce Bookings meta data in cart items

浪尽此生 提交于 2020-01-14 03:05:27
问题 I amusing WooCommerce and with WooCommerce Bookings plugin. In their documentation there's this solution for booking multiple items by using the "persons" quantity. So what the Bookings plugins does, it ads meta data to the variations, it also includes "persons" what we're currently using as an indicator for the amount of items being booked. What we want to next is retrieve the meta data [Persons] from the product variations and display this as the item quantity. What I've done so far is edit

How to extend woocommerce api to show bookable product availability rules?

半腔热情 提交于 2019-12-24 19:49:53
问题 I've made a custom plugin with a custom api end point. I would like to access my bookable products availability times so I can use the api with a react front end. So far I have this function that my custom endpoint is attached to: function get_data() { $args = array( 'limit' => 1, 'type' => 'booking', ); $products = wc_get_products( $args ); return $products; } When I call my end point in postman all I get is this: Why is the array for availability_rules empty and why is there no other

Conditionally alter specific product price in Woocommerce

谁说我不能喝 提交于 2019-12-18 09:19:08
问题 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

Custom cart items price calculation for Woocommerce Bookings

戏子无情 提交于 2019-12-12 23:17:39
问题 I want to know how to update the price calculation depending on some internal coding. This is the price that needs to go into the cart item and thus far, the cart item shows only the base cost of the product. Technically the price should be altered, when a product is added to the cart. I figured it had to be calculated like this: global $woocommerce; $items = $woocommerce->cart->get_cart(); foreach($items as $item => $values) { if ($value['product_id'] == $product_id) { $value['data']->set

Add to cart bookable product by URL - WooCommerce Bookings

喜夏-厌秋 提交于 2019-12-12 09:01:30
问题 I'm using Woocommerce Bookings How to add to cart bookable product by URL? /?add-to-cart=[n.product] How can I pass an avaiable date with variations? Thanks 回答1: I ran into the same problem recently but I discovered a solution. It's not possible to add a bookable product just by adding the right variables to the end of the URL because WooCommerce Bookings expects data to be sent via the POST method as you can see at the plugin's source: // woocommerce-bookings/includes/class-wc-booking-cart