开发者 |
webdados
ptwooplugins |
---|---|
更新时间 | 2024年10月30日 19:46 |
捐献地址: | 去捐款 |
PHP版本: | 7.0 及以上 |
WordPress版本: | 6.7 |
tdw_rule_add
, tdw_rule_edit
, and tdw_rule_delete
actions when adding, editing, and deleting rules, to do whatever you want like, for example, clearing cache (check out to use them here and send us cool examples of what you’ve done)Plugins
menu in WordPressProducts
, Taxonomy Discounts
to set it upWe can only show the “sale” badge when we are absolutely sure the product will get a discount, no matter how many you buy. So, the badge is only shown for percentage base rules with no minimum quantity required.
You need to use the following filters:
tdw_loop_disc_info_action
and tdw_loop_disc_info_prio
: to set the hook and priority for the loop page and return, for example, woocommerce_after_shop_loop_item_title
and 1
tdw_single_disc_info_action
and tdw_single_disc_info_prio
: to set the hook and priority for the product page and return, for example, woocommerce_single_product_summary
and 6
(This is for Storefront. You may have to tweak the action and priority to better match your theme.)This only works for percentage discounts with a minimum quantity of 0 or 1, and you need to add this to your (child-)theme functions.php file:
add_filter( 'tdw_perc_sale_badge', '__return_true' );
Or you can just use the PRO add-on
You can use the wctd_get_product_current_price
helper function with the product or variation object or id as the first argument.
You can also pass the quantity as the second argument so that the calculations are made for percentage discounts with a minimum quantity higher than one or for “buy x get y free” discounts. The returned price will be the price per unit.
This is still beta.
No. The way we store the cart item prices is not currently compatible with stores where the customer can change currency during the shopping session.
Yes.
Yes.
Sure. Go to GlotPress and help us out.
This is a free plugin. It’s our way of giving back to the wonderful WordPress community. Only customers of the PRO add-on get included limited technical support. There’s a support tab on the top of this page, where you can ask the community for help. We’ll try to keep an eye on the forums but we cannot promise to answer support tickets. If you reach us by email or any other direct contact means, we’ll assume you need, premium, and of course, paid-for support.
You can report any security bugs found in the source code of this plugin through the Patchstack Vulnerability Disclosure Program. The Patchstack team will assist you with verification, CVE assignment and take care of notifying the developers of this plugin.
$product->has_child()
instead of $product->is_type( 'variable' )
so that all kinds of variable products declared from other plugins are compatibletdw_cart_item_subtotal_information
woocommerce_product_get_price
filterwoocommerce_product_is_on_sale
and woocommerce_product_get_price
- This can be disabled by passing false to the new
tdw_enable_cache` filter or on the PRO add-on$location
to the tdw_text_x_discount
, tdw_text_from_x_bought_y_discount
and tdw_text_for_each_x_bought_y_free
filtersstrong
tags and replace them with unopinated span
tags with classes on discount information (via filters or PRO add-on)$location
to the tdw_text_x_discount
, tdw_text_from_x_bought_y_discount
and tdw_text_for_each_x_bought_y_free
filtersWCTD_PERC_SALE_BADGE
, WCTD_LOOP_DISC_INFO_ACTION
, WCTD_LOOP_DISC_INFO_PRIO
, WCTD_PROD_DISC_INFO_ACTION
, WCTD_PROD_DISC_INFO_PRIO
and WCTD_ADVANCED_MODE
in favor of the new filters tdw_perc_sale_badge
, tdw_loop_disc_info_action
, tdw_loop_disc_info_prio
, tdw_single_disc_info_action
, tdw_single_disc_info_prio
and tdw_dev_mode
WCTD_ADVANCED_MODE
constant is set to true, a new “ID” field will be available for discount rules, which can be used by developers to identify a specific discount rulewctd_get_product_applied_rule
helper function to get the product applied rule, if anytdw_custom_product_loop
that you should return true to inside your product custom loops so that the discounted price shows correctly (Thanks vinha.pt)tdw_rule_add
, tdw_rule_edit
and tdw_rule_delete
actions when adding, editing or deleting rules (by @onlylowercaselettersandnumbers suggestion)wctd_get_product_current_price
helper function that developers can use to get the current product or variation price with the discount appliedWC tested up to
tagWCTD_PERC_SALE_BADGE
constant to true, the sale badge will be replaced by the discount percentage, if the minimum quantity is 0 or 1WCTD_GET_PRICE_FILTER_PRIO
constant, that priority will be used on the woocommerce_product_get_price
filterWC tested up to
tagadd_woocommerce_term_meta
and update_woocommerce_term_meta
instead of add_term_meta
and update_term_meta
WC tested up to
tagRequires at least
tagWC tested up to
tagWCTD_ENABLE_TIME
constant)Tested up to
tagWCTD_ENABLE_TIME
as true on your wp-config.php file for this feature to be enabled);languages
folder (the translations are now managed on WordPress.org’s GlotPress tool and will be automatically downloaded from there)WC tested up to
tag on the plugin main fileTested up to
tagTested up to
tagTested up to
tagTested up to
tagwctd_get_product_ids_on_sale
function to get the product_id of all the products that have an active discount, similar to WooCommerce’s native wc_get_product_ids_on_sale
(to be used by developers);