=== bLoyal: Loyalty & Promotions by bLoyal ===

Contributors: bLoyal

Tags: Omni-channel Loyalty, Subscriptions & Engagement, CAA & AAA, Loyalty promotions, Loyalty Points, Gift card,  Loyalty Dollar, Stored payment, POS Integration, Loyalty discounts, Account Pages, click-and-collect

Requires at least: 5.6

Tested up to: 7.0

WC tested up to: 10.8.1

Requires PHP: 7.4

Stable tag: 3.1.611.87

License: GPLv2 or later



bLoyal’s fully automated POS & e-commerce integrations let you convert sales transactions into loyal customers at every touch-point. Our solution seamlessly integrates with WooCommerce.



== Description ==



### Introduction ###



bLoyal enables WooCommerce users to grow their loyal customer base and engage with their customers across all devices and sales channels.



The bLoyal App enables you to have a single customer master record across your WooCommerce store and physical store(s) and run a consistent loyalty program, promotions, and engagement across all your sales channels. bLoyal also enables you to sell and accept gift/egift cards and customer loyalty tender in WooCommerce and in your physical store.

For more information, please go to [bLoyal.com]( https://bloyal.com )



### Major features in bLoyal include: ### 



* Powerful promotions and loyalty programs

* Single Master Customer Record.

* Automated Subscriptions.

* Referral Programs

* Real-Time Lifecycle Engagement.

* Click-and-Collect- Sell online and pick up in store.



[REQUEST A DEMO]( https://bloyal.com/request-demo/ )



For complete list of features and details, please visit [More Information]( https://bloyal.com/woocommerce-integration/ )



To learn how to install the plugin, navigate to the Installation tab. For detailed guidance on the installation and setup of the plugin, refer to the [plugin documentation](https://mysupport.bloyal.com/hc/en-us/articles/360022898114-bLoyal-Plugin-for-WooCommerce-Update-Setup-Guide/).



[youtube https://www.youtube.com/watch?v=cV4qY7I-6cU]



[Terms and Conditions](https://mysupport.bloyal.com/hc/en-us/article_attachments/360047099174/bLoyal-SubscriptionAgreement.pdf)



PS: Once integrated, you’ll have access to an unrivaled set of loyalty program management tools that will help achieve your business goals;



== Installation ==



= Minimum Requirements =



* PHP 5.6 or higher is recommended

* WordPress 5.6 or higher is recommended



= Prerequisites =



[REQUEST A DEMO]( https://bloyal.com/request-demo/ )



= Steps to install the plugin =



Step 1: Log in to your WordPress dashboard. 

Step 2: Upload the plugin folder to the /wp-content/plugins/ directory, or install the plugin directly from the WordPress Plugin Directory. 

Step 3: Activate the plugin through the 'Plugins' menu in WordPress. 

Step 4: Go to the 'bLoyal' menu and configure the plugin as per your requirements.



== Frequently Asked Questions ==



= What does the Plugin do? =



The bLoyal WooCommerce plugin syncs your ecommerce and other POS systems data with bLoyal, so you can engage your customers with targeted email marketing, automation, and promotions. With the combined power of WooCommerce and bLoyal, this plugin gives you all the tools you need to grow your online store and delight your contacts and customers. 



= Who should use the bLoyal WooCommerce plugin? =



This extension is perfect for Magento store owners who want to be able to track their customers and to engage with them by segmented and automated email and text campaigns, targeted promotions and loyalty programs to increase their customer lifetime value. 



= What types of loyalty programs does the plugin support? =



The plugin is very configurable so that you can points, frequent buyer, cashback, and many other loyalty programs.



= Are coding skills needed to use the bLoyal WooCommerce plugin? =



Not at all! The bLoyal WooCommerce plugin is easy to download and starts working with your WordPress site right away. 



= My question is not listed =



Visit bloyal.com or send us an email to info@bloyal.com and someone from our team will contact you shortly to answer all your questions. 



== Screenshots ==



1. Powerful Promotions

2. Create your own Loyalty Program in three easy steps

3. Automated Life Cycle Engagement

4. Single Master Customer Record

5. Subscriptions & Club Management



== Changelog ==

= 3.1.611.87 =

*Release Date - 20 Aug 2026*

Fix privilege escalation (custom Loyalty Engine API URL + cart auto-login) and add AJAX authorization gates (CON-184): admin configuration actions require manage_options and a nonce; storefront actions require a nonce that is fetched per visitor so page caching cannot share it; cart REST remains public. Denied requests are logged. A storefront action rejected because its nonce went stale on a cached page is retried once with a fresh one, and a rejected admin action now says so on screen instead of failing quietly.

Behaviour changes to be aware of: WordPress users who can manage options, edit users, manage WooCommerce or edit posts (Contributor and above) are no longer auto-logged-in from bLoyal cart customer data, so staff accounts that also shop must sign in normally; new customers created from bLoyal cart data now get a random password instead of one derived from their bLoyal identifier; and the minimum supported PHP version is now 7.4, matching WooCommerce.

= 3.1.611.83 =

*Release Date - 4 Aug 2026*

Fix CON-171: Only report a coupon as applied when bLoyal actually redeemed it. The confirmation added in 3.1.611.82 fired whenever bLoyal acknowledged the code, including for a reward coupon the customer had never been awarded - which comes back Valid=false / Redeemed=false and produces no discount, so the shopper was told "applied successfully" while the total did not change. The applied-coupon confirmation is now gated on the Redeemed flag of the CalculateCart response that the coupon request itself triggers (the same flag the commit path uses to decide which coupons are written onto the order), and when a coupon is not redeemed bLoyal's own explanation is shown instead - for example "Customer has not been awarded this coupon." The check fails safe: an empty cart, a missing response or a response for a different cart all keep the previous success message rather than wrongly telling the shopper their coupon is invalid.

= 3.1.611.82 =

*Release Date - 4 Aug 2026*

Fix CON-171: Confirm to the shopper that a bLoyal coupon was applied. A valid bLoyal coupon reduced the totals but produced no confirmation at all, because the discount is folded into the line-item prices instead of appearing as a separate totals row - so merchants and shoppers reported coupons as "not working" when they had in fact been applied. A success notice is now shown on the apply request. Also harden the woocommerce_coupons_enabled filter callback so it returns the original value when an exception is caught; previously it returned nothing, which resolves to null and would disable coupons store-wide, hiding the coupon form on both cart and checkout.

= 3.1.611.81 =

*Release Date - 17 Jul 2026*

Fix CON-159: Repair the "Submit Order to bLoyal" manual resubmit. The Grid SalesOrders/Changes payload was rejected with HTTP 400 (invalid Status value "completed"; ExternalIds and ClubMemberships sent as objects instead of arrays; null tax Rate), and the rejection was swallowed into an empty order note. Send Status "Approved", wrap ExternalIds/ClubMemberships as arrays, send 0 for tax Rate, and surface the bLoyal error on the order note instead of a blank one.

= 3.1.611.80 =

*Release Date - 3 Jul 2026*

Fix CON-111: Preserve the device connection (access key, service URLs, device id) and the payment tender mappings on plugin uninstall. Previously, deleting the plugin (a common way to update the manually-distributed ZIP) wiped these via the uninstall hook, forcing merchants to reconnect the device and re-map every tender after reinstall. Caches and non-essential settings are still cleaned up on uninstall.

= 3.1.611.79 =

*Release Date - 2 Jul 2026*

Fix CON-106: Prevent fatal PHP error ("Class WC_Payment_Gateway not found") that could take down the entire site, including wp-login.php. Guard all four bLoyal payment gateway registrations (gift card, loyalty dollar, snippets, stored payment) with a class_exists( 'WC_Payment_Gateway' ) check before defining the gateway class, and also guard the direct instantiation of the stored-payment gateway in the payment-alert AJAX handler, so requests where WooCommerce is active but its gateway class is not yet loaded no longer crash.

= 3.1.611.78 =

*Release Date - 26 Jun 2026*

Fix CON-85: Prevent shipping discount from being skipped on retry checkout. Remove ExternallyAppliedCharge override from the CON-78 ApproveCart stamp so bLoyal-managed rates can apply their discount rules. Add order-status guard in CommitCart to skip non-processing orders. Clear bloyal_early_cart_uid at the start of each CalculateCart run to prevent stale CartUIDs from prior attempts.

= 3.1.611.77 =

*Release Date - 18 Jun 2026*

Fix CON-79: Prevent fatal PHP error on session-less frontend requests. Guard WC()->session null check in bloyal_include_scripts before calling ->get(), so bot/crawler traffic that hits routes with no WooCommerce session no longer causes a 503.

= 3.1.611.76 =

*Release Date - 17 Jun 2026*

Fix CON-78: Prevent zero shipping on retry checkout. When a prior order clears the WC cart, bLoyal CalculateCart receives Charge:0 and zeroes out the shipping rate; the fix guards the shipping rate filter and stamps the correct amount into ApproveCart before sending.

= 3.1.611.75 =

*Release Date - 05 Jun 2026*

Fix CON-73: Block stored-payment checkout when no card was selected. The bLoyal payment snippet only stores the payment method when the customer clicks "SELECT CREDIT CARD"; if skipped, the order failed silently and auto-cancelled. The order is now stopped up front with a clear message instead.

= 3.1.611.74 =

*Release Date - 15 May 2026*

Fix CON-65: Revert shipping services postmeta (Director resolves shipping from CartUID directly); persist stored payment PaymentMethodUid to user meta so authorization survives session loss.

[Plugin Release Notes]( https://mysupport.bloyal.com/hc/en-us/articles/360041454494 )

= 3.1.611.73 =

*Release Date - 14 May 2026*

Fix CON-65: Add null guards for bloyal_cart_data in stored payment method; persist bloyal_shipping_services to order postmeta at checkout so CommitCart can recover it if the WooCommerce session expires before payment is confirmed.

[Plugin Release Notes]( https://mysupport.bloyal.com/hc/en-us/articles/360041454494 )



= 3.0.590.17 =

*Release Date - 26 July 2022*



= 3.1.611.3 =

*Release Date - 03 January 2023*



= 3.1.611.10 =

*Release Date - 01 May 2023*



= 3.1.611.11 =

*Release Date - 03 May 2023*



= 3.1.611.12 =

*Release Date - 18 May 2023*



= 3.1.611.13 =

*Release Date - 02 June 2023*

Fixed bLoyal calculate and approve alerts for EGift products.



= 3.1.611.14 =

*Release Date - 12 June 2023*



= 3.1.611.15 =

*Release Date - 08 August 2023*



= 3.1.611.16 =

*Release Date - 28 August 2023*

Fixed 100% discount issue on cart page summary.

= 3.1.611.30 =

*Release Date - 22 Jan 2024*

Fixed saleprice discount issue.
Fixed Birth Date value not being populated on the customer record in admin order page.
Fixed bLoyal customer data is not showing for "new sigunp customer" on the checkout address form.
Fixed Pickup stores not showing on the cart page.
Fixed bLoyal Shipping method issue on the cart/checkout page.
Fixed bLoyal Applied tax issue mismatched on checkout page.

= 3.1.611.33 =

*Release Date - 27 Feb 2024*

Fixed First Name and Last Name value for guest customer bLoyal Connector.
Fixed Stored payment method websnippets API call multiple times.
Fixed invalid payment method issue on checkout page.
Removed checking message from Loyalty Tender Payment.

= 3.1.611.51 =

*Release Date - 14 Nov 2024*

Fixed the issue in which when the user login with the club signup web snippet page then it displays the wrong user details while it should display the current user details.
Fixed the issue in which when the user tried to log-in with the club signup page then it was redirecting to the customer dashboard page while it should be on the club signup page.
Fixed the issue which was related to " Shipping not working".
Implemented the egiftcard web snippet functionality in which we can add egiftcard product from the egiftcard web snippet page.
Fixed the issue in which the bL_sk key was not generating whenever the web snippet launched.
Implemented the functionality to add new line item to the woocommerce cart.

= 3.1.611.56 =

*Release Date - 11 Jun 2025*

Fixed an issue with stored credit cards.

= 3.1.611.60 =

*Release Date - 8 Jan 2026*

Fixed eGift card package/shipping errors when guest creates account at checkout. Implemented proactive cart_uid preservation to order metadata and fallback retrieval mechanism to ensure cart information is available even when session is lost during account creation.

= 3.1.611.61 =

*Release Date - 12 Jan 2026*

Fix cart UID persistence for WooCommerce orders. Ensures cart_uid is saved to the database even when CommitCart API call fails, preventing loss of loyalty data, shipping services, and e-gift card information.

= 3.1.611.62 =

*Release Date - 16 Jan 2026*

Enhanced cart UID persistence with multi-point fallback system. Implements early cart_uid capture before CommitCart in multiple checkout hooks (before_calculate_totals, checkout_create_order, new_order, checkout_order_processed). Adds fallback retrieval from bloyal_cart_data session when plugin is deactivated mid-checkout, ensuring cart_uid is always persisted even when CommitCart fails or plugin is disconnected. Includes comprehensive logging with masked sensitive data for security.

= 3.1.611.63 = (reverted by 3.1.611.71)

*Release Date - 21 Jan 2026*

Fixed USA ePay 'Hold for Review' orders failing to sync to bLoyal. Orders with on-hold status are now skipped during checkout and committed when status changes to processing/completed.

= 3.1.611.64 =

*Release Date - 22 Jan 2026*

Fixed club signup snippet freezing on Delivery/Shipping step. Added null checks to WebSnippetCompleteFn to prevent JavaScript errors when responseData is null or undefined.

= 3.1.611.65 =

*Release Date - 5 Feb 2026*

Centralized JavaScript versioning for cache busting by replacing all hardcoded version numbers with a single BLOYAL_VERSION constant.

= 3.1.611.66 =

*Release Date - 5 Feb 2026*

Fixed critical error when placing orders using Gift Card + Credit Card payment combination. Added validation to ensure tender payment mapping is always an array, preventing "Cannot access offset of type string on string" fatal error on the thank you page.

= 3.1.611.67 =

*Release Date - 6 Feb 2026*

Fixed gift card and loyalty dollar "Apply Balance" not updating checkout totals without a manual page refresh. Restored direct checkout update trigger after applying balance, replacing a passive event listener that only fired on payment method change.

= 3.1.611.68 =

*Release Date - 17 Feb 2026*

Fixed gift card balance display showing inconsistent decimal places (e.g. $10.0 instead of $10.00). All balance and amount values in the Check Balance and Apply Balance messages are now consistently formatted to two decimal places.

= 3.1.611.69 =

*Release Date - 2 Mar 2026*

Fix CON-23: Prevent duplicate CartUID across back-to-back orders in the same session. Clear bloyal_uid and bloyal_early_cart_uid session keys after CommitCart so each new order generates a fresh unique CartUID.

= 3.1.611.72 =

*Release Date - 17 Apr 2026*

Fix CON-49: Set shipment Type to Pickup for virtual product orders. Virtual products have no WooCommerce shipping method, causing the payload to default to Type: Shipment. bLoyal/ShipCompliant then ran compliance checks on eProduct+PickupOnly products, causing Approved (Problem - General) errors in Director.

= 3.1.611.71 = (reverts 3.1.611.63)

*Release Date - 16 Mar 2026*

Fix CON-28: Revert incorrect on-hold skip logic introduced in 3.1.611.63. CommitCart is now always called when an order is placed, regardless of WooCommerce order status. The previous fix incorrectly skipped CommitCart for all on-hold orders; clients use bLoyal Director for order processing, not WooCommerce, so the status transition fallback never fired.

= 3.1.611.70 =

*Release Date - 13 Mar 2026*

Fix CON-27: Prevent duplicate CartUID when the customer navigates away before the order-received page loads. CartUID session keys are now cleared at order creation time (after the CartUID is safely saved to order metadata), instead of only on the order-received page. This ensures session cleanup is guaranteed regardless of browser behavior or payment gateway timing.


== Support ==



[Get quick answers to your questions with support resources, documentation, and step-by-step video walk-throughs for common bLoyal’s frequently asked questions]( https://mysupport.bloyal.com/hc/en-us )



== License ==



== Upgrade Notice ==



= 3.1.611.56 =



* [Compatibility] - WP 6.6.2

* [Compatibility] - WC 9.4.1


= 3.1.611.57 =


*Release Date - 25 Nov 2025*

Fix: bLoyal Plugin AJAX Conflicts Causing 500 Errors

Enhanced AJAX Skip List - Added AJAX endpoints to skip array to prevent bLoyal execution during third-party operations (Side Cart Plugin, WooCommerce core, Smart Coupons Plugin). Improved Error Handling at generate_bloyal_session_key.

= 3.1.611.58 =


*Release Date - 16 Dec 2025*

Fix: Duplicate bLoyal coupon notices

== Changes ==

1. Fixed duplicate coupon error messages by checking flag status before showing "already applied" error
2. Only show error if coupon is fully applied (flag=true), suppress notice for pending validation (flag=false)
3. Added proper escaping with esc_html() for security

= 3.1.611.59 =


*Release Date - 22 Dec 2025*

Fix: Coupon double application issue (Kanna Collective)

== Changes ==

1. Fixed coupon timing issue by setting flag=true immediately after successful API call
2. Added cart calculation trigger to ensure discount applies immediately
3. Enhanced error suppression for bLoyal coupons to prevent WooCommerce validation errors
4. Fixed duplicate check logic to only show error when coupon is fully applied
5. Removed HTML output from filter hook (WordPress best practice)

This fixes the issue where customers had to apply coupons twice and addresses the UI/backend mismatch where backend succeeded but frontend showed errors.

= 3.1.611.60 =


*Release Date - 8 Jan 2026*

Fix: eGift card package/shipping errors when guest creates account at checkout. Proactive cart_uid preservation to order metadata during checkout, fallback retrieval mechanism for cart_uid when session is lost, enhanced postmeta table management for backoffice connector compatibility, improved SQL security with prepared statements.


= 3.1.611.61 =


*Release Date - 12 Jan 2026*

Fix cart UID persistence for WooCommerce orders. Ensures cart_uid is saved to the database even when CommitCart API call fails, preventing loss of loyalty data, shipping services, and e-gift card information.

= 3.1.611.62 =


*Release Date - 16 Jan 2026*

Enhanced cart UID persistence with multi-point fallback system. Implements early cart_uid capture before CommitCart in multiple checkout hooks. Adds fallback retrieval from bloyal_cart_data session when plugin is deactivated mid-checkout, ensuring cart_uid is always persisted even when CommitCart fails or plugin is disconnected.