bloyal_get_service_urls( $domain_name, $domain_url, $is_custom_api_url_used ); $post_url = $bloyal_urls->GridApiUrl . '/api/v4/' . $access_key . '/' . $action; } } else { $shipping_carrier_url = get_option( 'grid_api_url' ); $post_url = $shipping_carrier_url . '/api/v4/' . $access_key . '/' . $action; } if ( $post_url ) { if ( $is_post == 2 ) { $args = array( 'headers' => array( 'Content-Type' => 'application/json', ), 'body' => $content, 'method' => 'DELETE', 'timeout' => 45, ); $response = wp_remote_request( $post_url, $args ); } elseif ( $is_post == 1 ) { $args = array( 'headers' => array( 'Content-Type' => 'application/json', ), 'body' => $content, 'method' => 'POST', 'timeout' => 45, ); $response = wp_remote_post( $post_url, $args ); } else { $args = array( 'headers' => array( 'Content-Type' => 'application/json', ), 'method' => 'GET', 'timeout' => 45, ); $response = wp_remote_get( $post_url, $args ); } $response_status = wp_remote_retrieve_response_code( $response ); $response = wp_remote_retrieve_body( $response ); $result = json_decode( $response ); if ( is_wp_error( $result ) ) { $error = $response->get_error_message(); return $error; } else { bLoyalLoggerService::write_custom_log( "Tenders Response \r\n" . wp_json_encode( $response ) . "\r\n ======================\r\n", 1 ); update_option( 'bloyal_' . $action, wp_json_encode( $result ) ); return $result; } } } } /** * Function to fetch all service urls API by bLoyal * * @return api result */ function bloyal_get_all_service_urls( $domain_name, $domain_url ) { try { if ( $domain_url ) { $post_url = $domain_url . '/api/v4/serviceurls/' . $domain_name; } else { $post_url = 'https://domain.bloyal.com/api/v4/serviceurls/' . $domain_name; } $args = array( 'headers' => array( 'Content-Type' => 'application/json; charset=utf-8', ), 'method' => 'GET', 'timeout' => 45, ); $response = wp_remote_get( $post_url, $args ); $response_status = wp_remote_retrieve_response_code( $response ); $response = wp_remote_retrieve_body( $response ); $response = json_decode( $response ); return $response; } catch ( Exception $e ) { $this->log( __FUNCTION__, 'Error in getting service urls. Reason: ' . $e->getMessage() ); return $e->getMessage(); } } /** * Outputs HTML page for bloyal configuration section * * @return void */ function bloyal_render_config_submenu_page() { $this->provisioning_popup_html(); $bloyalController = new BloyalController(); $snippet_code = $bloyalController->fetch_bloyal_devices_and_snippet_code(); ?>

bLoyal Configuration Setting

payment_gateways->get_available_payment_gateways(); $bLoyalTenderResponse = ''; $domain_name = get_option( 'bloyal_domain_name' ); $domain_url = get_option( 'bloyal_domain_url' ); $bLoyalTenderResponse = $this->bloyal_get_shipping_methods_and_tenders( 'Tenders', $domain_name, $domain_url ); $bLoyalTenderMappingValue = get_option( 'bloyal_tender_payments_mapping' ); if ( $bLoyalTenderResponse != '' ) { foreach ( $availableGateways as $gateWayKey => $gateWayValue ) { ?>
Company* Please enter valid Company
Device API Key* Please enter valid Device API Key

Cart Display Settings

Auto-expand Loyalty and Discounts in the Cart

Payment Tender Mappings

WooCommerce Payment Method bLoyal Payment Method
title ); ?>

Loyalty Dollar

Apply Full Balance
Apply In Increment Of

Gift Card

Apply Full Balance
Apply In Increment Of
On Account Tender Code

bLoyal API Log Setting

Log Enable
Click here to download bLoyal API's Request/Response log
Click here to clean bLoyal API's Request/Response log
Click here to download bLoyal Snippets log
Click here to clean bLoyal Snippets log
bloyal_get_all_service_urls( $domain_name, $domain_url ); ?>
provisioning_popup_html(); $bloyalController = new BloyalController(); $snippet_code = $bloyalController->fetch_bloyal_devices_and_snippet_code(); ?>

bLoyal Order Processing Configuration

prefix . 'woocommerce_shipping_zone_methods'; $querystr = "select method_id from $db_table_name where is_enabled = %d and method_id IN ('%s','%s')"; $active_shipping_method = $wpdb->get_results( $wpdb->prepare( $querystr, 1, 'free_shipping', 'flat_rate' ) ); $count = count( $active_shipping_method ); $querystr = "select method_id, instance_id from $db_table_name where is_enabled = %d and method_id IN ('%s')"; $active_pickup_shipping_method = $wpdb->get_results( $wpdb->prepare( $querystr, 1, 'local_pickup' ) ); $count_pickup = count( $active_pickup_shipping_method ); if ( $count == 0 ) { echo ' '; } if ( $count == 0 && $count_pickup == 0 ) { echo ' '; echo ' '; echo ' '; } $action = 'ShippingCarriers'; $domain_name = get_option( 'bloyal_domain_name' ); $domain_url = get_option( 'bloyal_domain_url' ); $count_shipping_carrier = 0; if ( $domain_name != '' ) { $response = $this->bloyal_get_shipping_methods_and_tenders( $action, $domain_name, $domain_url ); if ( ! empty( $response ) ) { $count_shipping_carrier = count( $response->data ); $count_shipping_service = count( $response->data['0']->Services ); } $access_key_verification = esc_attr( get_option( 'bloyal_access_key_verification' ) ); } ?> prefix . 'woocommerce_shipping_zone_methods'; $querystrresult = "select method_id from $db_table_name where is_enabled = %d"; $active_shipping_methods = $wpdb->get_results( $wpdb->prepare( $querystrresult, 1 ) ); $shipping_methods_count = count( $active_shipping_methods ); for ( $counter = 0; $counter < $shipping_methods_count; $counter++ ) { if ( ( isset( $active_shipping_method[ $counter ] ) && $active_shipping_method[ $counter ]->method_id == 'local_pickup' ) || ( isset( $active_shipping_method[ $counter ] ) && $active_shipping_method[ $counter ]->method_id == 'free_shipping' ) || ( isset( $active_shipping_method[ $counter ] ) && $active_shipping_method[ $counter ]->method_id == 'flat_rate' ) ) { echo ''; echo ''; } } ?> data[ $counterservice ]->Code; 'array name =' . $arr; $arrName = $arr; $arr = array(); for ( $counterserviceinner = 0; $counterserviceinner < $count_shipping_carrier; $counterserviceinner++ ) { if ( isset( $response->data[ $counterservice ]->Services[ $counterserviceinner ] ) && strlen( $response->data[ $counterservice ]->Services[ $counterserviceinner ]->Code ) ) { $test = $test . $response->data[ $counterservice ]->Services[ $counterserviceinner ]->Code . ','; } } ?> data[ $counterservice ]->Code; } ?> bloyal_get_all_service_urls( $domain_name, $domain_url ); ?>

Shipping Method Mapping

WooCommerce Method bLoyal carrier bLoyal Service
'; if ( $active_shipping_method[ $counter ]->method_id == 'local_pickup' ) { $method_title = 'Local pickup'; ?> method_id == 'free_shipping' ) { $method_title = 'Free shipping'; ?> method_id == 'flat_rate' ) { $method_title = ' Flat rate'; ?> '; echo ''; ?> '; echo '

Order Engine Settings

Use bLoyal Order Engine
bLoyal Applied Shipping Charges
bLoyal Applied Taxes

Checkout Form Options

Display Date Of Birth Field On CheckOut Form
Is Date Of Birth Required?

Shipping Address Custom Fields

Display Phone Field On CheckOut Form
Is Phone Required?
Display Email Field On CheckOut Form
Is Email Required?
Display Order Instructions On CheckOut Form

bLoyal Address Book Setting

Display Address Book On CheckOut Form

provisioning_popup_html(); ?>

bLoyal Click & Collect Setting

Enable :
Title : *
Error Title : *