Descontos por Taxonomia/Termos e Papéis para WooCommerce

Descrição

Permite-lhe configurar descontos/regras de preços baseadas em qualquer termo de taxonomias de produtos (por omissão ou personalizadas) no WooCommerce, de uma forma muito simples.

O desconto pode ser aplicado a todos os utilizadores, utilizadores autenticados ou apenas a alguns papéis de utilizador do WordPress.

Permite definir uma data de início e fim para cada desconto.

  • Compatível com WPML (possibilidade de definir descontos em termos de diferentes idiomas, não testado com multi-moeda).
  • Suporte experimental para WooCommerce Subscriptions.

Tipos de descontos

  • Percentagem: aplica uma percentagem absoluta a todos os produtos de um termo de taxonomia específico;
  • Compre x receba y grátis (BOGO): oferece y items quando x (do mesmo produto) são comprados;

Mais funcionalidades com o add-on PRO

  • Taxonomia personalizada “Etiqueta de desconto” se não quiser usar as Categorias, Etiquetas ou qualquer outra taxonomia de produto já existente;
  • Definir o máximo de itens de oferta em descontos BOGO;
  • Substituir a informação de promoção pela percentagem de desconto;
  • Mostrar informação de desconto (percentagem e datas) nas listagens de produtos;
  • Mostrar informação de desconto (percentagem e datas) na página de produto (obrigatório em algumas legislações, como a Portuguesa, por exemplo);
  • Regra “Stop – sem desconto” que garante que produtos de termos de taxonomias específicos nunca têm um desconto aplicado, mesmo que existam outras regras que se apliquem a outros termos de taxonomias do produto
  • Excluir produtos que já estejam em promoção da regra de desconto;
  • Desactivar métodos de envio com base nas regras aplicadas aos itens no carrinho;
  • Definir descontos para utilizadores não autenticados:
  • Modo de desenvolvedor – mais informação;
  • Suporte técnico;
  • E mais brevemente…
  • Obter agora

Notas

  • Os descontos são aplicados em cada linha do carrinho (não à soma dos produtos do mesmo termo);
  • Só é aplicada uma regra por cada linha do carrinho, pelo que definir as prioridades correctamente é muito importante;
  • Ao agregar variações de produtos, a quantidade será a soma das quantidades de todas as variações e o desconto será aplicado a todos eles;
  • Para utilizadores WPML, se pretender que os descontos se apliquem em todos os idiomas, deve replicar as regras para cada tradução do termo
  • Pode usar os hooks tdw_rule_add, tdw_rule_edit e tdw_rule_delete ao adicionar, editar ou apagar regras, para fazer o que quiser, por exemplo, limpar a cache (veja aqui como usá-los e envie-nos exemplos do que fez)

Outros plugins (premium)

Já conhece os nossos outros plugins WooCommerce (premium)?

Imagem de Arno Senoner

Ecrãs

  • Aplique descontos com base em qualquer taxonomia
  • Defina descontos baseados em taxonomia/termo, papel de utilizador, quantidade e data. Defina o tipo de desconto percentual ou BOGO.
  • Opções do add-on PRO
  • Mostrar informação de desconto, incluindo datas nas listagens de produtos (disponível no add-on PRO)
  • Mostrar informação de desconto, incluindo datas na página de produto (disponível no add-on PRO)

Instalação

  1. Use o instalador automático do WordPress e pesquise por “Taxonomy / Term based Discounts for WooCommerce”.
  2. Active este plugin na página de Plugins do WordPress
  3. Vá a Produtos, Descontos por Taxonomias para configurar

Perguntas frequentes

Porque é que o meu produto não está a mostrar a indicação de “Promoção”?

Só podemos mostrar a indicação que um produto está em promoção quando temos a certeza absoluta que o produto vai ter um desconto, independentemente da quantidade comprada.
Portanto, a indicação apenas é mostrada para regras baseadas em percentagem sem compra mínima.

Como posso mostrar a informação do desconto na lista de produtos e na página individual do produto?

