| 开发者 | wpmilan |
|---|---|
| 更新时间 | 2026年10月17日 12:01 |
| PHP版本: | 7.4 及以上 |
| WordPress版本: | 7.1 |
| 版权: | GPLv2 or later |
| 版权网址: | 版权信息 |
[rewardcrate_goal]
shortcode.build/ folder is compiled from the plugin's own
human-readable source, which ships inside the plugin:
build/admin.js from resources/js/admin/index.tsx (the settings screen)build/widget.js from resources/js/widget.ts (the bar in classic carts, the mini-cart widget and the sticky bar)build/blocks.js from resources/js/blocks/cart-goal.tsx (the bar in the Cart and Checkout blocks)build/blocks-editor.js from resources/js/blocks/editor.tsx (the Cart goal block in the editor)build/goal-bar-editor.js from resources/js/blocks/goal-bar-editor.tsx (the standalone goal bar block in the editor)build/coupon-labels.js from resources/js/blocks/coupon-labels.ts (goal discount labels in the Cart and Checkout blocks)resources/blocks/ and styles in resources/css/.
No third-party library is bundled: WordPress and WooCommerce packages are
loaded from the site at runtime.
To rebuild the files, install Node.js 20 or newer, then run npm install
and npm run build in the plugin folder. The build uses @wordpress/scripts
(webpack) with the included webpack.config.js.
Yes. Every feature described here is in the free plugin, with no limits on goals, products or orders.
Yes. The bar appears in the Cart and Checkout blocks, where you can also move it with the "Cart goal" block, and in the classic shortcode cart and checkout.
Yes. With a block theme, open the Mini-Cart template part in the Site Editor and add the "Cart goal" block to the drawer. Classic themes show it in the WooCommerce mini-cart widget automatically.
Untick Sticky bar on every page on the Display tab, where you can also move it to the bottom of the screen. Shoppers can also close it themselves for the rest of their visit.
Yes. Tick Product pages, above Add to cart on the Display tab. It shows even while the cart is empty, so shoppers see the first goal, such as "Spend $50.00 to unlock Free Shipping!", before they add anything. It works in classic and block themes.
No. Goals are measured on the cart subtotal before discounts, so an unlocked discount stays unlocked.
The gift is skipped and the goal still shows as reached. The event is written
to the WooCommerce log under the source rewardcrate, once an hour per
product.
Yes. A removed gift is remembered for that visit and not added again for the same goal. If the cart drops below the goal and reaches it again, the gift is offered again.
No. Goal discounts are virtual coupons that only exist while their goal is reached. Typed in by hand below the goal, they are rejected like any unknown code.
Goal amounts are saved in your store currency. When a currency plugin shows
the cart in another currency, convert each goal with the
smcc_threshold_amount filter, which receives the amount and the goal. Amounts
on the bar are formatted with WooCommerce's own price format, so they follow
the shopper's currency.
WPML with WooCommerce Multilingual:
add_filter( 'smcc_threshold_amount', function ( $amount ) {
return apply_filters( 'wcml_raw_price_amount', $amount );
} );
Aelia Currency Switcher:
add_filter( 'smcc_threshold_amount', function ( $amount ) {
return apply_filters( 'wc_aelia_cs_convert', $amount, get_option( 'woocommerce_currency' ), get_woocommerce_currency() );
} );
CURCY – Multi Currency for WooCommerce:
add_filter( 'smcc_threshold_amount', function ( $amount ) {
return function_exists( 'wmc_get_price' ) ? wmc_get_price( $amount ) : $amount;
} );
Suggested products follow the shopper's currency on their own: the exchange
rate is measured from your products' converted prices. To set it yourself,
return the price of one store-currency unit in the shopper's currency from the
smcc_gap_filler_currency_rate filter.
Each order placed while goals are on records the goals it reached, the cart amount, the reward cost and the revenue from suggested products, in the order's own data. The Stats tab totals paid orders from the last 30 days, refreshed once a day or on demand.
Not on its own. The Stats tab compares orders that reached a goal or bought a suggestion with orders that did neither, and shoppers who reach a goal may have spent more anyway. It is a correlation, and the tab says so. Measuring the real lift needs a holdout group that never sees the goals.
Yes. Set colours and messages on the Display tab, or copy
templates/goal-widget.php to yourtheme/rewardcrate/goal-widget.php
and edit it there.
No. Everything runs on your own server and the plugin makes no remote requests.
Its settings and cached data are removed from every site. The goal details recorded on past orders are kept, because they are part of those orders' history.
Yes. Among others: smcc_goal_rules to change the goals per request,
smcc_should_display to hide the bar for a request while rewards still apply,
smcc_threshold_amount to convert amounts, smcc_tier_is_unlocked to veto
a goal, smcc_gap_filler_candidates and smcc_gap_filler_ranked to shape
suggestions, smcc_state_data to change what the bar receives, and the
smcc_order_recorded action after an order's goals are stored.
Yes. On the Tools tab, export the settings to a file and import it on the other store, then save. Gift and pinned products are matched by ID, so check them afterwards. The same tab resets everything to the defaults.
{goal} placeholder.{goal} message placeholder for the cart amount that unlocks a goal.smcc_should_display filter to hide the bar for a request.