Skip to content

Commit

Permalink
Merge pull request #158 from Makewebbetter/v1.2.0
Browse files Browse the repository at this point in the history
V1.2.0
  • Loading branch information
sumitshukla-cedcoss authored Nov 30, 2021
2 parents 7e04563 + 90d42d6 commit b6da3c1
Show file tree
Hide file tree
Showing 26 changed files with 1,618 additions and 616 deletions.
60 changes: 41 additions & 19 deletions README.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
=== Subscriptions For WooCommerce ===
=== Subscriptions For WooCommerce - Subscription plugin for collecting recurring revenue, sell membership subscription services & products ===
Contributors: makewebbetter
Donate link: https://makewebbetter.com/
Tags: subscription, subscriptions, woocommerce, recurring revenue, woocommerce subscription
Requires at least: 4.6
Tested up to: 5.8.1
Tested up to: 5.8.2
WC requires at least: 4.0
WC tested up to: 5.7.1
Stable tag: 1.1.0
WC tested up to: 5.9
Stable tag: 1.2.0
Requires PHP: 7.3.5 or higher
License: GNU General Public License v3.0
License URI: http://www.gnu.org/licenses/gpl-3.0.html
Expand All @@ -32,6 +32,8 @@ Subscriptions for WooCommerce Plugin allows WooCommerce merchants to provide the
* Limit the free trial and set frequency for it
* Charge initial fees on subscription-based products and services
* Cancel WooCommerce subscriptions anytime
* Subscription status will be on hold when order status fails
* Subscription will automatically be cancelled when the order is cancelled.
* Full control of subscriptions management
* Show Recurring Frequency in subscription List Table
* Multistep setup for auto configurations of the subscription plugin and its requirements.
Expand All @@ -40,20 +42,26 @@ Subscriptions for WooCommerce Plugin allows WooCommerce merchants to provide the

== Plugin Compatibility ==

**1)** [**Wallet System For WooCommerce**](https://wordpress.org/plugins/wallet-system-for-woocommerce/)
**1)** [**Membership For WooCommerce**](https://wordpress.org/plugins/membership-for-woocommerce/) and [**Membership for WooCommerce Pro**](https://makewebbetter.com/product/membership-for-woocommerce-pro/?utm_source=subscriptions-org&utm_medium=membership-pro)
Offer subscription of membership plans on your store with the Membership for WooCommerce WordPress plugin. Create multiple membership plans and allow limited access to those plans to users. Set membership subscription expiry period from days, weeks, months and years.


**2)** [**Wallet System For WooCommerce**](https://wordpress.org/plugins/wallet-system-for-woocommerce/)
The wallet system enables a digital wallet on your eCommerce store for users. Its compatibility allows users to pay for their subscriptions via a digital wallet. Customers can buy subscriptions using the Wallet amount as a discount (not a payment gateway). The renewal order will also be discounted based on wallet amount

**2)** [**MWB Multi-Currency Switcher For WooCommerce**](https://wordpress.org/plugins/mwb-multi-currency-switcher-for-woocommerce/)
**3)** [**MWB Multi-Currency Switcher For WooCommerce**](https://wordpress.org/plugins/mwb-multi-currency-switcher-for-woocommerce/)
Multi-currency switcher compatibility allows the admin to display subscriptions price in users' local currency. Set upto three currencies on your store and accept subscription payments. The multi-currency switcher changes the subscription product price based on currency.

The renewal order will also be placed based on the currency selected at the time of subscription order. Moreover, the subscription coupons will also work based on the same selected currency.
The renewal order will also be placed based on the currency selected at the time of the subscription order. Moreover, the subscription coupons will also work based on the same selected currency.

**3)** [**MWB Role Based Pricing for WooCommerce**](https://wordpress.org/plugins/mwb-role-based-pricing-for-woocommerce/)
**4)** [**MWB Role Based Pricing for WooCommerce**](https://wordpress.org/plugins/mwb-role-based-pricing-for-woocommerce/)
Offer different subscription prices based on user roles on your eCommerce store. Enable user-role-based discounts on subscription plans. It is compatible with both subscription plugins, free and pro versions.

**4)** **WPML Compatibility**
Subscriptions for WooCommerce WPML compatibility enables the admin to create text in different languages. It allows simple language translation in your store.
**5)** [**Abandoned Cart for WooCommerce**](https://wordpress.org/plugins/abandoned-cart-for-woocommerce/)
Use the Abandoned cart for WooCommerce WordPress plugin that is compatible with Subscriptions for WooCommerce. The admin can efficiently use this compatibility for recovering the abandoned subscriptions by the users. Select user roles to track abandoned subscription plans and send abandoned cart emails for the same.

**6)** **WPML Compatibility**
Subscriptions for WooCommerce WPML compatibility enables the admin to create text in different languages. It allows simple language translation in your store.

