Plugin Directory

Changeset 3252744


Ignore:
Timestamp:
03/09/2025 05:06:29 AM (13 months ago)
Author:
wclovers
Message:

WCFM Marketplace 3.6.14 version update

Location:
wc-multivendor-marketplace
Files:
980 added
7 edited

Legend:

Unmodified
Added
Removed
  • wc-multivendor-marketplace/trunk/core/class-wcfmmp-commission.php

    r3108215 r3252744  
    10421042                    $pproduct_id   = $line_item->get_product_id();
    10431043                    $pvariation_id = $line_item->get_variation_id();
    1044                     $quantity      = $line_item->get_quantity();
    10451044                    if (($pvariation_id && $variation_id && ($variation_id == $pvariation_id)) || (!$pvariation_id && $pproduct_id && ($product_id == $pproduct_id))) {
    10461045                        $pvendor_id = wcfm_get_vendor_id_by_post($product_id);
    10471046                        if ($pvendor_id && ($pvendor_id == $vendor_id)) {
     1047                            $quantity      = $line_item->get_quantity();
    10481048                            if (!$item_total) {
    10491049                                $line_item_total = $line_item->get_total() + $line_item->get_total_tax();
  • wc-multivendor-marketplace/trunk/helpers/class-wcfmmp-store-setup.php

    r3156420 r3252744  
    620620                        } else {
    621621                            $message = __('You are not connected with stripe.', 'wc-frontend-manager');
    622                             $url = add_query_arg( array( 'stripe_action' => 'connect' ), $payment_url );
     622                            $url = add_query_arg([
     623                                'stripe_action'     => 'connect',
     624                                'vendor_country'    => $stripe_client->get_platform_country()
     625                            ], $payment_url);
    623626                            $btn_text = __('Connect with Stripe', 'wc-frontend-manager');
    624627                            $btn_class = "stripe-connect";
     
    644647                                            <th></th>
    645648                                            <td>
    646                                                 <a class="<?php echo $btn_class; ?>" style="float:none;" href=<?php echo $url; ?> target="_self"><span><?php echo $btn_text; ?></span></a>
     649                                                <a id="stripe-connect-btn" class="<?php echo $btn_class; ?>" style="float:none;" href=<?php echo $url; ?> target="_self"><span><?php echo $btn_text; ?></span></a>
    647650                                            </td>
    648651                                        </tr>
     652                                        <?php if (!$stripe_client->is_connected_to_stripe()) { ?>
     653                                            <tr>
     654                                                <td></td>
     655                                                <td>
     656                                                <?php
     657                                                    $country_codes = $stripe_client->get_supported_transfer_countries();
     658
     659                                                    if (!empty($country_codes)) {
     660                                                        $countries = WC()->countries->get_countries();
     661                                                        $supported_transfer_countries = [];
     662
     663                                                        foreach ($country_codes as $country_code) {
     664                                                            if (isset($countries[$country_code])) {
     665                                                                $supported_transfer_countries[$country_code] = $countries[$country_code];
     666                                                            }
     667                                                        }
     668
     669                                                        // Sort the array by country name (values)
     670                                                        asort($supported_transfer_countries);
     671
     672                                                        ?>
     673                                                        <select id="stripe_vendor_country" name="stripe_vendor_country" class="wcfm-select wcfm_ele">
     674                                                            <?php   
     675                                                            foreach ($supported_transfer_countries as $country_code => $country_name) {
     676                                                                ?>
     677                                                                <option value="<?php echo $country_code; ?>" <?php selected($stripe_client->get_platform_country(), $country_code); ?>><?php echo $country_name; ?></option>
     678                                                                <?php
     679                                                            }
     680                                                            ?>
     681                                                        </select>
     682                                                        <p class="description"><?php _e('Please select your country, as this will be used to configure your Stripe payment settings.', 'wc-frontend-manager'); ?></p>
     683                                                        <script>
     684                                                            jQuery('#stripe_vendor_country').on('change', (e) => {
     685                                                                e.preventDefault();
     686
     687                                                                const $connectBtn = jQuery('#stripe-connect-btn');
     688
     689                                                                const countryCode = jQuery(e.currentTarget).val();
     690
     691                                                                const url = new URL($connectBtn.attr('href'));
     692
     693                                                                url.searchParams.set('vendor_country', countryCode);
     694
     695                                                                $connectBtn.attr('href', url);
     696                                                            });
     697                                                        </script>
     698                                                        <?php
     699                                                    }
     700                                                    ?>
     701                                                </td>
     702                                            </tr>
     703                                        <?php } ?>
    649704                                    </tbody>
    650705                                </table>
  • wc-multivendor-marketplace/trunk/includes/payment-gateways/class-wcfmmp-gateway-stripe.php

    r3156420 r3252744  
    123123    private function process_stripe_payment( $args = array() ) {
    124124        global $WCFM, $WCFMmp;
     125       
    125126        try {
    126127            Stripe::setApiKey($this->secret_key);
    127             $transfer_args = array(
    128                     'amount'              => $this->get_stripe_amount(),
    129                     'currency'            => $this->currency,
    130                     'destination'         => $this->stripe_user_id,
    131                     'description'         => __('Payout for withdrawal ID #', 'wc-multivendor-marketplace') . sprintf( '%06u', $this->withdrawal_id )
    132             );
    133 
    134             if (apply_filters( 'wcfmmp_stripe_split_pay_source_transaction_enabled', true, $this->vendor_id )) {
    135                 /**
    136                  *  Checks if $args['source_transaction'] is provided and not empty.
    137                  *  P.S. we don't use 'source_transaction' as it cannot be empty.
    138                  */
    139                 if (isset($args['source_transaction']) && !empty($args['source_transaction'])) {
    140                     /**
    141                      *  Setting $transfer_args['source_transaction'] to '' ensures it is included in wp_parse_args(),
    142                      *  preventing it from being omitted.
    143                      */
    144                     $transfer_args['source_transaction'] = '';
    145                 }
    146             }
     128
     129            $transfer_args = apply_filters('wcfmmp_stripe_default_transfer_args', [
     130                'amount'        => $this->get_stripe_amount(),
     131                'currency'      => $this->currency,
     132                'destination'   => $this->stripe_user_id,
     133                'description'   => __('Payout for withdrawal ID #', 'wc-multivendor-marketplace') . sprintf( '%06u', $this->withdrawal_id ),
     134            ], $this);
    147135
    148136            if( $this->transaction_mode == 'manual' ) {
  • wc-multivendor-marketplace/trunk/includes/payment-gateways/class-wcfmmp-gateway-stripe_split.php

    r3161935 r3252744  
    467467                    $capabilities = get_user_meta( $vendor_id, 'stripe_account_capabilities', true );
    468468
    469                     if (!$capabilities) {
     469                    if (!$capabilities || apply_filters('wcfmmp_refresh_stripe_account_capabilities', false, $vendor_id)) {
    470470                        $stripe_client->set_user_id($vendor_id);
    471471                        $stripe_account_obj = $stripe_client->retrieve_account();
     
    480480                        !is_object($capabilities) ||
    481481                        !isset($capabilities->card_payments) ||
    482                         'active' == $capabilities->card_payments
     482                        'active' !== $capabilities->card_payments
    483483                    ) {
    484484                        $all_vendor_supports_card_payments = false;
     
    488488
    489489                if (!$all_vendor_supports_card_payments) {
    490 
    491                     wcfm_stripe_log("Stripe Charge Type changed from {$this->charge_type} to transfers_charges, as some vendors doesn't support card_payments", 'warning');
    492 
     490                    wcfm_stripe_log("Stripe charge type has been changed from {$this->charge_type} to transfers_charges because some vendors do not support card_payments.", 'warning');
    493491                    $this->charge_type = 'transfers_charges';
    494492                }
     
    770768                try {
    771769                    $charge_data = array(
    772                         "amount"         =>  $this->get_stripe_amount($wcfmmp_stripe_split_pay_list['total_amount']),
     770                        "amount"         => $this->get_stripe_amount($wcfmmp_stripe_split_pay_list['total_amount']),
    773771                        "currency"       => $wcfmmp_stripe_split_pay_list['currency'],
    774772                        "source"         => $wcfmmp_stripe_split_pay_list['stripe_source'],
  • wc-multivendor-marketplace/trunk/readme.txt

    r3220909 r3252744  
    66Tested up to: 6.7
    77WC requires at least: 3.0
    8 WC tested up to: 9.5.0
     8WC tested up to: 9.7.0
    99Requires PHP: 5.6
    10 Stable tag: 3.6.13
     10Stable tag: 3.6.14
    1111License: GPLv2 or later
    1212License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    255255
    256256== Changelog ==
     257
     258= 3.6.14 =
     259*Updated - 09/03/2025*
     260
     261* Enhance - WooCommerce 9.7+ compatibility check added
     262* Fixed   - Stripe vendor connect issue for cross border countries. Now vendor needs to choose from a list of supported countries.
     263* Fixed   - Minor bug fixes
    257264
    258265= 3.6.13 =
     
    17251732== Upgrade Notice ==
    17261733
    1727 = 3.6.13 =
    1728 * Enhance - WordPress 6.7+ compatibility check added
    1729 * Enhance - WooCommerce 9.5+ compatibility check added
     1734= 3.6.14 =
     1735* Enhance - WooCommerce 9.7+ compatibility check added
     1736* Fixed   - Stripe vendor connect issue for cross border countries. Now vendor needs to choose from a list of supported countries.
     1737* Fixed   - Minor bug fixes
  • wc-multivendor-marketplace/trunk/wc-multivendor-marketplace-config.php

    r3220909 r3252744  
    55define('WCFMmp_TEXT_DOMAIN', 'wc-multivendor-marketplace');
    66
    7 define('WCFMmp_VERSION', '3.6.13');
     7define('WCFMmp_VERSION', '3.6.14');
    88
    99define('WCFMmp_SERVER_URL', 'https://wclovers.com');
  • wc-multivendor-marketplace/trunk/wc-multivendor-marketplace.php

    r3220909 r3252744  
    55 * Description: Most featured and flexible marketplace solution for your e-commerce store. Simply and Smoothly.
    66 * Author: WC Lovers
    7  * Version: 3.6.13
     7 * Version: 3.6.14
    88 * Author URI: https://wclovers.com
    99 *
     
    1212 *
    1313 * WC requires at least: 3.0.0
    14  * WC tested up to: 9.5.0
     14 * WC tested up to: 9.7.0
    1515 *
    1616 */
Note: See TracChangeset for help on using the changeset viewer.