Plugin Directory

Changeset 3319262


Ignore:
Timestamp:
06/28/2025 10:05:57 PM (9 months ago)
Author:
ivole
Message:

5.80.1

Location:
customer-reviews-woocommerce
Files:
878 added
5 edited

Legend:

Unmodified
Added
Removed
  • customer-reviews-woocommerce/trunk/class-ivole.php

    r3318495 r3319262  
    8383
    8484class Ivole {
    85     const CR_VERSION = '5.80.0';
     85    const CR_VERSION = '5.80.1';
    8686
    8787    public function __construct() {
  • customer-reviews-woocommerce/trunk/includes/reminders/class-cr-local-forms.php

    r3318495 r3319262  
    99    class CR_Local_Forms {
    1010        private $form_id;
     11        private $order_id;
    1112        private $items;
    1213        private $customer_email;
     
    4445                $this->form_header = $record->formHeader;
    4546                $this->form_body = $record->formBody;
     47                $this->order_id = $record->orderId;
    4648                $this->items = json_decode( $record->items );
    4749                $this->cr_form_color1 = get_option( 'ivole_form_color_bg', '#2C5E66' );
     
    183185                $cr_form_item_rating_name = __( 'Rating', 'customer-reviews-woocommerce' );
    184186                $cr_form_item_image = $item->image;
     187                // WPML Multi-currency compatibility
     188                $price_args = array();
     189                if ( self::TEST_FORM !== $this->form_id ) {
     190                    if ( has_filter( 'wpml_translate_single_string' ) && ! function_exists( 'pll_get_post' ) ) {
     191                        $order_obj = wc_get_order( $this->order_id );
     192                        if ( $order_obj ) {
     193                            $currency = $order_obj->get_currency();
     194                            if ( $currency ) {
     195                                $price_args['currency'] = $currency;
     196                            }
     197                        }
     198                    }
     199                }
     200                //
    185201                if ( isset( $item->pricePerItem ) ) {
    186                     $cr_form_item_price = CR_Email_Func::cr_price( $item->pricePerItem );
     202                    $cr_form_item_price = CR_Email_Func::cr_price( $item->pricePerItem, $price_args );
    187203                } else {
    188                     $cr_form_item_price = CR_Email_Func::cr_price( $item->price );
     204                    $cr_form_item_price = CR_Email_Func::cr_price( $item->price, $price_args );
    189205                }
    190206                $cr_form_media_enabled = ( 'yes' === get_option( 'ivole_form_attach_media', 'no' ) ? true : false );
     
    318334                                `language` varchar(10) DEFAULT NULL,
    319335                                `extra` text DEFAULT NULL,
    320                                 `dateCreated` datetime DEFAULT NULL
     336                                `dateCreated` datetime DEFAULT NULL,
    321337                                PRIMARY KEY (`formId`),
    322338                                KEY `orderId_index` (`orderId`),
  • customer-reviews-woocommerce/trunk/includes/reviews/class-cr-endpoint.php

    r3300332 r3319262  
    6464                    $local_reviews_notif = array();
    6565                    $reviews = array();
     66                    $wpml_current_lang = '';
    6667
    6768                    //check if registered customers option is used
     
    147148                                $shop_custom_questions->parse_shop_questions( $body2->order );
    148149
    149                                 //WPML integration
    150                                 //wc_get_page_id returns shop page ID in the default WPML site language
    151                                 //If a review was submitted in a language different from the default one, it is necessary to get shop page ID for the non-default language
    152                                 $wpml_current_lang = '';
    153                                 if ( has_filter( 'wpml_object_id' ) ) {
    154                                     $wpml_order_language = $order->get_meta( 'wpml_language', true );
    155                                     $shop_page_id = apply_filters( 'wpml_object_id', $shop_page_id, 'page', true, $wpml_order_language );
    156                                     //switch the current WPML site language to the language of the order because
    157                                     //call to get_comments (below) returns only comments for shop page in the current WPML language
    158                                     $wpml_current_lang = apply_filters( 'wpml_current_language', null );
    159                                     do_action( 'wpml_switch_language', $wpml_order_language );
    160                                 }
    161                                 if ( has_filter( 'wpml_object_id' ) ) {
    162                                     if( class_exists( 'WCML_Comments' ) ) {
    163                                         global $woocommerce_wpml;
    164                                         if( $woocommerce_wpml ) {
    165                                             remove_action( 'added_comment_meta', array( $woocommerce_wpml->comments, 'maybe_duplicate_comment_rating' ), 10, 4 );
    166                                         }
    167                                     }
    168                                 }
    169150                                // Polylang integration
    170151                                if ( function_exists( 'pll_get_post' ) && function_exists( 'pll_get_post_language' ) ) {
    171152                                    $polylang_order_language = pll_get_post_language( $order_id );
    172                                     if( $polylang_order_language ) {
     153                                    if ( $polylang_order_language ) {
    173154                                        $shop_page_id = pll_get_post( $shop_page_id, $polylang_order_language  );
     155                                    }
     156                                } else {
     157                                    // WPML integration
     158                                    // wc_get_page_id returns shop page ID in the default WPML site language
     159                                    // If a review was submitted in a language different from the default one, it is necessary to get shop page ID for the non-default language
     160                                    if ( has_filter( 'wpml_object_id' ) ) {
     161                                        $wpml_order_language = $order->get_meta( 'wpml_language', true );
     162                                        $shop_page_id = apply_filters( 'wpml_object_id', $shop_page_id, 'page', true, $wpml_order_language );
     163                                        //switch the current WPML site language to the language of the order because
     164                                        //call to get_comments (below) returns only comments for shop page in the current WPML language
     165                                        $wpml_current_lang = apply_filters( 'wpml_current_language', null );
     166                                        do_action( 'wpml_switch_language', $wpml_order_language );
     167                                        //
     168                                        if( class_exists( 'WCML_Comments' ) ) {
     169                                            global $woocommerce_wpml;
     170                                            if( $woocommerce_wpml ) {
     171                                                remove_action( 'added_comment_meta', array( $woocommerce_wpml->comments, 'maybe_duplicate_comment_rating' ), 10, 4 );
     172                                            }
     173                                        }
    174174                                    }
    175175                                }
     
    273273                                    }
    274274                                }
    275                                 //WPML integration
    276                                 if ( has_filter( 'wpml_object_id' ) ) {
     275                                // WPML integration
     276                                if ( has_filter( 'wpml_object_id' ) && ! function_exists( 'pll_get_post' ) ) {
    277277                                    do_action( 'wpml_switch_language', $wpml_current_lang );
    278                                 }
    279                                 //WPML integration
    280                                 if ( has_filter( 'wpml_object_id' ) ) {
    281                                     if( class_exists( 'WCML_Comments' ) ) {
     278                                    //
     279                                    if ( class_exists( 'WCML_Comments' ) ) {
    282280                                        global $woocommerce_wpml;
    283                                         if( $woocommerce_wpml ) {
     281                                        if ( $woocommerce_wpml ) {
    284282                                            add_action( 'added_comment_meta', array( $woocommerce_wpml->comments, 'maybe_duplicate_comment_rating' ), 10, 4 );
    285283                                        }
     
    354352                                $order_item_product_id = intval( $body2->order->items[$i]->id );
    355353
    356                                 //WPML integration
    357                                 //The order contains product ID of the product in the default WPML site language
    358                                 //If a review was submitted in a language different from the default one, it is necessary to get product ID for the non-default language
    359                                 $wpml_current_lang = '';
    360                                 if ( has_filter( 'wpml_object_id' ) ) {
    361                                     $wpml_order_language = $order->get_meta( 'wpml_language', true );
    362                                     $order_item_product_id = apply_filters( 'wpml_object_id', $order_item_product_id, 'product', true, $wpml_order_language );
    363                                     //switch the current WPML site language to the language of the order because
    364                                     //call to get_comments (below) returns only comments for products in the current WPML language
    365                                     $wpml_current_lang = apply_filters( 'wpml_current_language', null );
    366                                     do_action( 'wpml_switch_language', $wpml_order_language );
    367                                 }
    368354                                // Polylang integration
    369355                                if ( function_exists( 'pll_get_post' ) && function_exists( 'pll_get_post_language' ) ) {
    370356                                    $polylang_order_language = pll_get_post_language( $order_id );
    371                                     if( $polylang_order_language ) {
     357                                    if ( $polylang_order_language ) {
    372358                                        $order_item_product_id = pll_get_post( $order_item_product_id, $polylang_order_language  );
     359                                    }
     360                                } else {
     361                                    // WPML integration
     362                                    // The order contains product ID of the product in the default WPML site language
     363                                    // If a review was submitted in a language different from the default one, it is necessary to get product ID for the non-default language
     364                                    if ( has_filter( 'wpml_object_id' ) ) {
     365                                        $wpml_order_language = $order->get_meta( 'wpml_language', true );
     366                                        $order_item_product_id = apply_filters( 'wpml_object_id', $order_item_product_id, 'product', true, $wpml_order_language );
     367                                        //switch the current WPML site language to the language of the order because
     368                                        //call to get_comments (below) returns only comments for products in the current WPML language
     369                                        $wpml_current_lang = apply_filters( 'wpml_current_language', null );
     370                                        do_action( 'wpml_switch_language', $wpml_order_language );
    373371                                    }
    374372                                }
     
    510508                                }
    511509                                // WPML integration
    512                                 if ( has_filter( 'wpml_object_id' ) ) {
     510                                if ( has_filter( 'wpml_object_id' ) && ! function_exists( 'pll_get_post' ) ) {
    513511                                    do_action( 'wpml_switch_language', $wpml_current_lang );
    514512                                }
  • customer-reviews-woocommerce/trunk/ivole.php

    r3318495 r3319262  
    44Description: Customer Reviews for WooCommerce plugin helps you get more customer reviews for your shop by sending automated reminders and coupons.
    55Plugin URI: https://wordpress.org/plugins/customer-reviews-woocommerce/
    6 Version: 5.80.0
     6Version: 5.80.1
    77Author: CusRev
    88Author URI: https://www.cusrev.com/business/
  • customer-reviews-woocommerce/trunk/readme.txt

    r3318495 r3319262  
    55Tested up to: 6.8
    66Requires PHP: 7.2
    7 Stable tag: 5.80.0
     7Stable tag: 5.80.1
    88License: GPLv3 or later
    99License URI: https://www.gnu.org/licenses/gpl.html
     
    234234== Changelog ==
    235235
     236= 5.80.1 =
     237* Improvement: Polylang compatibility
     238* Improvement: WPML Multicurrency compatibility for local aggregated review forms
     239* Bug fix: a table for local forms could not be created for new websites
    236240= 5.80.0 =
    237241* New feature: a setting to expire local aggregated review forms after a specified number of days
Note: See TracChangeset for help on using the changeset viewer.