No prices displayed until member registered
I'm not an expert at this, if i post on your thread i'm doing so with the best of my knowledge and just trying to help
Please Log in or Create an account to join the conversation.
The check should be something like:
Please Log in or Create an account to join the conversation.
Xavier wrote: I think that you will have to edit the views "product / listing_price" and add a check on the user to display or not the price.
The check should be something like:Code:if(hikashop_loadUser() != null){ ... }
That's the code that comes up, where would i add it?
Also once they're registered (and i put them in a specific user group) how would i do this? (with the prices then being displayed)
I'm not an expert at this, if i post on your thread i'm doing so with the best of my knowledge and just trying to help
Please Log in or Create an account to join the conversation.
You can use replace
Regards,
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Please Log in or Create an account to join the conversation.
I tried this and it didn't work, tradelights.co.uk/index.php/product/35-p...w-e27-40w-equivalent
Thanks
Tom
I'm not an expert at this, if i post on your thread i'm doing so with the best of my knowledge and just trying to help
Please Log in or Create an account to join the conversation.
That's because in the code previously given, if the price is free it's displayed if the user is registered or not.
To hide it too when the price is free, you can use this code:
Please Log in or Create an account to join the conversation.
Xavier wrote: Hi,
That's because in the code previously given, if the price is free it's displayed if the user is registered or not.
To hide it too when the price is free, you can use this code:Code:if(hikashop_loadUser() == null){ echo JText::_('PLEASE_LOGIN'); // Or any other text } else {
This code is in the modification which Jerome gave to me:
However it's still not workingJerome wrote: Hi,
You can use replaceByCode:<span class="hikashop_product_price_full<?php echo $class; ?>"> <?php if(empty($this->row->prices)){ echo JText::_('FREE_PRICE'); }else{Code:<span class="hikashop_product_price_full<?php echo $class; ?>"> <?php if(empty($this->row->prices)){ echo JText::_('FREE_PRICE'); } else if(hikashop_loadUser() == null){ echo JText::_('PLEASE_LOGIN'); // Or any other text } else {
Regards,
I'm not an expert at this, if i post on your thread i'm doing so with the best of my knowledge and just trying to help
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Xavier wrote: You have to place the loadUser check before the check for the empty price.
Code:<span class="hikashop_product_price_full<?php echo $class; ?>"> <?php if(hikashop_loadUser() == null){ echo JText::_('PLEASE_LOGIN'); // Or any other text continue; } else { if(empty($this->row->prices)){ echo JText::_('FREE_PRICE'); }else{
Still not working

tradelights.co.uk/index.php/product/35-p...w-e27-40w-equivalent
Here's the code:
I'm not an expert at this, if i post on your thread i'm doing so with the best of my knowledge and just trying to help
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Here's what i'm getting:
tradelights.co.uk/product/122-pharox-200...-20w-equivalent.html
If you wish to login and try you've got an account with:
HikaShop
WY0P7B5Z
(user/pw)
Also, i can see all the displayed prices now (for different user groups, even though they're set at different levels)
Also Xavier, congratulations on 500 "Thank You"'s
I'm not an expert at this, if i post on your thread i'm doing so with the best of my knowledge and just trying to help
Please Log in or Create an account to join the conversation.
Thanks
Concerning the logs they don't work. Could you check that ?
Just to be sure of what you are needing, you want to hide the price and the add to cart button to all the not registered customers but display it for the registered ?
Please Log in or Create an account to join the conversation.
Yeah that's all right except its not when they register, when they are approved (and put into a custom user group) then I'd like the price displayed.
I'm not an expert at this, if i post on your thread i'm doing so with the best of my knowledge and just trying to help
Please Log in or Create an account to join the conversation.
To restrict to a certain group, you will have to check on the user group so use something like:
$regUser = hikashop_loadUser()
if($regUser == null || !in_array('theGroupID',$regUser->group_id){
Please Log in or Create an account to join the conversation.
$regUser = hikashop_loadUser()
if($regUser == null || !in_array('9',$regUser->group_id){
try:
HikaShop
hikashop
as the user/pw
I'm not an expert at this, if i post on your thread i'm doing so with the best of my knowledge and just trying to help
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Xavier wrote: You will need something like:
Code:<?php $regUser = hikashop_loadUser(true); if($regUser != null){ $db = JFactory::getDBO(); $query = 'SELECT group_id FROM '.hikashop_table('user_usergroup_map',false).' WHERE user_id ='.$regUser->user_cms_id; $db->setQuery($query); $regUser = $db->loadResultArray(); }else{ $regUser = array(); } if(!in_array('9',$regUser)){ echo "Hide the price"; } ?>
So that would become:
I'm not an expert at this, if i post on your thread i'm doing so with the best of my knowledge and just trying to help
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
I'm not an expert at this, if i post on your thread i'm doing so with the best of my knowledge and just trying to help
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.