How extension works?

Installation



You will require to install MageDelight Base Extension first. If it is not installed then please download it from https://www.magedelight.com/pub/extensions/magedelight-base.zip and unzip the package file into the root folder of your Magento 2 installation.


Before installing the extension, please make sure to Backup your web directory and store database


You will require to install MageDelight Base Extension first. If it is not installed then please download it from https://www.magedelight.com/pub/extensions/magedelight-base.zip and unzip the package file into the root folder of your Magento 2 installation.

Root Directory is - "app/code/magedelight/#YourExtensionName#"

  • Unzip the extension package file into the root folder of your Magento 2 installation.
  • Connect to SSH console of your server:
    • Navigate to the root folder of your Magento 2 setup
    • Run command as per below sequence,

      php bin/magento setup:upgrade

      php bin/magento setup:di:compile

      php bin/magento setup:static-content:deploy

      php bin/magento cache:clean

  • log out from the backend and log in again


If you are using Magento 2.3 or later then you do not need to activate license. Extension will be activated with silent activation mechanism and does not require activation keys to be entered manually.   


Backend Configuration (Admin side)


Once you install and set up the extension license key (refer extension installation guide). You need to configure the extension and setting it up as per your business needs. Below are extension configuration options,

                                                                                                                       


  • Enable Subscription: Option to disable/enable the subscribe now extension feature.
  • Allowed Customer Group For Subscription:  Select the customer group to enable subscriptions for specific customer groups. You can select multiple customer groups.
  • Not Allowed Customer Group Message: Add label for specific customer groups which shows for Subscriptions Only Products.
  • Allow Guest & Not Allowed Customers to View Subscription: Option to disable/enable guest customers to view subscription products.
  • Auto-register guest when checkout with subscription product:  Option to disable/enable to auto register guest customer on the checkout page.
  • Allow Guest to Add Product to Cart: Option to disable/enable guest customers to add products.
  • Manage Subscription Interval: The admin can create different subscription intervals. This would be the combination of interval type and number of intervals and set Interval label for each interval offset.
    • Interval type: Day, Week, Month, and Year.
    • Number of intervals: Numeric positive integer values.
    • Interval Label: Admin can give interval label with regional language i.e. Interval type could be = Month, Number of intervals = 1 label could be Every Month/Once in a month.
  •  Maximum Order Failed: It can hold numeric positive integer values. To define maximum order failure allowed to the customer. Hence, if the recurring order fails, the order won’t be placed but the subscription profile will be continued. On the next occurrence script will try to place an order for the customer, till the maximum order failure is allowed. After maximum failure is over, the recurring profile will get suspended.
    If maximum order failure is set to zero (0), the subscription profile gets suspended at the first time of failure.
  • Dynamic Price: Enable placing subscription orders with the product's current price. You can disable the price of the product at the time of subscription starts.
  • Send Reminder Of Occurrence Before: The next occurrence reminder email will be sent before the number of days defined here. It should be greater than allowed to update the profile before value.
  • Send E-Wallet Topup Reminder Before: Define days to send e-wallet top-up reminder email
  • CRON JOB Frequency: Define CRON Frequency to generate orders for subscription profiles. Values could be daily, weekly, or monthly. Daily is the suggested option.
  • CRON JOB Start Time: Define CRON Start Time to generate orders for subscription profiles.


  • For No Subscription: Set the label for the single purchase option.
  • For Subscription: Set the label for the recurring purchase option.
  • Subscription Product List Page Text: Text to be shown on the product listing page, to identify/show the product is available for subscription from the product listing page.
  • Enable Summary block on cart page: Admin can define whether to show summary block on the cart page or not.


  •     Select Payment Gateway: You can select the payment gateway you like to use for your subscription. It would allow only a single payment gateway for subscriptions.



  • Select Auto Shipping Method:  If set yes, will take the lowest cost from the shipping method on subscription plans.
  • Select Shipping Method:  select shipping methods allowed for orders with subscription products or subscription plans.
  • Free Shipping For Subscription:  If set yes, will free shipping for all recurring orders and ignore shipping cost for the shipping method selected.



  • Allowed Maximum Quantity To Subscribe Per Product: You can set a limit on subscribing product quantity per.
  • Allow To Update Profile Before: You can set a limit on customers for updating their profile. It will freeze subscription modification by customers before defined days.
  • Allow to Skip Subscription: You can give controls to customers if customers can skip product subscriptions.
  • Allow To Pause Subscription: You can give controls to the customer if the customer can pause the product subscription
  • Allow To Cancel Subscription: You can give control to the customer if the customer can cancel the product subscription.
  • Allow To Update Billing Frequency: If set to yes, the user will be updating the billing cycle(s) from their subscription(s). The next occurrence cycle will be counted from the day of billing frequency is updated.
  • Allow To Update Billing Address: You can give control to the customer if the customer can update their billing address or not.
  • Allow To Update Shipping Address: You can give control to the customer if the customer can update their shipping address or not.

                    

  • Subscription Email Sender: Option to select the suitable department for sending emails to customers.
  • Send New Subscription Email? : Option to disable/enable new Subscription order details email sent to customers. 
  • New Subscription Template: Option to select the suitable templates for the new subscription.
  • Send New Subscription Email Copy To: A copy of every new subscription email will be sent to the addressees provided here.
  • Send Subscription Update Email? : Option to disable/enable Subscription order update emails sent to customers.
  • Subscription Profile Update Template: Option to select the suitable templates for updating the profile.
  • Send Subscription Update Email Copy To: A copy of every subscription update email will be sent to the addressees provided here.
  • Send Payment Failed Email? : Option to disable/enable payment failure emails sent to customers.
  • Payment Failed Template: Option to select the suitable templates for the failed payment.
  • Send Payment Failed Email Copy To: A copy of every payment failed email will be sent to the addressees provided here.
  • Send Subscription Reminder Email? : Option to disable/enable Subscription reminder emails sent to customers.
  • Subscription Reminder Template: Option to select the suitable templates for the email reminder.
  • Subscription Reminder Email Copy To: A copy of every subscription reminder email will be sent to the addressees provided here.
  • Send E-Wallet Topup Reminder? : Option to disable/enable E-Wallet Topup Reminder emails sent to customers.
  • Send Subscription Renew Email? : Option to disable/enable Subscription order renewal emails sent to customers.
  • Send Subscription Order Email?  : Option to disable/enable new Subscription orders emails sent to customers. If set yes, the Customer would receive the email of the particular subscription profile order.

