Page 1 of 1
[Solved} Customer Groups appearing in guest checkout billing details
Posted: Mon Jan 23, 2023 11:09 pm
by mikeinterserv
As above I have someone who has set up customer groups for trade and distributors as well as the default group.
Everything seems OK however the default group can see trade and distributor options on GUEST CHEKOUT BILLING DETAILS.
They are then able to select one of these and get the pricing of those two trade groups.
Did I miss something obvious.
The default group should NOT be able to see or select these options here.
OC 3.0.3.6 - Default theme, hardly any extensions, certainly none that would affect this.
Paypal standard and bank transfer are the ONLY payment options.
Any pointers before I trawl through would be appreciated.
Re: Customer Groups appearing in guest checkout billing details
Posted: Tue Jan 24, 2023 12:07 am
by ADD Creative
Are the trade groups unticked in the Customer Groups section of the setting under the Option tab?
Re: Customer Groups appearing in guest checkout billing details
Posted: Tue Jan 24, 2023 12:08 am
by JNeuhoff
You'd probably have to modify the catalog/view/theme/<your-theme>/checkout/guest.twig file, e.g. to have amongst others this in there:
Code: Select all
<div class="form-group" style="display:none;">
<input type="hidden" name="customer_group_id" value="{{ config_customer_group_id }}" />
</div>
And in the corresponding controller at catalog/controller/checkout/guest.php add this:
Code: Select all
$data['config_customer_group_id'] = $this->config->get('config_customer_group_id');
I'd do these modifications via event handlers, though you could also use OCmod for this.
Re: Customer Groups appearing in guest checkout billing details
Posted: Tue Jan 24, 2023 4:16 am
by mikeinterserv
ADD Creative wrote: ↑Tue Jan 24, 2023 12:07 am
Are the trade groups unticked in the Customer Groups section of the setting under the Option tab?
Well if they are unchecked then the option is no longer available in REGISTRATION for those groups. Which it obviously needs to be.
Like I say I get the feeling I am missing something stupidly obvious here.
The groups DO NOT show up when LOGGED IN as a user. They only appear in guest checkout.
I can't believe this didn't come up before but I had no luck searching.
Re: Customer Groups appearing in guest checkout billing details
Posted: Tue Jan 24, 2023 4:19 am
by mikeinterserv
JNeuhoff wrote: ↑Tue Jan 24, 2023 12:08 am
You'd probably have to modify the catalog/view/theme/<your-theme>/checkout/guest.twig file, e.g. to have amongst others this in there:
Thanks for that
As I have said I was hoping it was something obvious I had missed, I can't believe it works this way as is.
Re: Customer Groups appearing in guest checkout billing details
Posted: Tue Jan 24, 2023 8:17 am
by ADD Creative
mikeinterserv wrote: ↑Tue Jan 24, 2023 4:16 am
Well if they are unchecked then the option is no longer available in REGISTRATION for those groups. Which it obviously needs to be.
Like I say I get the feeling I am missing something stupidly obvious here.
The groups DO NOT show up when LOGGED IN as a user. They only appear in guest checkout.
I can't believe this didn't come up before but I had no luck searching.
Yes, the option does affect both guest checkout and registration. So you would either manually set the customer group for a trade customer after they have registered or modify the guest checkout form to remove the customer group option.
Re: Customer Groups appearing in guest checkout billing details
Posted: Tue Jan 24, 2023 9:03 pm
by paulfeakins
mikeinterserv wrote: ↑Tue Jan 24, 2023 4:19 am
As I have said I was hoping it was something obvious I had missed, I can't believe it works this way as is.
So is the issue fixed?
Re: Customer Groups appearing in guest checkout billing details
Posted: Wed Jan 25, 2023 11:28 pm
by mikeinterserv
paulfeakins wrote: ↑Tue Jan 24, 2023 9:03 pm
So is the issue fixed?
Yes - just used the code provided by J Neuhoff as is.
Cut the customer group code that was there in each file and pasted the new.
I still can't believe it would work this way though.
Thanks for the input from everybody.
Re: Customer Groups appearing in guest checkout billing details
Posted: Thu Jan 26, 2023 5:39 am
by ADD Creative
mikeinterserv wrote: ↑Wed Jan 25, 2023 11:28 pm
I still can't believe it would work this way though.
It's needed it some situations for tax calculations, such as a VAT registered customer group being needed at the guest checkout. What is probably needed is the option to select which groups appear at which checkout.