== PLUGIN MEETS YOUR REQUIREMENT, SO ==
[**Download Now!!**](https://downloads.wordpress.org/plugin/subscriptions-for-woocommerce.zip)
Expand Down Expand Up @@ -120,6 +128,10 @@ Visit [**Subscriptions For WooCommerce Documentation**](http://docs.makewebbette
If you need support or have any questions then kindly use our online chat window [here](https://makewebbetter.com/?utm_source=MWB-subscriptions-org&utm_medium=MWB-org-page&utm_campaign=MWB-subscriptions-org) or connect with us then or connect with us then [**Generate a Ticket**](https://makewebbetter.com/submit-query/?utm_source=MWB-subscriptions-org&utm_medium=MWB-org-page&utm_campaign=MWB-subscriptions-org)
If our documentation doesn't contain the solution to your problem, you can visit the [**MakeWebBetter Forums**](https://forums.makewebbetter.com/?utm_source=MWB-subscriptions-org&utm_medium=MWB-org-page&utm_campaign=MWB-subscriptions-org) with your question.

== CONTRIBUTE AND TRANSLATE ==

Subscriptions for WooCommerce is translated into multiple languages Dutch, Albanian, Spanish and many more. Help localize Subscriptions for WooCommerce even further by adding your locale Language. [**Click Here**](https://translate.wordpress.org/projects/wp-plugins/subscriptions-for-woocommerce/)

== Installation ==

= Automatic installation =
Expand Down Expand Up @@ -179,6 +191,10 @@ This is not possible in the free plugin, the client can add multiple subscriptio

Yes, we have our Premium Version of [WooCommerce Subscriptions Pro](https://makewebbetter.com/product/woocommerce-subscriptions-pro/?utm_source=MWB-subscriptions-org&utm_medium=MWB-ORG-Page&utm_campaign=MWB-subscriptions-pro) to manage subscriptions with many features.

= Is this Subscription plugin working with the variable products too? =

No in a free plugin it will only work with the simple product but in the pro version of Subscriptions for WooCommerce, it will work with simple and pro both.

= My question is not listed? =

Please visit the [MakeWebBetter Knowledgebase](https://support.makewebbetter.com/wordpress-plugins-knowledge-base/category/subscriptions-for-woocommerce-kb/?utm_source=MWB-subscriptions-org&utm_medium=MWB-org-page&utm_campaign=MWB-subscriptions-faq) and for more details visit [Subscriptions For WooCommerce Documentation](https://docs.makewebbetter.com/subscriptions-for-woocommerce/?utm_source=MWB-subscriptions-org&utm_medium=MWB-org-page&utm_campaign=MWB-subscriptions-faq).
Expand All @@ -196,6 +212,14 @@ Please visit the [MakeWebBetter Knowledgebase](https://support.makewebbetter.com

== Changelog ==

= 1.2.0 - RELEASED ON 30 November 2021 =

* Fix: Minor bugs and issues.
* New: Compatibility with [**Membership For WooCommerce**](https://wordpress.org/plugins/membership-for-woocommerce/).
* New: Compatibility with [**Membership for WooCommerce Pro**](https://makewebbetter.com/product/membership-for-woocommerce-pro/?utm_source=subscriptions-org&utm_medium=membership-pro).
* New: Compatibility with [**Abandoned Cart for WooCommerce**](https://wordpress.org/plugins/abandoned-cart-for-woocommerce/).
* New: On-hold subscription status added when order status is failed.

= 1.1.0 - RELEASED ON 1 October 2021 =

* New: Compatibility with [Wallet System For WooCommerce](https://wordpress.org/plugins/wallet-system-for-woocommerce/)
Expand All @@ -204,7 +228,7 @@ Please visit the [MakeWebBetter Knowledgebase](https://support.makewebbetter.com
* New: Compatibility with WPML
* New: Supported Paypal express checkout payment gateway
* New: Multistep setting configuration.
* New: Show renewal order log.
* New: Show renewal

= 1.0.3 - RELEASED ON 31 August 2021 =

Expand Down Expand Up @@ -232,12 +256,10 @@ Please visit the [MakeWebBetter Knowledgebase](https://support.makewebbetter.com

== Upgrade Notice ==

= 1.1.0 - RELEASED ON 1 October 2021 =
= 1.2.0 - RELEASED ON 30 November 2021 =

* New: Compatibility with [Wallet System For WooCommerce](https://wordpress.org/plugins/wallet-system-for-woocommerce/)
* New: Compatibility with [MWB Multi-Currency Switcher](https://wordpress.org/plugins/mwb-multi-currency-switcher-for-woocommerce/)
* New: Compatibility with [MWB Role Based Pricing for WooCommerce](https://wordpress.org/plugins/mwb-role-based-pricing-for-woocommerce/)
* New: Compatibility with WPML
* New: Supported Paypal express checkout payment gateway
* New: Multistep setting configuration.
* New: Show renewal Order log.
* Fix: Minor bugs and issues.
* New: Compatibility with [**Membership For WooCommerce**](https://wordpress.org/plugins/membership-for-woocommerce/).
* New: Compatibility with [**Membership for WooCommerce Pro**](https://makewebbetter.com/product/membership-for-woocommerce-pro/?utm_source=subscriptions-org&utm_medium=membership-pro).
* New: Compatibility with [**Abandoned Cart for WooCommerce**](https://wordpress.org/plugins/abandoned-cart-for-woocommerce/).
* New: On-hold subscription status added when order status is failed.
53 changes: 49 additions & 4 deletions admin/class-subscriptions-for-woocommerce-admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,8 @@ public function mwb_sfw_admin_enqueue_scripts( $hook ) {
'sfw_product_param',
$mwb_sfw_data
);
wp_enqueue_script( 'jquery-ui-datepicker' );

}
}

Expand All @@ -207,15 +209,58 @@ public function mwb_sfw_admin_enqueue_scripts( $hook ) {
public function mwb_sfw_options_page() {
global $submenu;
if ( empty( $GLOBALS['admin_page_hooks']['mwb-plugins'] ) ) {

add_menu_page( 'MakeWebBetter', 'MakeWebBetter', 'manage_options', 'mwb-plugins', array( $this, 'mwb_plugins_listing_page' ), SUBSCRIPTIONS_FOR_WOOCOMMERCE_DIR_URL . 'admin/images/mwb-logo.png', 15 );
// Add menus.
if ( mwb_sfw_check_multistep() ) {
add_submenu_page( 'mwb-plugins', 'Home', 'Home', 'manage_options', 'home', array( $this, 'mwb_sfw_welcome_callback_function' ) );
}
$sfw_menus = apply_filters( 'mwb_add_plugins_menus_array', array() );
if ( is_array( $sfw_menus ) && ! empty( $sfw_menus ) ) {
foreach ( $sfw_menus as $sfw_key => $sfw_value ) {
add_submenu_page( 'mwb-plugins', $sfw_value['name'], $sfw_value['name'], 'manage_options', $sfw_value['menu_link'], array( $sfw_value['instance'], $sfw_value['function'] ) );
}
}
} else {
$is_home = false;
if ( ! empty( $submenu['mwb-plugins'] ) ) {
foreach ( $submenu['mwb-plugins'] as $key => $value ) {
if ( 'Home' === $value[0] ) {
$is_home = true;
}
}
if ( ! $is_home ) {
if ( mwb_sfw_check_multistep() ) {
add_submenu_page( 'mwb-plugins', 'Home', 'Home', 'manage_options', 'home', array( $this, 'mwb_sfw_welcome_callback_function' ), 1 );
}
}
}
}
add_submenu_page( 'woocommerce', __( 'Mwb Subscriptions', 'subscriptions-for-woocommerce' ), __( 'Mwb Subscriptions', 'subscriptions-for-woocommerce' ), 'manage_options', 'subscriptions-for-woocommerce', array( $this, 'mwb_sfw_addsubmenu_woocommerce' ) );

}

/**
* This function is used to add submenu of subscription inside woocommerce.
*
* @since 1.2.0
* @return void
*/
public function mwb_sfw_addsubmenu_woocommerce() {
$permalink = admin_url( 'admin.php?page=subscriptions_for_woocommerce_menu&sfw_tab=subscriptions-for-woocommerce-subscriptions-table' );
wp_safe_redirect( $permalink );
exit;
}

/**
*
* Adding the default menu into the wordpress menu
*
* @name makewebbetter_callback_function
* @since 1.0.0
*/
public function mwb_sfw_welcome_callback_function() {
include SUBSCRIPTIONS_FOR_WOOCOMMERCE_DIR_PATH . 'admin/partials/subscriptions-for-woocommerce-welcome.php';
}

/**
Expand Down Expand Up @@ -830,10 +875,11 @@ public function mwb_developer_public_hooks_listing() {
}
return $public_hooks;
}

/**
* Developer_hooks_function
* Developer_hooks_function.
*
* @name mwb_developer_hooks_function
* @name mwb_developer_hooks_function.
* @param string $path Path of the file.
*/
public function mwb_developer_hooks_function( $path ) {
Expand Down Expand Up @@ -866,7 +912,7 @@ public function mwb_developer_hooks_function( $path ) {
/**
* Check for multistep.
*
* @name mwb_sfw_check_plugin_already_enable
* @name mwb_sfw_check_plugin_already_enable.
* @param bool $bool bool.
*/
public function mwb_sfw_check_plugin_already_enable( $bool ) {
Expand All @@ -878,5 +924,4 @@ public function mwb_sfw_check_plugin_already_enable( $bool ) {
}
return $bool;
}

}
10 changes: 10 additions & 0 deletions admin/js/subscription-for-woocommerce-product-edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@
'use strict';

$(document).ready(function() {

var dateToday = new Date();
$(function() {
$( ".mwb_sfw_subscription_start_date" ).datepicker({
showButtonPanel: true,
dateFormat: 'yy-mm-dd',
minDate: dateToday
});
});

function mwb_sfw_show_subscription_settings_tab(){
if( $('#_mwb_sfw_product').prop('checked') ) {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,10 @@ public function column_cb( $item ) {
* @link https://www.makewebbetter.com/
*/
public function mwb_sfw_get_subscription_list() {
$mwb_sfw_pro_plugin_activated = false;
if ( in_array( 'woocommerce-subscriptions-pro/woocommerce-subscriptions-pro.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ) {
$mwb_sfw_pro_plugin_activated = true;
}

$args = array(
'numberposts' => -1,
Expand Down Expand Up @@ -348,10 +352,25 @@ public function mwb_sfw_get_subscription_list() {

$mwb_next_payment_date = get_post_meta( $value->ID, 'mwb_next_payment_date', true );
$mwb_susbcription_end = get_post_meta( $value->ID, 'mwb_susbcription_end', true );
if ( $mwb_next_payment_date === $mwb_susbcription_end ) {
$mwb_next_payment_date = '';
}

if ( 'on-hold' === $mwb_subscription_status ) {
$mwb_next_payment_date = '';
$mwb_recurring_total = '---';
}
$mwb_customer_id = get_post_meta( $value->ID, 'mwb_customer_id', true );
$user = get_user_by( 'id', $mwb_customer_id );

if ( ! $mwb_sfw_pro_plugin_activated ) {
$subp_id = get_post_meta( $value->ID, 'product_id', true );
$check_variable = get_post_meta( $subp_id, 'mwb_sfw_variable_product', true );
if ( 'yes' === $check_variable ) {
continue;
}
}

$user_nicename = isset( $user->user_nicename ) ? $user->user_nicename : '';
$mwb_subscriptions_data[] = apply_filters(
'mwb_sfw_subs_table_data',
Expand Down
36 changes: 0 additions & 36 deletions admin/partials/subscriptions-for-woocommerce-developer.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,42 +26,6 @@
?>
<!-- template file for admin settings. -->
<div class="sfw-section-wrap">
<?php
global $sfw_mwb_sfw_obj;
// Tracking settings.
$mwb_sfw_tracking_fields_array = apply_filters(
'mwb_sfw_tracking_fields_array',
array(
array(
'title' => __( 'Enable Tracking', 'subscriptions-for-woocommerce' ),
'type' => 'radio-switch',
'description' => __( 'Allow usage of this plugin to be tracked', 'subscriptions-for-woocommerce' ),
'id' => 'mwb_sfw_enable_tracking',
'value' => get_option( 'mwb_sfw_enable_tracking' ),
'class' => 'sfw-radio-switch-class',
'options' => array(
'yes' => __( 'YES', 'subscriptions-for-woocommerce' ),
'no' => __( 'NO', 'subscriptions-for-woocommerce' ),
),
),
array(
'type' => 'button',
'id' => 'sfw_track_button',
'button_text' => __( 'Save', 'subscriptions-for-woocommerce' ),
'class' => 'sfw-button-class',
),
)
);
?>
<form action="" method="POST" class="mwb-sfw-gen-section-form">
<div class="sfw-secion-wrap">
<?php
$mps_tracking_html = $sfw_mwb_sfw_obj->mwb_sfw_plug_generate_html( $mwb_sfw_tracking_fields_array );
echo esc_html( $mps_tracking_html );
wp_nonce_field( 'mwb-sfw-general-nonce', 'mwb-sfw-general-nonce-field' );
?>
</div>
</form>
<div class="mwb-col-wrap">

<div id="admin-hooks-listing" class="table-responsive mdc-data-table">
Expand Down
Loading

0 comments on commit b6da3c1

Please sign in to comment.