| Server IP : 104.21.25.182 / Your IP : 216.73.217.68 Web Server : Apache System : Linux server.rehabsharif.com 5.14.0-611.54.3.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Thu May 7 16:31:24 EDT 2026 x86_64 User : nobi37te ( 1003) PHP Version : 8.2.33 Disable Function : exec,passthru,shell_exec,system MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /home/nobi37te/public_html/wp-content/plugins/woocommerce-multi-currency/plugins/ |
Upload File : |
<?php
/**
* Class WOOMULTI_CURRENCY_Plugin_Bookly
* Author: Bookly
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
use Bookly\Lib as BooklyLib;
class WOOMULTI_CURRENCY_Plugin_Bookly {
protected $settings;
public function __construct() {
$this->settings = WOOMULTI_CURRENCY_Data::get_ins();
if ( is_plugin_active( 'bookly-responsive-appointment-booking-tool/main.php' ) ) {
add_filter( 'woocommerce_cart_item_price', array( $this, 'woocommerce_cart_item_price' ), 20, 3 );
}
}
public function woocommerce_cart_item_price( $product_price, $wc_item, $cart_item_key ) {
if ( isset ( $wc_item['bookly'] ) ) {
$userData = new BooklyLib\UserBookingData( null );
$userData->fillData( $wc_item['bookly'] );
$userData->cart->setItemsData( $wc_item['bookly']['items'] );
$cart_info = $userData->cart->getInfo();
if ( 'excl' === get_option( 'woocommerce_tax_display_cart' ) && BooklyLib\Config::taxesActive() ) {
$product_price = wc_price( wmc_get_price( $cart_info->getPayNow() - $cart_info->getPayTax() ) );
} else {
$product_price = wc_price( wmc_get_price( $cart_info->getPayNow() ) );
}
}
return $product_price;
}
}