Public Ticket #2754705

Purchase history based discount

Closed
Comments
3 Tickets 1
Simone Tacconi started the conversation 5 years ago on April 19, 2021 at 5:05pm

Hello,

really a great plugin!

I have a question: is there a dynamic rule to obtain purchase history based discount?

E.g. Users who spent $1000 in previously orders get 10% discount from now on - or for next order.

I can't see a similar option in rules.

If not, is there an hook to obtain this behaviour?

Thanks,

Simone

2,762
KingsPlugins replied 5 years ago on April 19, 2021 at 8:02pm

Hi Simone,

Thank you for purchasing the plugin,


The plugin doesn't have a way to do this by default I'm afraid - no such dynamic rule. 


Since you mentioned hooks, this is a little complicated to achieve, and will need quite a bit of coding, but you can probably achieve it like this:


For dynamic rules with "Show discount as sale price" checked, the plugin saves a comma separated list of Rule IDs in the option 'b2bking_have_discount_everywhere_rules_list_ids'

So you could filter that and REMOVE the rule for all users that DO NOT have at least $1000 in previous orders.



So you could create a rule, and then add a code snippet where you filter the list of available rules

It would look like this:

add_filter( 'option_b2bking_have_discount_everywhere_rules_list_ids', function($list){
    // filter the list here and remove the ID if the current user does not meet the condition
}, 10, 1);


Hope that makes sense,

Kind regards,

Stefan

2,762
KingsPlugins replied 5 years ago on April 22, 2021 at 10:53pm

Hi Simone,

Generally speaking, I'm afraid you will often see conflicts about price when using discount plugins. What may happen is you may see an incorrect price in cart, minicart, subtotals, etc, because both B2BKing and the discount plugins would try to modify price at the same time.

I don't know specifically about Flycart, but generally I would recommend to you to avoid other discount plugins if possible. 


Or if you want to use other discount plugins, in that case we would recommend you not to use B2BKing discount or pricing functionalities.


Kind regards,

Stefan

3 Tickets 1
Simone Tacconi replied 5 years ago on April 26, 2021 at 5:00pm

Thank you Stefan for your kind reply.


I think the Client could manage this by moving customers manually from a group to another - and manage purchase history discounts by groups.

Thanks again for the support.
Kind regards,

Simone

1

Sign In