Skip to content

Fix the self:: with ThinkingLogicWCSage:: #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 19, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 14 additions & 15 deletions thinkinglogic-wc-sage-one-integration.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/*
* Plugin Name: ThinkingLogic WooCommerce / Sage One Integration
* Plugin URI: http:/github.com/ThinkingLogic/wc-sage-one-integration
* Plugin URI: https://github.com/ThinkingLogic/wc-sage-one-integration
* Description: An integration with the Sage One api (v3.1) for WooCommerce - allowing orders to be turned into Sage One invoices at the click of a button (per order). One invoice will be created per order per month. Each invoice will be allocated a fraction of the total cost of the order, according to how many lessons occur in that month.
* Version: 0.2
* Text Domain: tl-wc-sage-one-integration
Expand Down Expand Up @@ -102,25 +102,24 @@ function tl_wc_sage_order_actions( $order_id ) {
$sage = ThinkingLogicWCSage::sageClient();
echo '<li class="wide">';
echo ' <div id="tl_wc_sage_order_actions" style="text-align: center;">';
if ($sage->isRefreshTokenExpiringSoon()) {
if ( $sage->isRefreshTokenExpiringSoon() ) {
echo '<a class="button" href="' . $sage->authorizationEndpoint() .'">Refresh Authorisation for Sage</a>';
} else {
if ($order->meta_exists(self::ORDER_FIELD_CUSTOMER_ID)) {
echo ' <input type="submit"';
echo ' class="button button-primary tl_wc_sage_order tl_wc_sage_customer_exists "';
echo ' name="' . ThinkingLogicWCSage::CREATE_INVOICE_BUTTON_ID . '"';
echo ' value="(Re)create Sage Invoice(s)"/>';
} else {
if ( $order->meta_exists(ThinkingLogicWCSage::ORDER_FIELD_CUSTOMER_ID) ) {
echo '<input type="submit"
class="button button-primary tl_wc_sage_order tl_wc_sage_customer_exists "
name="' . ThinkingLogicWCSage::CREATE_INVOICE_BUTTON_ID . '"
value="(Re)create Sage Invoice(s)"/>';
} else {
echo ' <input type="submit"';
echo ' class="button button-primary tl_wc_sage_order "';
echo ' name="' . ThinkingLogicWCSage::CREATE_INVOICE_BUTTON_ID . '"';
echo ' value="Create Sage Invoice(s)"/>';
echo '<input type="submit"
class="button button-primary tl_wc_sage_order "
name="' . ThinkingLogicWCSage::CREATE_INVOICE_BUTTON_ID . '"
value="Create Sage Invoice(s)"/>';
}
}
}
echo ' </div>';
echo '</li>';
}

}

/**
Expand Down Expand Up @@ -189,4 +188,4 @@ function tl_wc_sage_save_product_fields( $post_id ) {
function tl_wc_display_admin_notices( $post_id ) {
Logger::showAdminNotices();
Logger::clearAdminNotices();
}
}