Post by philbydevil » Fri Jul 20, 2012 9:04 am

I would like to make a modification and I'm not sure how to do it.

I have two customer groups: Retail and Wholesale. Retail is normal pricing, Wholesale is less 25%. All of the prices have been set but when a Wholesale customer is logged in, they only see their discounted pricing, not the retail price.

Is it possible to make is so that both the retail price and wholesale price are displayed when a Wholesale customer is logged in?

I want to do this so it's easy for the Wholesale customer to see their price, plus the retail price without having to do the calculation themselves.

Thanks.

I heart cmd-f, cmd-c, cmd-v, cmd-z + vQmod.
My favourite page...
v1.5.4.1


User avatar
Active Member

Posts

Joined
Fri Dec 03, 2010 5:20 am

Post by Avvici » Sun Jul 22, 2012 1:36 am

Just run a check for a customer group when checking to see if logged in:

Here is your login check:

Code: Select all

if (!$this->customer->isLogged()) {
And here is some code to handle the customer groups:

Code: Select all

$this->load->model('account/customer_group');
		
		$this->data['customer_groups'] = array();
		
		if (is_array($this->config->get('config_customer_group_display'))) {
			$customer_groups = $this->model_account_customer_group->getCustomerGroups();
			
			foreach ($customer_groups as $customer_group) {
				if (in_array($customer_group['customer_group_id'], $this->config->get('config_customer_group_display'))) {
					$this->data['customer_groups'][] = $customer_group;
				}
			}
		}
Now you can specify a group by either group ID or group name in your TPL:
Just run a foreach loop to iterate and pull the value you want:

Code: Select all

<?php foreach ($customer_groups as $customer_group) { ?>

User avatar
Expert Member

Posts

Joined
Tue Apr 05, 2011 12:09 pm
Location - Asheville, NC

Post by philbydevil » Mon Jul 23, 2012 10:41 am

Thanks Avvici, I'm sure the info there would do the job but I need a bit more guidance. I'm assuming those first two bits of code are already in in the controller file/s?

And then what exactly do I do with the last piece of code? The customer_group_id is 10.

I heart cmd-f, cmd-c, cmd-v, cmd-z + vQmod.
My favourite page...
v1.5.4.1


User avatar
Active Member

Posts

Joined
Fri Dec 03, 2010 5:20 am

Post by philbydevil » Mon Jul 23, 2012 10:44 am

Does it start something like this:

Code: Select all

<?php if ($price) { ?>
<div class="price">
<?php foreach ($customer_groups as $customer_group) { ?>
<?php if ($customer_group['id'] == '10') { ?>

I heart cmd-f, cmd-c, cmd-v, cmd-z + vQmod.
My favourite page...
v1.5.4.1


User avatar
Active Member

Posts

Joined
Fri Dec 03, 2010 5:20 am

Post by Avvici » Mon Jul 23, 2012 8:34 pm

Skype me at Involution Media. If we reach a solution I will post it here. Or I will get back to it a little later.

User avatar
Expert Member

Posts

Joined
Tue Apr 05, 2011 12:09 pm
Location - Asheville, NC

Post by Kinetic » Wed Jul 25, 2012 12:16 am

Following this as I'd be keen to implement this on my site too. It'd be a good feature so trade customers can straight away see how much they're saving at a glance.
Avvici, let me know if you make a vQmod for this. You've got me on Skype already so give me a shout ;)

User avatar
New member

Posts

Joined
Fri Aug 19, 2011 4:10 am
Location - UK

Post by philbydevil » Wed Jul 25, 2012 7:02 am

Avvici - thanks, I'll see if I can Skype you today or tomorrow. What's your time zone?

I heart cmd-f, cmd-c, cmd-v, cmd-z + vQmod.
My favourite page...
v1.5.4.1


User avatar
Active Member

Posts

Joined
Fri Dec 03, 2010 5:20 am

Post by Avvici » Wed Jul 25, 2012 8:11 am

I've been off skype. Eastern Standard US time.

User avatar
Expert Member

Posts

Joined
Tue Apr 05, 2011 12:09 pm
Location - Asheville, NC

Post by kakanis » Wed Nov 27, 2019 9:47 pm

Hi,
Do you have solution for this question?

Best regards,
Emilis

User avatar
New member

Posts

Joined
Thu Jul 25, 2019 2:36 pm
Who is online

Users browsing this forum: No registered users and 206 guests