Browse Source

** Booking Activities 1.7.11 **

* Fix - Cannot update WC cart item quantity for non-activity items
* Fix - Hide booking actions in WC emails (undesired display when more than 1 item)
develop 1.7.11
yoan_cutillas 2 years ago
parent
commit
f5c6f36236
  1. 6
      booking-activities.php
  2. 42
      controller/controller-woocommerce-bookings.php
  3. 10
      controller/controller-woocommerce-frontend.php
  4. 2
      css/backend.css
  5. 2
      css/backend.min.css
  6. 2
      css/global.css
  7. 2
      css/global.min.css
  8. BIN
      img/add-ons/advanced-forms.png
  9. 12
      readme.txt

6
booking-activities.php

@ -3,13 +3,13 @@
* Plugin Name: Booking Activities
* Plugin URI: https://booking-activities.fr/en/?utm_source=plugin&utm_medium=plugin&utm_content=header
* Description: Booking system specialized in activities (sports, cultural, leisure, events...). Works great with WooCommerce.
* Version: 1.7.10
* Version: 1.7.11
* Author: Booking Activities Team
* Author URI: https://booking-activities.fr/en/?utm_source=plugin&utm_medium=plugin&utm_content=header
* Text Domain: booking-activities
* Domain Path: /languages/
* WC requires at least: 2.6
* WC tested up to: 3.7
* WC tested up to: 3.8
* License: GPL3
* License URI: https://www.gnu.org/licenses/gpl-3.0.html
*
@ -40,7 +40,7 @@ if ( ! defined( 'ABSPATH' ) ) { exit; }
// GLOBALS AND CONSTANTS
if( ! defined( 'BOOKACTI_VERSION' ) ) { define( 'BOOKACTI_VERSION', '1.7.10' ); }
if( ! defined( 'BOOKACTI_VERSION' ) ) { define( 'BOOKACTI_VERSION', '1.7.11' ); }
if( ! defined( 'BOOKACTI_PLUGIN_NAME' ) ) { define( 'BOOKACTI_PLUGIN_NAME', 'booking-activities' ); }

42
controller/controller-woocommerce-bookings.php

