Plugin Directory

Changeset 1745573


Ignore:
Timestamp:
10/12/2017 04:56:09 PM (8 years ago)
Author:
nickvdberg
Message:

Fix admin dashboard error

File:
1 edited

Legend:

Unmodified
Added
Removed
  • woo-ea/tags/1.0.2/earnbox-for-woocommerce.php

    r1744783 r1745573  
    9797function send_earnbox_invite($earnbox_options) {
    9898    wc_enqueue_js('
     99         if (window.location.href.indexOf("&tab=checkout&section=earnbox") === -1) return false
    99100         var accountReviewMsg = document.querySelector(".account-review-msg")
    100101         var accountTitle = document.getElementById("earnbox-account-title")
     
    119120            },
    120121            success:function(data) {
    121                         if (!data) return
    122122                        accountTitle.className = ""
    123                         accountTitle.innerText = "We have sent an invitation to your email address."
    124123                        earnboxLoader.parentNode.removeChild(earnboxLoader)
    125124                        accountTitle.nextElementSibling.parentNode.removeChild(accountTitle.nextElementSibling)
     125                        if (data === "") {
     126                            accountTitle.innerText = "Something went wrong.. Please contact us to get your invite: info@earnbox.co"
     127                            return
     128                        }
     129
     130                        if (data === "false") {
     131                            accountTitle.innerText = "It seems like you already used your invite.."
     132                            return
     133                        }
     134
     135                        accountTitle.innerText = "We have sent an invitation to your email address."
     136
    126137            },
    127138            error: function(errorThrown){
Note: See TracChangeset for help on using the changeset viewer.