VirtueMart Forum

VirtueMart 2 + 3 + 4 => General Questions => Topic started by: bpos on July 14, 2021, 03:55:53 AM

Title: Shopper Groups and cart function
Post by: bpos on July 14, 2021, 03:55:53 AM
VM 3.8.8 Latest as of July 13

I have guest, default registered, retail, discount and wholesale shopper groups. I want to show pricing ONLY to the wholesale group. In other words if someone other than a wholesale shopper logs in they should not see any pricing for their shopper assigned group unless they are assigned wholesale.
I thought by unpublishing all other groups except for guest would do the trick.
The problem is if you unpublish default registered group that it still shows "add to cart" button on default assigned items. Does not show price but if you click on "add to cart" it will add that item to the cart without knowing any price? Once in the cart you can actually see pricing of the default assigned item.
Currently I have 3 different prices set for each item showing different price per selected group? All works as it should when all shopper groups are enabled.
In my case I only want wholesale people to shop during certain times. And ideally be able to enable all other groups at other times without showing "add to cart" button on items not belonging to wholesale group?

Can this be done?
Thanks
Title: Re: Shopper Groups and cart function
Post by: Jörgen on July 14, 2021, 07:03:13 AM
There is a test in the template files, addtocart.php perhaps, that checks if addtocart is to be shown.

Do you have template overrides ?

Jörgen @ Kreativ Fotografi
Title: Re: Shopper Groups and cart function
Post by: bpos on July 15, 2021, 00:47:07 AM
Yes
Title: Re: Shopper Groups and cart function
Post by: Jörgen on July 15, 2021, 10:14:13 AM
Great, check the overriddes  ;D

Jörgen
Title: Re: Shopper Groups and cart function
Post by: Studio 42 on July 15, 2021, 17:36:30 PM
If you add price only for a shopper group, it should work.
Title: Re: Shopper Groups and cart function
Post by: bpos on July 15, 2021, 20:09:01 PM
That`s what I thought too but it did not work.

Then i thought -- just unpublish shopper groups not in use. Did not work either.

Title: Re: Shopper Groups and cart function
Post by: Jörgen on July 15, 2021, 20:17:30 PM
Check with vmbeez3 and of it works then you must changes your overrides.

Jörgen
Title: Re: Shopper Groups and cart function
Post by: bpos on July 15, 2021, 20:31:58 PM
So you are saying this should work but my overrides are keeping it from doing what I need?
Title: Re: Shopper Groups and cart function
Post by: Jörgen on July 15, 2021, 21:01:00 PM
I can not know for sure, I do not know what kind of overrides that You are using, but the template files make this happen. If You have overrides these could mess things up.

Jörgen
Title: Re: Shopper Groups and cart function
Post by: bpos on July 15, 2021, 21:22:56 PM
I see. I was just wondering if this was something native that Virtuemart is supposed to be able to do?

When I unpublish any shopper group should they be hidden on the front end at that point? Hense shoppers should be gone since they do not have a visible group to join?
Title: Re: Shopper Groups and cart function
Post by: Jörgen on July 16, 2021, 08:59:37 AM
It does not works like that. Then you could never get new customers they do not belongs to any groups.
Prices belonging to certain shopper group ONLY show when a shopper belonging to that group is logged in.
Same goes to shopper group assigned products.
Other users do NOT see these prices or products.

What have you actually tested?

Jörgen
Title: Re: Shopper Groups and cart function
Post by: bpos on July 17, 2021, 22:36:33 PM
Without altering with overrides I have only tested by unpublishing certain shopper groups and leaving other published?
Admin verification is set.. so no new applicants gets automatically assigned to any group automatically.
I have not tried to sign up while default shopper group is unpublished? In my case I dont have to worry about new register`s signing up because I have not acticated them. Unless they are signing up in a published shopper group?

I would get new customers if they signed up to wholesale shopper group? (if it was published and I activate them?) Besides wholesale customers need to be vetted so I know they are wholesale eligible?
Regular customers would stay in a signed up state until at some later date I activated them?
Title: Re: Shopper Groups and cart function
Post by: Jörgen on July 18, 2021, 08:52:17 AM
Your explanation does only tell me that you di not let user register on their own, that is fine but doe snot matter in this case.

You still have not shown what you have done and if it works or not ?

In every PRODUCT you have a couple of choices, product belong to shopper group, no one else besides that shopper group sees the product.

In every PRICE you can select what shopper group the price belongs to, only those groups see the price.

This works, if it not works for You, then you have faulty overrides, test with VMBeez3 template.

Regarding user and shopper groups I have no Idea what are you are trying to accomplish. Assign users to the correct user group, done.

Correctly assigned prices and product are only shown to the correct shoppergroup. You do not have to publish and unpublish user groups, Why would you do that ?

Jörgen @ Kreativ Fotografi


Title: Re: Shopper Groups and cart function
Post by: bpos on July 20, 2021, 23:48:51 PM
I cannot let all user groups shop year round. Sounds dumb I know but that`s how it is.

I have 3 user groups which all try to login year round. There are certain times of the year that ALL user groups can purchase.

Some how I need to find a way to disable certain user groups so they dont log in and try to purchase. Trying to find specific user group individuals and disabling each one takes too long.

Currently Wholesale user group individuals can purchase. I will at some point need the ability to enable all user groups to shop again.

Pricing.
I have 3 prices assigned to each user group. 1 price per user group. Each user group can see their user group assigned price.

It seemed logical if I do not want specific user groups to be able to shop and see price and add to cart function that I might unpublish that user group until such time I can let them shop again?

That`s about as simple as I can explain this to you.

What do you suggest if not unpublish user groups?
Title: Re: Shopper Groups and cart function
Post by: Studio 42 on July 21, 2021, 10:54:21 AM
bpos,
it's really hard to understand why it not worf, because we do not see how you have set your shop config > pricing , if the template has some overrides...
You have for eg an option in Shopper Group directly to display only some prices, so if you want hide price, you can do it using this settings.
For the add to cart button, you can uncheck  "call for price" in the ocnfig or check the user shoppergroup in the PHP code
Title: Re: Shopper Groups and cart function
Post by: bpos on July 22, 2021, 10:21:43 AM
Maybe I am doing something wrong/
The user group pricing (disable setting) works as it should.
If I disable pricing for any user group the pricing does not show.
BUT the add to cart button does. "call for price" is unchecked.
Title: Re: Shopper Groups and cart function
Post by: Jörgen on July 22, 2021, 10:39:28 AM
What happens when You check call for price.

What are your overrides doing ?

I think we now have exhausted all options related to your info. If You were trying to help YOU what information would you need, think a moment about that ? Screenshots url etc ?

Jörgen @ Kreativ Fotografi