WooCommerce can build your Cart and Checkout pages with its blocks, or with the classic
Since WooRewards 5.4.0, the Points on Cart tool exists as a block extension. To set up the reward itself, read Points on Cart. To place content on classic pages, read Cart and Checkout Pages.
Blocks or classic pages
WooRewards looks at your Cart page and at your Checkout page separately. One can use the blocks while the other keeps the classic layout. Here is what changes.
- Points on Cart tool: with the blocks, WooRewards adds the tool to the order totals of the Cart block and of the Checkout block. You place nothing. On a classic page, you add the shortcode yourself.
- Cart Page Content and Checkout Page Content: these areas only work on classic pages. When a page uses the blocks, WooRewards disables the fields of that page and shows this message: Fields below are for legacy shortcode. (orfor the Checkout page), then It seems your Cart page is setup with Woocommerce blocks. and Please edit the WooCommerce Cart page and insert our shortcodes directly in it.
- Look and labels of the tool: the block has its own fixed design and fixed texts. The header, the labels, the styling tool and the shortcode attributes belong to the classic tool only. See the list below.
- Free product choice: the popup that lets a customer choose a free product exists for both layouts. See Free Product Popup.
Set up the Points on Cart tool
The block tool needs a standard points and rewards system in Points on Cart mode. To check it, go to
Open your standard system. In the Rewards group, set Rewards Type to Points on Cart. The options of the mode are listed in the Points on Cart article.
The tool then appears for a customer when all of these are true:
- the customer is logged in;
- the system is enabled and inside its dates;
- the system accepts the customer’s role.
If several systems are in Points on Cart mode, the customer sees one tool per system.
What your customers see
- A folded line, Use your followed by the points name (for example Use your Points), with the customer’s balance. A click opens the tool.
- The opened tool starts with You own and the balance. It then shows a field labelled Enter a value and an Apply button. The field accepts digits only.
- The field and the button only appear when the customer can spend points on this cart. Otherwise, the customer only sees the balance and the information lines.
- After Apply, the order totals show the discount. Its line carries the title of the system.
Below the field, the tool can show these information lines. Each one only appears when the matching option is set in the system:
- Minimum: … (from Min points usage)
- Maximum: … (from Max points usage)
- Max. discount: …% (from Max percentage of cart)
- Min. total: … (from Lower Cart Limit)
- Requires at least a … subtotal (from Minimum Cart Amount)
- a line showing what points are worth, for example one point for a given amount (from the point value of the system)
Rules applied to the amount
- A customer cannot apply more points than the balance, nor more than needed to cover the cart subtotal. The subtotal is counted after the other coupons, and with tax if your prices include tax.
- If the amount is under Min points usage, WooRewards raises it to the minimum. If the cart cannot reach the minimum, the amount goes back to zero.
- If the cart changes and the applied amount becomes too high, WooRewards lowers it to the new maximum.
What the classic tool has and the block does not
These only act on the classic tool, the one you place with the shortcode. The tool header and the styling tool are set in the Points on Cart Tool entry of the Shortcodes tab:
- Tool Header (default Loyalty points discount) and the styling tool;
- the Use Max Amount button;
- the shortcode attributes layout, reload, need_points and system.
The block follows the style of the WooCommerce blocks. To change its look, use your theme’s CSS.
For developers
The block tool reads and writes its data through the WooCommerce Store API, under the lws_woorewards namespace. These filters let you change what it shows: lws_woorewards_bloc_cart_data (the data sent to the cart), lws_woorewards_blocks_pointsoncart_details_text (the information lines) and lws-woorewards_blocks_script_data (the texts of the tool).