Backend Functionality


Manage Subscription Products

  • Enable Subscribe Now: Is product enable for subscription. Admin can enable product and configure product option for particular product.
  • Product Purchase Option: If product is enable for subscription, you can set product can be subscribe only. Else it could be ether subscription or one time purchase only.
  • Discount Type: You can offer discount on product subscription. Discount could be with Percentage or fixed on product price.
  • Discount on Subscription: With previous option if discount type is fixed, you can defined discount amount on product price. Else if type if percentage, you can set percentage from 0 to 100% of price.
  • Initial Fee: Some time you may need to have initial fee on subscribing any product to setup/configure subscription product, which you can set here. This is one time charge, applicable on product subscription.
  • Billing Period Defined by: Admin or Customer. This defines that who can decide/define the billing period. If option is set to customer, customer would get selection of billing period on product page. Customer can choose the billing frequency could be weekly, monthly, etc. as defined by admin. If set to admin, you can fix the billing period for customer.
  • Billing Period: This option will only available if with previous option value is set to admin. You would have billing period selection, recurring order will be generated on predefined period only.
  • Number of Billing Cycle: It defines the number time recurring order should be generated. If you put this blank, subscription will be unlimited, until the subscription failed or cancelled.
  • Subscription Start From: This could be one of below option,
    • Moment of purchase – Subscription will be started at the time to subscription/order placed.
    • Defined By Customer – On product page, customer will get calendar to select subscription service start date. On that particular date first order will get generated.
    • Last date of Month – Last date of month will be considered as subscription start date.
    • Exact Day of Month – For this option, you will have to define particular number of day (i.e. 1, 13, etc.…) with next option “Day of Month”.
  • Allow subscribes to update next subscription date: This is to give control to your customer to manage their next subscription date. If you have set this option to yes, subscribers can update next subscription dates if needed.

  • Trial Billing Period: If you need to provide trial period for particular product you can enabled this option.

Manage Product Subscribers

You will have full control over the product subscribers. You can manage product scriber from Admin >> MageDelight >> Subscribe Now >> Subscriptions

As shown with above image you can find all subscriber lists with all basic information. I.e. customer details, product name, Subscription status, etc.

Manage Product Subscription

You can view the product subscription details with all require information likewise frontend. You can view all details with subscribed product, payment details, and subscription details. Also, you can manage shipping and billing address as well.

Edit Product Subscription Profile

You will have full control to manage subscription profile for customer. You can also prevent your customer to edit and modify subscription them self and instead that you can hold power to manage profiles on behalf of your customer. You can cancel, pause, and skip subscription. You can edit profile for customer, too.