Necessita utilizar os seguintes filtros

  • tdw_loop_disc_info_action e tdw_loop_disc_info_prio: para definir o hook e a prioridade para as listagens de produtos e retonar, por exemplo woocommerce_after_shop_loop_item_title e 1
  • tdw_single_disc_info_action e tdw_single_disc_info_prio: para definir o hook e a prioridade para a página de produto e retornar, por exemplo woocommerce_single_product_summary e 6
    (Exemplo para o Storefront. Poderá ter de alterar a action e a prioridade para que resulte melhor no seu tema.)

Ou pode utilizar o add-on PRO

Como posso substituir a indicação de promoção pela percentagem de desconto?

Isto só function para descontos percentuais com quantidade mínima de 0 ou 1, e necessita adicionar isto ao ficheiro functions.php do seu (child-)theme:

add_filter( 'tdw_perc_sale_badge', '__return_true' );

Ou pode utilizar o add-on PRO

Como posso obter o preço actual de um produto ou variação, com o desconto aplicado, fora do loop?

Pode usar a função helper wctd_get_product_current_price com o objecto ou id de produto ou variação como primeiro argumento.

Também pode passar a quantidade como segundo argumento, para que os cálculos sejam feitos para descontos percentuais com quantidade mínima de compra ou para descontos “compre x receba y grátis”. O preço devolvido será o preço por unidade.

Isto ainda está em beta.

Funciona com lojas multi-moeda?

Não. A forma como armazenados os preços dos items de carrinho não é actualmente compatível com lojas onde o cliente pode mudar de moeda durante a sessão de compras.

Este plugin é compatível com o novo armazenamento de encomendas de alto desempenho do WooCommerce?

Sim.

Este plugin já é compatível com o Carrinho e Finalização de Compras do WooCommerce baseados em blocos?

Sim.

Posso contribuir com uma tradução?

Claro. Podes ajudar-nos no GlotPress.

Necessito ajuda, posso obter suporte técnico?

Este é um plugin gratuito. É a nossa maneira de dar de volta à fantástica comunidade WordPress.

Apenas clientes do add-on PRO obtém suporte técnico limitado incluído.

Existe uma aba de suporte no topo desta página, onde pode pedir ajuda à comunidade. Tentamos estar atentos aos fóruns, mas não podemos prometer responder a pedidos de suporte.

Se nos contactar por email ou qualquer outra forma directa, vamos assumir que necessita de suporte urgente, premium, e claro, pago.

Onde reporto vulnerabilidades de segurança encontradas neste plugin?

Pode reportar bugs de segurança encontrados no código fonte deste plugin através do Patchstack Vulnerability Disclosure Program. A equipa do Patchstack irá ajudar com a verificação, atribuição de CVE e tratará de nos notificar.

Avaliações

17 Março, 2020 1 reply
This plugin is great but needs to have the ability to mark up prices also. Either by entering a negative percent or separate markup field. Hope this can be implemented!
25 Agosto, 2019 2 replies
Your plugin waste my 4 hours to detect where the issue. when i install your plugin it says "invalid product" for my all kind subscription products. please check your plugin and install woocommerce subscription to see status. Thank you.
Ler todas as 8 avaliações

Contribuidores e programadores

“Descontos por Taxonomia/Termos e Papéis para WooCommerce” é software de código aberto. As seguintes pessoas contribuíram para este plugin:

Contribuidores

“Descontos por Taxonomia/Termos e Papéis para WooCommerce” foi traduzido para 2 locales. Obrigado aos tradutores pelas suas contribuições.

Traduza o “Descontos por Taxonomia/Termos e Papéis para WooCommerce” para o seu idioma.

Interessado no desenvolvimento?

Consulte o código, consulte o repositório SVN, ou subscreva o registo de alterações por RSS.

Registo de alterações

