Add a string IVA in one user group

  • Posts: 20
  • Thank you received: 1
8 years 11 months ago #250896

-- HikaShop version -- : 2.6.4.
-- Joomla version -- : 3.6.2
-- PHP version -- : 5.6.26
-- Browser(s) name and version -- : firefox 49

Hi, with cron every night i import in the system 9000 objects with price_with_tax field.
Thereis tre type of users:
- the user that are not registered show the price full with tax (works)
- the new registered user go in client group and after login show full price - 25% discount (works)
- the wholesalers after login show full price - 50% discount ( work) but i 've to add on every price the string + I.V.A. only for this groups. I don't wont to calulate it but only show this text.
How i can do to obtain the last request?
Thanks

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

  • Posts: 84313
  • Thank you received: 13705
  • MODERATOR
8 years 11 months ago #250897

Hi,

You'll have to edit the file "listing_price" and add some custom code to check the current user's user group:

<?php
$user   = JFactory::getUser();
$userid = $user->get('id');
$groups = JAccess::getGroupsByUser($userid);
if(in_array(XXX,$groups)){
echo '+ IVA';
} ?>
where XXX is the id of the group.

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

Time to create page: 0.037 seconds
Powered by Kunena Forum