With edit profile you can update, subscription product quantity, changes selected credit card, billing and shipping address.

Frontend Functionality


Product Listing Page

Once the products are set with subscription options, products are available at frontend to subscribe. If product is available for subscription, you can set text to show customer that product subscription option is available on product listing page.

Product Details Page

There could be different option available for subscription based on product configured at backend. Below are some of examples,

Subscribe only:

  • This product is available for subscription only. Don’t have option for one time purchase.
  • It also offers trial period for 2 time delivery with discounted rate of 10
  • Subscription start date is 21st  of every month
  • Subscription is unlimited until customers cancel the subscription

One time purchase Or Subscription:

  • Customer can choose to purchase for one time or subscribe product for regular delivery
  • Admin can offer discount on subscribing product to force customer to subscribe product and set repeat business for long time
  • Subscription discount is 3.50 USD
  • Subscription period is 12 months, so every month 12 times recurring order will occur
  • Customers have option to start subscription, so the first shipping would be generated on selected date

Customer can define subscription period:

  • Again, this product is available with both option to have subscription or one time delivery
  • Customer can choose subscription period from the list. Customer has choice on what frequency he/she live get delivery of product based on product consumption/uses
  • Product subscription is unlimited period until customers cancel product subscription

Shopping cart

Subscription option would be shown as product custom option on cart page. So, the regular product and subscription product on same cart can be differentiated. As shown with above image

Pay using eWallet

eWallet can be used as a payment method. Buyer can load money to their eWallet and amount will be deducted from wallet balance. If buyer doesn’t have equal amount of balance as order total then, buyer’s available balance will be deducted and remaining amount will be collected from credit/debit card.

REST API


Please use SWAGGER to get detailed information of parameters. Your URL looks like, i.e. rest/v1/subscriptions

https://subscribenow.m2.demo.magedelight.com/swagger

Customer Balance

/ewallet/customer

Sample Data: {
"wallet":"",
"customer":"2"
}

Get Subscription Details

/subscription/{subscriptionId}

Please use searchCriteria params to retrieve records.

Create Subscriptions

/subscription/create

Sample Data

{
"productSubscribers": {
"profile_id": "API_1",
"customer_id": "2",
"product_id": "1",
"subscriber_name": "John Doe",
"subscriber_email": "sample@magedelight.com",
"store_id": "1",
"payment_method_code": "cashondelivery",
"subscription_start_date": "2019-05-10",
"billing_period_label": "Daily",
"billing_period": "1",
"billing_frequency": "2",
"period_max_cycles": "5",
"billing_amount": "50",
"trial_period_label": null,
"trial_period_unit": null,
"trial_period_frequency": 0,
"trial_period_max_cycles": 0,
"trial_billing_amount": null,
"currency_code": "USD",
"shipping_amount": "2",
"tax_amount": "2",
"initial_amount": "2",
"discount_amount": "12",
"order_item_info": {
"options": {
"_1": "subscription"
},
"subscription_start_date": "2019-05-10",
"qty": "1"
},
"additional_info": {
"product_sku": "24-MB01",
"shipping_title": "Flat Rate - Fixed"
},
"subscription_status": "1",
"next_occurrence_date": "2019-05-12",
"last_bill_date": "2019-05-10",
"payment_token": "",
"base_currency_code": "USD",
"base_billing_amount": "39",
"base_trial_billing_amount": "3",
"base_shipping_amount": "2",
"base_tax_amount": "1",
"base_initial_amount": "2",
"base_discount_amount": "12",
"billing_address_id": "1",
"shipping_address_id": "1",
"is_trial": "0",
"shipping_method_code": "flatrate_flatrate",
"product_name": "joust",
"payment_title": "Cash on delivery"
}
}

Create Subscription from Order

/subscription/create-by-order/{orderId}

Skip Subscription

/subscription/skip

Pause Subscription

/subscription/pause

Resume Subscription

/subscription/resume

Cancel Subscription

/subscription/cancel

Update Subscription

/subscription/update

Sample Data

{
"subscriptionId": 101,
"modifiedby": 0,
"subscription": {
"qty": "1",
"subscription_start_date": "2019-12-25",
"md_savecard": "paymentToken",
"md_billing_address": "1",
"md_shipping_address": "1"
}
}

Product Details Page

You will get subscription details from Magento's default product API /products/{sku} get subscription data from "custom_attributes" node.

While posting data, you have to pass below subscription parameters from product details page,

  • Subscription Product Type: options[_1] with value "nosubscription" or "subscription"
  • billing_period
  • subscription_start_date

