Changeset 1894889
- Timestamp:
- 06/19/2018 04:42:00 AM (8 years ago)
- Location:
- wp-hotel-booking-woocommerce
- Files:
-
- 65 added
- 1 deleted
- 2 edited
-
tags/1.8.1 (added)
-
tags/1.8.1/assets (added)
-
tags/1.8.1/assets/css (added)
-
tags/1.8.1/assets/css/frontend (added)
-
tags/1.8.1/assets/css/frontend/site.css (added)
-
tags/1.8.1/assets/css/frontend/site.min.css (added)
-
tags/1.8.1/assets/js (added)
-
tags/1.8.1/assets/js/frontend (added)
-
tags/1.8.1/assets/js/frontend/site.js (added)
-
tags/1.8.1/includes (added)
-
tags/1.8.1/includes/admin (added)
-
tags/1.8.1/includes/admin/views (added)
-
tags/1.8.1/includes/admin/views/wc-is-not-installed.php (added)
-
tags/1.8.1/includes/admin/views/wc-settings.php (added)
-
tags/1.8.1/includes/class-hb-wc-2x-product-package.php (added)
-
tags/1.8.1/includes/class-hb-wc-2x-product-room.php (added)
-
tags/1.8.1/includes/class-hb-wc-booking.php (added)
-
tags/1.8.1/includes/class-hb-wc-checkout.php (added)
-
tags/1.8.1/includes/class-hb-wc-product-package.php (added)
-
tags/1.8.1/includes/class-hb-wc-product-room.php (added)
-
tags/1.8.1/includes/class-hb-wc-settings.php (added)
-
tags/1.8.1/includes/functions.php (added)
-
tags/1.8.1/languages (added)
-
tags/1.8.1/languages/wp-hotel-booking-woocommerce.pot (added)
-
tags/1.8.1/license.txt (added)
-
tags/1.8.1/readme.txt (added)
-
tags/1.8.1/templates (added)
-
tags/1.8.1/templates/woocommerce (added)
-
tags/1.8.1/templates/woocommerce/emails (added)
-
tags/1.8.1/templates/woocommerce/emails/email-order-details.php (added)
-
tags/1.8.1/templates/woocommerce/emails/email-order-items.php (added)
-
tags/1.8.1/wp-hotel-booking-woocommerce.php (added)
-
tags/1.8.2 (added)
-
tags/1.8.2/assets (added)
-
tags/1.8.2/assets/css (added)
-
tags/1.8.2/assets/css/frontend (added)
-
tags/1.8.2/assets/css/frontend/site.css (added)
-
tags/1.8.2/assets/css/frontend/site.min.css (added)
-
tags/1.8.2/assets/js (added)
-
tags/1.8.2/assets/js/frontend (added)
-
tags/1.8.2/assets/js/frontend/site.min.js (added)
-
tags/1.8.2/includes (added)
-
tags/1.8.2/includes/admin (added)
-
tags/1.8.2/includes/admin/views (added)
-
tags/1.8.2/includes/admin/views/wc-is-not-installed.php (added)
-
tags/1.8.2/includes/admin/views/wc-settings.php (added)
-
tags/1.8.2/includes/class-hb-wc-2x-product-package.php (added)
-
tags/1.8.2/includes/class-hb-wc-2x-product-room.php (added)
-
tags/1.8.2/includes/class-hb-wc-booking.php (added)
-
tags/1.8.2/includes/class-hb-wc-checkout.php (added)
-
tags/1.8.2/includes/class-hb-wc-product-package.php (added)
-
tags/1.8.2/includes/class-hb-wc-product-room.php (added)
-
tags/1.8.2/includes/class-hb-wc-settings.php (added)
-
tags/1.8.2/includes/functions.php (added)
-
tags/1.8.2/languages (added)
-
tags/1.8.2/languages/wp-hotel-booking-woocommerce.pot (added)
-
tags/1.8.2/license.txt (added)
-
tags/1.8.2/readme.txt (added)
-
tags/1.8.2/templates (added)
-
tags/1.8.2/templates/woocommerce (added)
-
tags/1.8.2/templates/woocommerce/emails (added)
-
tags/1.8.2/templates/woocommerce/emails/email-order-details.php (added)
-
tags/1.8.2/templates/woocommerce/emails/email-order-items.php (added)
-
tags/1.8.2/wp-hotel-booking-woocommerce.php (added)
-
trunk/assets/js/frontend/site.js (deleted)
-
trunk/assets/js/frontend/site.min.js (added)
-
trunk/readme.txt (modified) (1 diff)
-
trunk/wp-hotel-booking-woocommerce.php (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wp-hotel-booking-woocommerce/trunk/readme.txt
r1879609 r1894889 59 59 == Changelog == 60 60 61 = 1.8.2 = 62 + Update compatible when checkout room with WPML 63 61 64 = 1.8.1 = 62 65 + Update process after checkout by Woocommerce -
wp-hotel-booking-woocommerce/trunk/wp-hotel-booking-woocommerce.php
r1882303 r1894889 5 5 Description: Support paying for a booking with the payment system provided by WooCommerce 6 6 Author: ThimPress 7 Version: 1.8. 17 Version: 1.8.2 8 8 Author URI: http://thimpress.com 9 9 Tags: wphb … … 39 39 $this->_defines(); 40 40 41 41 42 require_once "includes/functions.php"; 42 43 require_once "includes/class-hb-wc-settings.php"; … … 48 49 add_action( 'wp_enqueue_scripts', array( $this, 'frontend_scripts' ) ); 49 50 50 // woommerce currency51 // // woommerce currency 51 52 add_filter( 'hb_currency', array( $this, 'woocommerce_currency' ), 50 ); 52 53 add_filter( 'hotel_booking_payment_current_currency', array( $this, 'woocommerce_currency' ), 50 ); … … 66 67 'hotel_booking_cart_item_total_amount' 67 68 ), 10, 4 ); 68 // add_filter( 'hotel_booking_cart_item_amount_singular', array( $this, 'hotel_booking_cart_item_amount_singular' ), 10, 4 ); 69 add_filter( 'hotel_booking_cart_item_amount_singular', array( 70 $this, 71 'hotel_booking_cart_item_amount_singular' 72 ), 10, 4 ); 69 73 // tax enable 70 74 add_filter( 'hb_price_including_tax', array( $this, 'hb_price_including_tax' ), 10, 2 ); 71 75 72 76 // trigger WC cart room item 73 add_filter( 'hotel_booking_added_cart', array( $this, 'hotel_add_to_cart' ), 10, 2);77 add_filter( 'hotel_booking_added_cart', array( $this, 'hotel_add_to_cart' ), 10, 3 ); 74 78 // trigger WC remove cart room item 75 79 add_action( 'hotel_booking_remove_cart_item', array( $this, 'hotel_remove_cart_item' ), 10, 2 ); … … 110 114 'get_cart_item_from_session' 111 115 ), 10, 3 ); 112 // //tax enable116 // tax enable 113 117 add_filter( 'hotel_booking_extra_tax_enable', array( $this, 'tax_enable' ) ); 114 118 … … 170 174 * @param $cart_item_id 171 175 * @param $params 172 * 173 * @return string174 * /175 public function hotel_add_to_cart( $cart_item_id, $params ) {176 // remove_action( 'hotel_booking_added_cart', array( $this, 'hotel_add_to_cart' ), 10, 2 );176 * @param $posts 177 * 178 * @return string 179 */ 180 public function hotel_add_to_cart( $cart_item_id, $params, $posts ) { 177 181 global $woocommerce; 178 182 179 183 if ( ! $woocommerce || ! $woocommerce->cart ) { 180 return '';184 return $cart_item_id; 181 185 } 182 186 … … 202 206 if ( class_exists( 'SitePress' ) ) { 203 207 global $sitepress; 204 if ( $sitepress->get_default_language() == ICL_LANGUAGE_CODE ) { 208 209 $product_id = $woo_cart_param['product_id']; 210 $post_type = get_post_type( $product_id ); 211 if ( in_array( $post_type, array( 'hb_room', 'hb_extra_room' ) ) ) { 212 $languages = $sitepress->get_ls_languages(); 213 214 // foreach ( array_keys( $languages ) as $language ) { 215 // $duplicate_product_id = apply_filters( 'wpml_object_id', $woo_cart_param['product_id'], $post_type, false, $language ); 216 // if ( $duplicate_product_id ) { 217 // $woocommerce->cart->add_to_cart( $duplicate_product_id, $params['quantity'], null, array(), $woo_cart_param ); 218 // } 219 // } 220 205 221 $woocommerce->cart->add_to_cart( $woo_cart_param['product_id'], $params['quantity'], null, array(), $woo_cart_param ); 206 222 } … … 210 226 } 211 227 212 // add_action( 'hotel_booking_added_cart', array( $this, 'hotel_add_to_cart' ), 10, 2 );228 // add_action( 'hotel_booking_added_cart', array( $this, 'hotel_add_to_cart' ), 10, 2 ); 213 229 214 230 do_action( 'hb_wc_after_add_to_cart', $cart_item_id, $params ); … … 224 240 remove_action( 'hotel_booking_remove_cart_item', array( $this, 'hotel_remove_cart_item' ), 10 ); 225 241 global $woocommerce; 242 243 if ( ! $woocommerce->cart ) { 244 return; 245 } 226 246 227 247 $woo_cart_items = $woocommerce->cart->cart_contents;
Note: See TracChangeset
for help on using the changeset viewer.