Page 1 of 1

Solved:Customer group prices if logged in

Posted: Tue Sep 09, 2014 1:52 am
by dony_b
Im looking to only show the discounted price if a customer group(wholesale) is logged in.

Current OC setup is like this:

Code: Select all

<span class="price-old">$119.50</span> <span class="price-new">$107.75</span>
Im looking to achieve this but only for certain logged in customer group:

Code: Select all

<span class="price-new">$107.75</span>
If [wholesale customer group] is [logged in] show prices discounted but not for the retail group.

Thanks in advance.

Re: Customer group prices if logged in

Posted: Tue Sep 09, 2014 2:30 am
by SXGuy
Something like

Code: Select all

<?php if ($this->customer->IsLogged && $this->customer->group['group_name']) { ?>
<span class="price-new">$107.75</span>
<?php  } else { ?>
<span class="price-old">$119.50</span> <span class="price-new">$107.75</span> 
<?php } ?>
Just a theory, would need to test and maybe make some alterations.

Re: Customer group prices if logged in

Posted: Tue Sep 09, 2014 4:10 am
by dony_b
So is this just an idea or it can be implemented ?

Re: Customer group prices if logged in

Posted: Tue Sep 09, 2014 11:18 pm
by SXGuy
Its an idea, that should work, if you give it a little help. I don't have time to help you other than give you an idea.

However the above script is wrong its more likely to work if it looked like this

Code: Select all

<?php if ($this->customer->IsLogged && $data['customer_group_id'] = 'Group Name') { ?>
<span class="price-new">$107.75</span>
<?php  } else { ?>
<span class="price-old">$119.50</span> <span class="price-new">$107.75</span> 
<?php } ?>
$data['customer_group_id'] = ''Group Name' is the part that would need altering if it doesn't work. Someone else really needs to butt in here and help as I don't have time to work out a correct method for you, I can only give you ideas.

Re: Customer group prices if logged in

Posted: Wed Sep 10, 2014 1:44 am
by dony_b
Great thanks