GraphQL

Get Subscriptions

Request

{
  getSubscriptions(subscriptionId: 1) {
    subscription_id
    profile_id
    customer_id
    product_id
    product_sku
    subscriber_name
    subscriber_email
    store_id
    payment_method_code
    subscription_start_date
    suspension_threshold
    billing_period_label
    billing_period
    billing_frequency
    period_max_cycles
    billing_amount
    trial_period_label
    trial_period_unit
    trial_period_frequency
    trial_period_max_cycles
    trial_billing_amount
    currency_code
    shipping_amount
    tax_amount
    initial_amount
    discount_amount
    subscription_status
    subscription_item_info
    created_at
    updated_at
    next_occurrence_date
    last_bill_date
    trial_count
    payment_token
    total_bill_count
    base_currency_code
    base_billing_amount
    base_trial_billing_amount
    base_shipping_amount
    base_tax_amount
    base_initial_amount
    base_discount_amount
    initial_order_id
    billing_address_id
    shipping_address_id
    is_trial
    shipping_method_code
    product_name
    payment_title
    billing_frequency_cycle
    is_update_billing_frequency
    order_item_info
    additional_info
    order_info
  }
}

Response

{
    "data": {
        "getSubscriptions": {
            "subscription_id": 1,
            "profile_id": 100000001,
            "customer_id": 1,
            "product_id": 2041,
            "product_sku": "KT Channel Subscription",
            "subscriber_name": "Veronica Costello",
            "subscriber_email": "roni_cost@example.com",
            "store_id": 1,
            "payment_method_code": "adyen_cc",
            "subscription_start_date": "2022-04-22 11:09:30",
            "suspension_threshold": 0,
            "billing_period_label": "15 Days",
            "billing_period": 1,
            "billing_frequency": 15,
            "period_max_cycles": 50,
            "billing_amount": 1490,
            "trial_period_label": "",
            "trial_period_unit": "0",
            "trial_period_frequency": 0,
            "trial_period_max_cycles": null,
            "trial_billing_amount": "0.0000",
            "currency_code": "USD",
            "shipping_amount": "5.0000",
            "tax_amount": "98.3400",
            "initial_amount": "100.0000",
            "discount_amount": "10.0000",
            "subscription_status": "1",
            "subscription_item_info": "[]",
            "created_at": "2022-04-22 11:09:30",
            "updated_at": "2022-04-22 11:09:30",
            "next_occurrence_date": "2022-05-07 11:09:30",
            "last_bill_date": "2022-04-22 11:09:30",
            "trial_count": 0,
            "payment_token": "0:3:jQuL+UX1Ptf",
            "total_bill_count": 1,
            "base_currency_code": "USD",
            "base_billing_amount": "1490.0000",
            "base_trial_billing_amount": "0.0000",
            "base_shipping_amount": "5.0000",
            "base_tax_amount": "98.3400",
            "base_initial_amount": "100.0000",
            "base_discount_amount": "10.0000",
            "initial_order_id": "000000004",
            "billing_address_id": "1",
            "shipping_address_id": "1",
            "is_trial": "0",
            "shipping_method_code": "flatrate_flatrate",
            "product_name": "KT Channel Subscription",
            "payment_title": "Credit Card",
            "billing_frequency_cycle": "_1650610816454_454",
            "is_update_billing_frequency": "0",
            "order_item_info": "{\"uenc\":\"aHR0cDovL21hZ2VudGcuaHRtbA,,\",\"product\":\"2041\",\"qty\":1,\"options\":{\"_1\":\"subscription\"},\"subscription_start_date\":\"2022-04-22\",\"original_qty\":1}",
            "additional_info": "{\"shipping_title\":\"Flat Rate - Fixed\",\"product_options\":[]}",
            "order_info": "[]"
        }
    }
}

Get Subscriptions By Customer ID

Request

{
  getSubscriptionsByCustomerId(
    currentPage: 1
    pageSize: 1
  ){
    total_count
    items{
      subscription_id
    profile_id
    customer_id
    product_id
    product_sku
    subscriber_name
    subscriber_email
    store_id
    payment_method_code
    subscription_start_date
    suspension_threshold
    billing_period_label
    billing_period
    billing_frequency
    period_max_cycles
    billing_amount
    trial_period_label
    trial_period_unit
    trial_period_frequency
    trial_period_max_cycles
    trial_billing_amount
    currency_code
    shipping_amount
    tax_amount
    initial_amount
    discount_amount
    subscription_status
    subscription_item_info
    created_at
    updated_at
    next_occurrence_date
    last_bill_date
    trial_count
    payment_token
    total_bill_count
    base_currency_code
    base_billing_amount
    base_trial_billing_amount
    base_shipping_amount
    base_tax_amount
    base_initial_amount
    base_discount_amount
    initial_order_id
    billing_address_id
    shipping_address_id
    is_trial
    shipping_method_code
    product_name
    payment_title
    billing_frequency_cycle
    is_update_billing_frequency
    order_item_info
    additional_info
    order_info
    }
  }
}