@ -311,9 +311,10 @@ if ( ! defined( 'ABSPATH' ) ) { exit; }
}
}
add_action( 'woocommerce_order_status_pending_to_processing', 'bookacti_turn_non_activity_order_bookings_to_permanent', 5, 2 );
// MY ACCOUNT
/**
@ -330,7 +331,7 @@ if ( ! defined( 'ABSPATH' ) ) { exit; }
/**
* Add actions html elements to booking rows
* @version 1.6.0
* @version 1.7.11
* @global boolean $bookacti_is_email
* @param int $item_id
* @param WC_Order_item $item
@ -342,7 +343,6 @@ if ( ! defined( 'ABSPATH' ) ) { exit; }
// Don't display booking actions in emails, in plain text and in payment page
if( ( isset( $bookacti_is_email ) && $bookacti_is_email ) || $plain_text || ( isset( $_GET[ 'pay_for_order' ] ) && $_GET[ 'pay_for_order' ] ) ) {
$GLOBALS[ 'bookacti_is_email' ] = false;
return;
}
@ -358,18 +358,44 @@ if ( ! defined( 'ABSPATH' ) ) { exit; }
/**
* Set a flag before displaying order items to decide whether to display booking actions
* @since 1.4.0
* @version 1.6.0
* @version 1.7.11
* global boolean $bookacti_is_email
* @param array $args
* @return array
*/
function bookacti_order_items_set_email_flag( $args ) {
$GLOBALS[ 'bookacti_is_email' ] = true;
if( defined( 'bookacti_is_email' ) ) {
global $bookacti_is_email;
$bookacti_is_email = true;
} else {
$GLOBALS[ 'bookacti_is_email' ] = true;
}
return $args;
}
add_filter( 'woocommerce_email_order_items_args', 'bookacti_order_items_set_email_flag', 10, 1 );
/**
* Set a flag before displaying order items to decide whether to display booking actions
* @since 1.7.11
* @param string $html
* @param WC_Order $order
* @return string
*/
function bookacti_order_items_unset_email_flag( $html, $order ) {
if( defined( 'bookacti_is_email' ) ) {
global $bookacti_is_email;
$bookacti_is_email = false;
} else {
$GLOBALS[ 'bookacti_is_email' ] = false;
}
return $html;
}
add_filter( 'woocommerce_email_order_items_table', 'bookacti_order_items_unset_email_flag', 10, 2 );
// BOOKING LIST
/**

10
controller/controller-woocommerce-frontend.php

@ -146,7 +146,7 @@ if ( ! defined( 'ABSPATH' ) ) { exit; }
/**
* Add booking forms to single product page (front-end)
* @version 1.7.8
* @version 1.7.11
* @global WC_Product $product
*/
function bookacti_add_booking_system_in_single_product_page() {
@ -243,6 +243,7 @@ if ( ! defined( 'ABSPATH' ) ) { exit; }
$form_atts = apply_filters( 'bookacti_product_form_attributes', array(
'id' => $form_instance_id,
'class' => '',
'data-default-variation-id' => ! empty( $default_variation_id ) ? $default_variation_id : '',
'data-variation-id' => ! empty( $variation_id ) ? $variation_id : '',
'data-product-id' => $product->get_id(),
@ -250,7 +251,7 @@ if ( ! defined( 'ABSPATH' ) ) { exit; }
), $product );
// Add compulsory class
$form_atts[ 'class' ] = 'bookacti-wc-form-fields' . ( ! empty( $form_atts[ 'class' ] ) ? ' ' . $form_atts[ 'class' ] : '' );
$form_atts[ 'class' ] .= ' bookacti-wc-form-fields';
// Convert $form_atts array to inline attributes
$form_attributes_str = '';
@ -1082,7 +1083,7 @@ if ( ! defined( 'ABSPATH' ) ) { exit; }
/**
* If quantity changes in cart, temporarily book the extra quantity if possible
* @version 1.7.10
* @version 1.7.11
* @param int $new_quantity
* @param string $cart_item_key
*/
@ -1091,11 +1092,10 @@ if ( ! defined( 'ABSPATH' ) ) { exit; }
$item = $woocommerce->cart->get_cart_item( $cart_item_key );
$old_quantity = $item[ 'quantity' ];
if( ! isset( $item['_bookacti_options'] ) || $new_quantity === $old_quantity ) { return $old_quantity; }
if( ! isset( $item['_bookacti_options'] ) || $new_quantity === $old_quantity ) { return $new_quantity; }
$is_in_cart = false;
$restore_qty = false;
$init_new_quantity = $new_quantity;
// Single event
if( ! empty( $item['_bookacti_options']['bookacti_booking_id'] ) ) {

2
css/backend.css

@ -106,7 +106,7 @@
.bookacti-message-setting { margin-bottom: 20px; }
.bookacti-message-setting input { margin-top: 6px; }
.bookacti_checkbox { display: inline-block; margin-right: 20px; line-height: 1.5em; min-width: 100px; max-width: 100px; box-sizing: border-box; overflow: hidden; white-space: nowrap; }
.bookacti_checkbox { display: inline-block; margin-right: 20px; padding: 1px; min-width: 100px; max-width: 100px; box-sizing: border-box; overflow: hidden; white-space: nowrap; }
#bookacti_refund_actions .bookacti_checkbox { max-width: none; overflow: visible; }
/** DIALOGS **/

2
css/backend.min.css

File diff suppressed because one or more lines are too long

2
css/global.css

@ -108,7 +108,7 @@
/* Small events */
.bookacti-calendar .fc-agenda-view .bookacti-small-event .fc-title,
.bookacti-calendar .fc-agenda-view .bookacti-small-event .fc-time { display: inline-block; }
.bookacti-calendar .fc-agenda-view .bookacti-small-event .fc-time { display: inline; }
.bookacti-calendar .fc-agenda-view .bookacti-small-event:not(.bookacti-wide-event) .fc-time span { display: none; }
.bookacti-calendar .fc-agenda-view .bookacti-small-event:not(.bookacti-wide-event) .fc-time:before { content: attr(data-start); }
.bookacti-calendar .fc-agenda-view .bookacti-small-event:not(.bookacti-wide-event) .fc-time:after { content: "\000A0-\000A0"; }

2
css/global.min.css

File diff suppressed because one or more lines are too long

BIN
img/add-ons/advanced-forms.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.8 KiB

After

Width:  |  Height:  |  Size: 6.2 KiB

12
readme.txt

@ -1,11 +1,11 @@
=== Booking Activities ===
Contributors: bookingactivities, yoancutillas
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=7EKU434L7NEVC
Tags: booking activities, booking sport, booking form, event reservation, reservation schedule
Tags: booking, reservation, booking form, booking calendar, booking events
Requires at least: 3.6
Tested up to: 5.2
Tested up to: 5.3
Requires PHP: 5.3
Stable tag: 1.7.10
Stable tag: 1.7.11
License: GPLv3 or later
License URI: http://www.gnu.org/licenses/gpl-3.0.html
@ -102,7 +102,7 @@ See the whole [features list here](https://booking-activities.fr/en/documentatio
= Extend these features with add-ons: =
* **[Advanced Forms](https://booking-activities.fr/en/downloads/advanced-forms/?utm_source=wp-plugin-page&utm_medium=wordpress&utm_campaign=advanced-forms&utm_content=readme)**: Add any custom fields to your booking forms
* **[Advanced Forms](https://booking-activities.fr/en/downloads/advanced-forms/?utm_source=wp-plugin-page&utm_medium=wordpress&utm_campaign=advanced-forms&utm_content=readme)**: Add any (paid) custom fields to your booking forms
* **[Display Pack](https://booking-activities.fr/en/downloads/display-pack/?utm_source=wp-plugin-page&utm_medium=wordpress&utm_campaign=display-pack&utm_content=readme)**: Customize your calendars or set alternative display (datepicker)
* **[Prices and Credits](https://booking-activities.fr/en/downloads/prices-and-credits/?utm_source=wp-plugin-page&utm_medium=wordpress&utm_campaign=prices-and-credits&utm_content=readme)**: Set per event prices, decreasing prices, price categories (adults, children, etc.), pay with credits
* **[Notification Pack](https://booking-activities.fr/en/downloads/notification-pack/?utm_source=wp-plugin-page&utm_medium=wordpress&utm_campaign=notification-pack&utm_content=readme)**: Send notifications and booking reminders by email, SMS and Push
@ -319,6 +319,10 @@ If you don't receive a reply within 48h by email, a technical problem has probab
== Changelog ==
= 1.7.11 - 2019/11/02 =
* Fix - Cannot update WC cart item quantity for non-activity items
* Fix - Hide booking actions in WC emails (undesired display when more than 1 item)
= 1.7.10 - 2019/10/25 =
* Feature - Change booking quantity from the backend booking list (forced change only)
* Tweak - Add a price details column in the backend booking list

Loading…
Cancel
Save