4.5 – 2024-04-04

  • [NEW] Show subtotal price with discount on the classic cart
  • [NEW] PRO add-on 2.3: Improve plugin updater – Show translation update notices
  • [FIX] Deprecated: Creation of dynamic property in PHP 8.3
  • [FIX] PRO add-on 2.3: Update cache button click on the backend
  • [TWEAK] PRO add-on 2.3: Only show license key setting to administrators
  • [DEV] Add “Requires Plugins” header
  • [DEV] Tested with WordPress 6.6-alpha-57920 and WooCommerce 8.8.0-rc.1

4.4 – 2023-12-12

  • Declare WooCommerce block-based Cart and Checkout compatibility
  • Requires WordPress 5.4
  • Tested with WordPress 6.5-alpha-57159 and WooCommerce 8.4.0-rc.1

4.3 – 2023-09-07

  • Fix a bug getting variation discounts introduced in 4.2

4.2 – 2023-09-07

  • Fix a bug where sometimes variable products would show on sale when they weren’t

4.1 – 2023-09-06

  • PRO add-on 2.1: Discount rules database cache for better performance
  • Fix version number on readme.txt file
  • Small performance tweak on our call to the woocommerce_product_get_price filter
  • Fix a bug where sometimes products would show on sale when they weren’t

4.0 – 2023-09-05

  • Performance improvement by only loading non-expired and date valid rules on the frontend
  • Performance improvement by caching our filter calls to woocommerce_product_is_on_sale and woocommerce_product_get_price – This can be disabled by passing false to the newtdw_enable_cache` filter or on the PRO add-on
  • Tested with WordPress 6.4-alpha-56479 and WooCommerce 8.1.0-beta.1

3.8.1 – 2023-07-11

  • PRO add-on 1.8: Exclude products on sale from the discount rule
  • Fix translations
  • Requires WooCommerce 5.0 or above
  • Tested with WordPress 6.3-beta3-56192 and WooCommerce 7.9.0-rc.3

3.8 – 2023-07-11

  • PRO add-on 1.8: Exclude products on sale from the discount rule
  • Requires WooCommerce 5.0 or above
  • Tested with WordPress 6.3-beta3-56192 and WooCommerce 7.9.0-rc.3

3.7 – 2023-05-29

  • Fixed a bug where the incorrect product price would show up on the checkout page
  • Tested with WordPress 6.3-alpha-55859 and WooCommerce 7.8.0-beta.1

3.6 – 2022-11-23

  • PRO add-on 1.7: “Stop – no discount” rule that makes sure products from specific taxonomy terms never have a discount applied, even if there are other rules that will apply for other product taxonomy terms
  • Code cleanup
  • Tested with WordPress 6.2-alpha-54860 and WooCommerce 7.2.0-beta.1

3.5 – 2022-11-22

  • PRO add-on 1.6: Disable shipping methods based on cart items applied rules
  • Visual feedback for required fields when adding new rules
  • Tested with WordPress 6.2-alpha-54860 and WooCommerce 7.1

3.4 – 2022-11-10

  • PRO add-on 1.5: New rule field “title” that can be used to identify the rule in the admin area as well as being shown alongside the discount information in the frontend
  • Tested and confirmed WooCommerce HPOS compatibility
  • Fix jQuery deprecations
  • Fixed a bug when showing discount information on the product page
  • Tested with WordPress 6.2-alpha-54748 and WooCommerce 7.1

3.3.0 – 2022-10-17

  • PRO add-on 1.4: Set maximum amount of free items when using BOGO discounts
  • Fixed bug on the dates information when neither start or end date are set

3.2.0 – 2022-10-07

  • Allow PRO add-on 1.3 to add rules for non logged in users
  • Tested with WordPress 6.1-beta3-54400 and WooCommerce 7.0.0-rc.2

3.1.2 – 2022-09-19

  • Fix readme.txt

3.1.1 – 2022-09-19

  • Fix: Add $location to the tdw_text_x_discount, tdw_text_from_x_bought_y_discount and tdw_text_for_each_x_bought_y_free filters

3.1 – 2022-09-19

  • Sale badge (via filter or PRO add-on) now works in the Flatsome theme
  • Remove strong tags and replace them with unopinated span tags with classes on discount information (via filters or PRO add-on)
  • Add $location to the tdw_text_x_discount, tdw_text_from_x_bought_y_discount and tdw_text_for_each_x_bought_y_free filters

3.0 – 2022-09-18

  • New PRO add-on
  • Small bug fix on the product single page discount information beta feature
  • Deprecated the WCTD_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
  • Requires WooCommerce 4.0 or above
  • Tested with WordPress 6.1-alpha-53556 and WooCommerce 6.9.2

2.1.0 – 2022-06-29

  • New brand: PT Woo Plugins 🥳
  • Code refactoring and simplification when getting the applied rule to a product
  • Requires WordPress 5.0, WooCommerce 3.0 and PHP 7.0
  • Tested with WordPress 6.1-alpha-53556 and WooCommerce 6.7.0-beta.2

2.0.0 – 2021-05-10

  • Moved the settings to Products instead of WooCommerce
  • Fix WPML compatibility on the admin
  • If the 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 rule
  • New wctd_get_product_applied_rule helper function to get the product applied rule, if any
  • Added Woocommerce Google Product Feed compatibility
  • Code refactoring
  • Tested with WordPress 5.8-alpha-50832 and WooCommerce 5.3.0-rc.2
  • Relase sponsored by Planeta Tangerina and SuportesTV.pt

1.5.2 – 2021-03-10

  • Tested with WordPress 5.8-alpha-50516 and WooCommerce 5.1.0

1.5.1

  • Fix version number on the admin screen
  • Technical support clarification
  • Tested with WordPress 5.5-beta4-48649 and WooCommerce 4.3.1

1.5.0

  • Fixed a bug which was causing subscriptions to have an incorrect value
  • Process variable subscriptions just like regular variable products (Thanks for the heads up @snap-shot)
  • Fix product variations aggregation
  • Tested with WordPress 5.3.3-alpha-46995 and WooCommerce 3.9.0-rc.2

1.4.8

  • Fixed a bug which was causing this discounted prices not to be shown on variable products (Thanks @drosendo)

1.4.7

  • Fixed a bug which was causing the discounted prices not to be shown on the homepage
  • Tested with WordPress 5.3.1-alpha-46771 and WooCommerce 3.8.1

1.4.6

  • Fixed a bug which could cause products not on sale to show the sale badge (Thanks @drosendo)

1.4.5

  • Fixed a bug which was causing PHP Notices (Thanks @drosendo)

1.4.4

  • Tested with WordPress 5.2.5-alpha and WooCommerce 3.8.0

1.4.3

  • New tdw_custom_product_loop that you should return true to inside your product custom loops so that the discounted price shows correctly (Thanks vinha.pt)
  • Fix version number on the plugin admin interface
  • Tested with WooCommerce 3.6.3 and WordPress 5.2.1

1.4.2

  • Stop using the WooCommerce term meta helper functions
  • Tested with WooCommerce 3.6.0 RC2 and WordPress 5.1.1

1.4.1

  • Fix: php notice when product prices are set with more decimals than the ones defined on WooCommerce

1.4

  • New tdw_rule_add, tdw_rule_edit and tdw_rule_delete actions when adding, editing or deleting rules (by @onlylowercaselettersandnumbers suggestion)
  • Tested with WooCommerce 3.5.4 and WordPress 5.1

1.3

  • New wctd_get_product_current_price helper function that developers can use to get the current product or variation price with the discount applied
  • Better plugin initialization
  • Minor code cleanup
  • Tweaks on the admin page
  • Fixed WC tested up to tag

1.2

  • Beta: If you set the WCTD_PERC_SALE_BADGE constant to true, the sale badge will be replaced by the discount percentage, if the minimum quantity is 0 or 1
  • Fix: when percentage discount was set for a minimum quantity of 1 and the discount was not shown on archives and single product page
  • Fix: when the product had no price a php warning was thrown
  • Tested with WooCommerce 3.5.4 and WordPress 5.1 (beta)

1.1

  • It’s now possible to set rules for all users, logged-in users or users belonging to specific user roles (sponsored by Amaranto Design)
  • Better code indentation/standards
  • If you set an integer value on the WCTD_GET_PRICE_FILTER_PRIO constant, that priority will be used on the woocommerce_product_get_price filter

1.0

  • Now correctly shows the discount inside WooCommerce Product Shortcodes (sponsored by Amaranto Design)
  • Small admin UX tweaks
  • Tested with WooCommerce 3.5.1 and bumped WC tested up to tag
  • Reached 1.0 for no special reason 🙂

0.9.8

  • Use add_woocommerce_term_meta and update_woocommerce_term_meta instead of add_term_meta and update_term_meta
  • Bumped WC tested up to tag
  • Bumped Requires at least tag

0.9.7

  • Added the taxonomy internal name on the select field
  • Bumped WC tested up to tag

0.9.6

  • “Feed KuantoKusta for WooCommerce” (to be released) plugin integration fix

0.9.5

  • Fix: some variation discounts were not applied correctly
  • “Feed KuantoKusta for WooCommerce” (to be released) plugin integration

0.9

  • Fix: after calculations, round the discounted price using the default WooCommerce decimal places, in order to avoid totals miscalculations
  • Support for start and end date/time activated by default (no need to use the WCTD_ENABLE_TIME constant)

0.8.1

  • Tested with WooCommerce 3.3
  • Bumped Tested up to tag

0.8

  • Fixed a bug where the end date of a discount would not be taken in account because 00:00:00 was assumed instead of 23:59:59;
  • Experimental support for start and end date/time (you must define WCTD_ENABLE_TIME as true on your wp-config.php file for this feature to be enabled);

0.7.4

  • Removed the translation files from the plugin languages folder (the translations are now managed on WordPress.org’s GlotPress tool and will be automatically downloaded from there)
  • Tested with WooCommerce 3.2
  • Added WC tested up to tag on the plugin main file
  • Bumped Tested up to tag

0.7.3

  • Fixed a bug where some “Buy x get y free” discounts would not be calculated correctly
  • Bumped Tested up to tag

0.7.2

  • Fixed a bug that would prevent ajax based backend actions to work correctly
  • Fixed a (nasty) bug that would duplicate discounts each time the cart was loaded on WooComerce 3.0 and above

0.7.1

  • Fixed a bug that would prevent ajax based frontends to apply discounts
  • Fixed a bug where the sale price wouldn’t correctly set on WooCommerce 3.0 cart
  • Beta: show sale flash on variable products and sale price on variations (after choosen on the product page)
  • Beta: show discount information on the loop and product pages (see the FAQ)

0.7

  • Tested and adapted to work with WooCommerce 3.0.0-rc.2
  • Bumped Tested up to tag

0.6.2.1

  • Bumped Tested up to tag

0.6.2

  • Fix version number;

0.6.1

  • Fix to avoid php notices when old rules don’t have the new “aggregate product variations” setting setup;

0.6

  • New option on tjhe percentage discounts that allow to aggregate different product variations on the cart and count them all as if they were a single product, so that the discount will be applied to all of them;

0.5

  • Increase compatibility with other plugins that manipulate the product value;
  • Stop using the $woocommerce global;
  • Tested with WordPress 4.6.1;

0.4

  • New wctd_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);
  • Tested with WordPress 4.5;

0.3

  • First public release;
  • Minimum quantity on percentage discounts (leave empty or zero to apply to any quantity);
  • Configuration screen changes for better UX;

0.2

  • It’s now possible to disable further coupon discounts on top of our discounts, on a per rule basis:
  • Fixed “Cart Discount” will not be allowed if any discounted product is in the cart, because WooCommerce distributes the fixed value over the several cart lines and the final discount would not be the total coupon value, which would not be very clear for the customer;
  • The other coupon types, like “Cart % Discount”, “Product Discount” and “Product % Discount” will be applied only on cart lines where there’s no discounted products (that have a rule where “Disable coupons” is activated);

0.1

  • First (non-public) release;