Response

{
  "data": {
    "getSubscriptionsByCustomerId": {
      "total_count": 2,
      "items": [
        {
          "subscription_id": 1,
          "profile_id": 100000001,
          "customer_id": 1,
          "product_id": 2041,
          "product_sku": "KT Channel Subscription",
          "subscriber_name": "Veronica Costello",
          "subscriber_email": "roni_cost@example.com",
          "store_id": 1,
          "payment_method_code": "adyen_cc",
          "subscription_start_date": "2022-04-22 11:09:30",
          "suspension_threshold": 0,
          "billing_period_label": "15 Days",
          "billing_period": 1,
          "billing_frequency": 15,
          "period_max_cycles": 50,
          "billing_amount": 1490,
          "trial_period_label": "",
          "trial_period_unit": "0",
          "trial_period_frequency": 0,
          "trial_period_max_cycles": null,
          "trial_billing_amount": "0.0000",
          "currency_code": "USD",
          "shipping_amount": "5.0000",
          "tax_amount": "98.3400",
          "initial_amount": "100.0000",
          "discount_amount": "10.0000",
          "subscription_status": "1",
          "subscription_item_info": "null",
          "created_at": "2022-04-22 11:09:30",
          "updated_at": "2022-04-22 11:09:30",
          "next_occurrence_date": "2022-05-07 11:09:30",
          "last_bill_date": "2022-04-22 11:09:30",
          "trial_count": 0,
          "payment_token": "0:3:jQuL+UX1PtfGVxscLFAeyatIJb4WE=",
          "total_bill_count": 1,
          "base_currency_code": "USD",
          "base_billing_amount": "1490.0000",
          "base_trial_billing_amount": "0.0000",
          "base_shipping_amount": "5.0000",
          "base_tax_amount": "98.3400",
          "base_initial_amount": "100.0000",
          "base_discount_amount": "10.0000",
          "initial_order_id": "000000004",
          "billing_address_id": "1",
          "shipping_address_id": "1",
          "is_trial": "0",
          "shipping_method_code": "flatrate_flatrate",
          "product_name": "KT Channel Subscription",
          "payment_title": "Credit Card",
          "billing_frequency_cycle": "_1650610816454_454",
          "is_update_billing_frequency": "0",
          "order_item_info": "{\"uenc\":\"aHR0cDovL21hZ2HRtbA,,\",\"product\":\"2041\",\"qty\":1,\"options\":{\"_1\":\"subscription\"},\"subscription_start_date\":\"2022-04-22\",\"original_qty\":1}",
          "additional_info": "{\"shipping_title\":\"Flat Rate - Fixed\",\"product_options\":[]}",
          "order_info": "null"
        }
      ]
    }
  }
}

Pause Subscription

Request

mutation {
  pauseSubscription(
    subscriptionId: 1
  ) {
    success
    message
  }
}

Response

{
  "data": {
    "pauseSubscription": {
      "success": true,
      "message": "Subscription successfully paused"
    }
  }
}

Migration Steps


Subscribe now v. 100.x.x is now deprecated and we have launched new upgraded version v.200.x.x hence we do not provide support for deprecated versions.

Step 1: Take a full backup of your site with database

Step 2: Remove/Delete old Subscribe Now extension source code (i.e. app/code/Magedelight/Subscribenow).

Step 3: Extract new Subscribe Now extension to the same directory where you were having older one (i.e. app/code/Magedelight/Subscribenow).

Step 4: Run below commands,


php -f bin/magento setup:upgrade
php -f bin/magento setup:di:compile
php -f bin/magento setup:static-content:deploy

Step 5: Run migration command to make your old extension version compatible with our new extension version,


php bin/magento md:subscribenow:upgrade

Demo


Click here to visit frontend.

Click here to visit backend admin panel.

FAQs


Click here to visit FAQs.

Support


Click here to raise a support ticket using your MageDelight account.

Additional Services


Click here to get the customized solution for this extension.



Thank you for choosing MageDelight!



  • No labels