VirtueMart Forum

VirtueMart 2 + 3 + 4 => General Questions => Topic started by: Roderic on June 21, 2023, 13:42:40 PM

Title: Display discount based on shoppergroup in module
Post by: Roderic on June 21, 2023, 13:42:40 PM
J3.10.11 + VM4.0.22

I would like to show different discounts based on shoppergroup in a module as a banner at the top of a B2B website. So basically the same functionality that already exists for many parts of Virtuemart.
Can anyone point to what snippet I should look at?

I would like to try to get this working with Regular Labs Advanced Module Manager and/or Conditional content.

Here is an example for categories: https://regularlabs.com/forum/advancedmodulemanager/49707-virtuemart-j4-available

Cheers!
Title: Re: Display discount based on shoppergroup in module
Post by: Studio 42 on June 21, 2023, 18:44:40 PM
Can you explain in more depth?
Title: Re: Display discount based on shoppergroup in module
Post by: Roderic on June 22, 2023, 10:47:46 AM
So, my client wants to show a text with "xx% extra discount on all orders". The amount of percentage is different per shoppergroup. So for example: shoppergroup X becomes 10% discount and shoppergroup Y 5%.
Now it should be possible to make the percentage dynamic, based on the user that is logged in. And the link I've posted is an example how it works with categories. I need something similar but then for shoppergroups.

Is this clear enough? :)
Title: Re: Display discount based on shoppergroup in module
Post by: pinochico on June 23, 2023, 09:12:16 AM
And where do you want show this discount?

On the product, or as text on the category description or?
Title: Re: Display discount based on shoppergroup in module
Post by: Studio 42 on June 24, 2023, 00:09:12 AM
To display content by shopper group.
You need to get the virtuemart user
Get the user shopper group and get the Taxe Rules from  the user shopper group
Of course if you use product price overidde and not tax rules, then you cannot do this
The code is a little long to create. So you need a (Virtuemart) Developer certainly to do it
Title: Re: Display discount based on shoppergroup in module
Post by: pinochico on June 25, 2023, 00:35:42 AM
I don't think so,
Modul VirtueMart Product Extended show content by shopper group and should be show price too.

But Im still waiting for info about my question, I don't want Guessing
Title: Re: Display discount based on shoppergroup in module
Post by: Studio 42 on June 25, 2023, 11:26:01 AM
Pinnochio.
I think he want display the shop Discounts not the products. My answer is for this case
Title: Re: Display discount based on shoppergroup in module
Post by: Roderic on June 26, 2023, 16:34:05 PM
Quote from: Studio 42 on June 25, 2023, 11:26:01 AM
Pinnochio.
I think he want display the shop Discounts not the products. My answer is for this case

"I would like to show different discounts based on shoppergroup in a module as a banner at the top of a B2B website"

Yep, you are correct.

For the actual prices of the products, that's easily achievable with the Tax & Calculation rules in VM.
Title: Re: Display discount based on shoppergroup in module
Post by: pinochico on June 27, 2023, 19:48:22 PM
I was a graphic designer for 20 years.
The term banner is for graphic output in jpg, png,...

So what are we talking about here?

About a module where you set up a module display based on a B2B customer group and define its content - so we are not talking about products.

So if we've progressed and we know what we want,
it's very easy to use the MiniJoomla VirtueMart Custom Module, which displays content based on the assigned customer group

In a real deployment you can see it on the www.zelenazeme.cz store, where it displays different content for regular users and different content for B2B users.

Thank you

Translated with www.DeepL.com/Translator (free version)
Title: Re: Display discount based on shoppergroup in module
Post by: Studio 42 on June 28, 2023, 10:25:23 AM
@roderic
I explained you what to do
If you know PHP and VM then you have all informations.
Else you have to pay someone to do it