special pricing

  • Posts: 52
  • Thank you received: 0
13 years 7 months ago #12337

my customer has special pricing for certain users so I made a group for those users (let's call them 'coop'). I have gone through each product and set a price for public and a price for coop. I want that when a coop user is logged in and looking at prices to only see coop pricing, but now they see both listed.

I think what I may need is for my group to not be under "public" tree in usergroup management, but don't know how to do that.

if I don't have a public price it just says FREE. so I need a public price but then also a (lower) coop price. I have checked the config display setting "Price display method cheapest price" and yet it still shows both the public price and the coop price to coop member. I have tried moving the group around but can't seem to get it from under the public.

any suggestions?

Please Log in or Create an account to join the conversation.

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
13 years 7 months ago #12349

Normally, each group is separated from the others. When you're in one group, you're not in another. Except on 1.6 where you can be on several groups but then you should be able to remove the user from the public group.
Your settings in HikaShop sound fine. The problem is really to have the user only in the coop group and not in the public group. How do you change that actually ? I suppose you must use DJF ACL ? Or maybe you're on joomla 1.6 ?

Please Log in or Create an account to join the conversation.

  • Posts: 52
  • Thank you received: 0
13 years 7 months ago #12402

yes I am using j1.6.

I am sure you can understand it will be confusing for coop users to see just two prices listed with no explanation.

this is what it looks like now:

Product Name
XJF-7870
$27.80 each
$23.75 each


why is the "show cheapest price" setting not changing that and only showing them the cheapest price for them?

is there some other edit I can make?

if this isn't able to be set to do this now, maybe in future it could be that each group price have/append the group-name to the css class then I could just display: none the other?



edit: well maybe display: none wouldn't work but I could make the group css a bolder color or something.

Last edit: 13 years 7 months ago by dontflinch.

Please Log in or Create an account to join the conversation.

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
13 years 7 months ago #12413

HikaShop will only display the prices which are activated for the group of the user. So if your user is in two groups and that you have each price for each group, it's normal that you see both.
The show cheapest price is for the listing not for the product page.
You should edit the user and remove it from the "public" group via the user manager. Then, he will only see the price for the other group.

Please Log in or Create an account to join the conversation.

  • Posts: 52
  • Thank you received: 0
13 years 7 months ago #12417

that is not possible from what I can tell. all user groups are under the public root and cannot have a separate root. so even though I do not tick the public checkbox the coop group is child of public.

Please Log in or Create an account to join the conversation.

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
13 years 7 months ago #12436

But if you don't tick the public group, then the user shouldn't be considered as public, no ?

Please Log in or Create an account to join the conversation.

  • Posts: 52
  • Thank you received: 0
13 years 7 months ago #12501

you would think that would be the case but it does not seem to work like that.

my guess is because all groups are children of public.

I am going to try to write a php hack for this in the next day or two and maybe I can run it by you since I know a little php but am not really skilled in it. I also don't know what all the standard joomla calls are like for the user id (probably user_id?).

basically I'm just gonna make a little

if {user_id=="coopid#" && user_id!=="publicid#"} echo $public_price;
else echo $coop_price;

but that's just off the top of my head, I'll have to get out my books and look at the right formatting etc.

Please Log in or Create an account to join the conversation.

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
13 years 7 months ago #12504

You should be able to do that in the file listing_price of the view product via the menu Display->Views:
$user =& JFactory::getUser();
if($user->id != 62) array_shift($this->row->prices); //supposing that 62 is the id of your coop user

Please Log in or Create an account to join the conversation.

  • Posts: 52
  • Thank you received: 0
13 years 7 months ago #12506

thank you! I will try it tonight. what took you a few minutes probably saved me hours. =)


p.s. while looking I realize I framed this hack in regard to a particular user, is there a way to do it for a user GROUP?

Last edit: 13 years 7 months ago by dontflinch.

Please Log in or Create an account to join the conversation.

  • Posts: 52
  • Thank you received: 0
13 years 7 months ago #12572

I think I may have made my p.s. edit after you looked at my reply?

Please Log in or Create an account to join the conversation.

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
13 years 7 months ago #12575

Indeed :)

On joomla 1.5, the group id is in $user->gid:

if($user->gid != 62) array_shift($this->row->prices);


For 1.6, it's more complicated as you will get an array of groups:
$userGroups = JAccess::getGroupsByUser($user->id, true);
$inter = array_intersect($userGroups,array(29));//if group 29 is for coop
if(empty($inter)) array_shift($this->row->prices);

Please Log in or Create an account to join the conversation.

  • Posts: 52
  • Thank you received: 0
13 years 7 months ago #12648

ok, when I put this in it works great if the logged in user is in userGroup 13 (my coop group id), but when the person is not logged in it shows no price or add to cart field.

I added it right at the beginning after:

$first=true;
echo JText::_('PRICE_BEGINNING');

and before the foreach

am I not putting it in the right place?

I feel like maybe I need to make that statement an if and have the else be

$userGroups = JAccess::getGroupsByUser($user->id, true);
$inter = array_intersect($userGroups,array(1)); // where 1 is public group

with no array shift? but I keep breaking it and losing the add to cart block.


I REALLY appreciate the help on this. my customer brought this issue up to me again today so I really want to get it right if at all possible (and anything is possible if one knows php well enough? :blink: )

Last edit: 13 years 7 months ago by dontflinch. Reason: typo

Please Log in or Create an account to join the conversation.

  • Posts: 52
  • Thank you received: 0
13 years 7 months ago #12649

dontflinch wrote:

(and anything is possible if one knows php well enough? :blink: )

p.s. I want to be sure you know I was trying to be funny, as I am aware I obviously do not.....

Please Log in or Create an account to join the conversation.

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
13 years 7 months ago #12662

Could you post the piece of code you used and a screenshot of the groups listing you have in the back end so that we can see the corresponding ids ?

Please Log in or Create an account to join the conversation.

  • Posts: 52
  • Thank you received: 0
13 years 7 months ago #12727

edit: see next post

Attachments:
Last edit: 13 years 7 months ago by dontflinch.

Please Log in or Create an account to join the conversation.

  • Posts: 52
  • Thank you received: 0
13 years 7 months ago #12729

ok I found how to do it in joomla. I am so sorry to have been a bother!

I edited the user group options to set the guest group to "customer" and had to move the special group back under registered. but now it seems to work as my customer wanted.

now I just have to manually edit almost 700 products public price to "customer" group, lol.

thank you again for your help - you guys are really fantastic!

Last edit: 13 years 7 months ago by dontflinch.

Please Log in or Create an account to join the conversation.

Time to create page: 0.091 seconds
Powered by Kunena Forum