- Posts: 1184
- Thank you received: 13
Show retail price and registered when logged
-- Joomla version -- : 3.3.6
-- PHP version -- : 5.4
Hi there!
Is there a way to show retail price and resgisted at the same time for logged in users?
I created a user group and asigned a user on it.
I have a producyt with retail price 2€ and price (for registered users) 5€.
When I m logged I can see both prices.
When I logout I see retail. Why I can see retail since I m logged out?
My goal is to have logged in users see both price retail and wholesale price.
but if you are logged out, you can see No price
Please Log in or Create an account to join the conversation.
You can edit the view "product / listing_price" and replace:
Please Log in or Create an account to join the conversation.
if(isset($this->element->main->product_msrp) && !(@$this->row->product_msrp > 0.0) )
$this->row->product_msrp = $this->element->main->product_msrp;
if(hikasop_loadUser() != null && isset($this->row->product_msrp) && @$this->row->product_msrp > 0.0 && JRequest::getCmd('layout') == 'show' && $this->params->get('from_module','') == ''){ ?>
because I cant find the second part as it is written on your post
Please Log in or Create an account to join the conversation.
Yes this code, I guess that you have a different one because you edited it before in order to display the retail price on listings and in modules too
Please Log in or Create an account to join the conversation.
==============================
But it isnt changed (there is no trash in listing which shows the overide.)
Can you paste here the correct one?
Please Log in or Create an account to join the conversation.
Here is the original code of this view:
But you should see the dustbin icon in the listing, or check in the template folder if there is no override of that view.
If not, so it is potentially because you edited that view directly in the hikashop views, so no overrides..
Please Log in or Create an account to join the conversation.
Can you check it for me please?
Please Log in or Create an account to join the conversation.
I just added the indicated code from the second post of this topic to the original code given previously and it' working as expected
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
It breaks the page, page becomes white, with only product images and title and product_code not styled, but that's it.
I have the exact same code you used too ( using original from HS 2.6.0)
Php failed to render the rest of the code, so there's an error somewhere in there, ???
Anyways, I wrote a little php as I only need to know if a user form a certain group.
So i just use Joomla functions to get it.
First I made template override for prodcut's listing_price.php to my templates html>com_hikashop>products directory.
The open the copied listing_price.php and added this code:
Then create conditional statement to show the prices you want to show to that group.
In my case groupid = 10, which is a group I created callled: Retailers.
So now, If log in using a retailers account I see both prices.
Now the I just have to alter the Product's Price ACL ( Prices and taxes section) , enter a 'Retail price' (for retailers) and 'Price' for consume and click the ACL and deselect retailers, I think????
Please Hikashop crew, correct me if I wrong, but shouldn't that disable 'Price' and force Hikashop to use the 'Retail price' ???
Thx in advance.
I wanted isolate the retail price from the price and only show it to retailers who want to buy this stores products.
Please Log in or Create an account to join the conversation.
This means that you've made a mistake in the code that you wrote. We would need the fatal error message that is in your PHP error log file regarding that blank page, and the full code of the file where that error is (probably the file where you did your modifications). Then we can tell you what's wrong with it.It breaks the page, page becomes white, with only product images and title and product_code not styled, but that's it.
The "Retail price" that you can set in a product is only for display on the product page. It cannot be used in the cart/checkout, and especially not with modifications in the views. But just for the purpose of the display of the prices, yes, you can alter the views to change the display of the price using the retail price.
Please Log in or Create an account to join the conversation.
I even just copied your original listing_price.php that you posted , added the code and I still get the same result, again.
But now that you say the retail price is only for display, I'll have to find another solution, which I think I already have touched upon, is to assign the Price's ACL to the corresponding user groups, right ?
Or maybe it has something to do with this horrible template I'm now stuck with: Holax template by BD Themes.
Worst template ever, they only styled the product details page and the product_listing.php the rest they just left, so the HS carousel doesn't work, no category menu style, the main menu drop down's go off page, the WArp framework is joke compared to all the other amazing ones out there(it's bascially Uikit revamped). If you make changes to the theme manually , then you use the framework to make a change and save it , it will overwrite all the changes you did; plus the support they offer is virtually non-existant, as they just try and brush you off by passing to blame on to Hikashop or Joomla or whatever they can conjure up to not help you. basically no assistance just resistance.
Hikashop should think twice before recommending them on your template page, as what they did so far is far form complete.
Sorry, but had to get that off my chest, it's been so frustrating.
Please Log in or Create an account to join the conversation.
Even if you didn't make any mistake, we still need the fatal error message that you get with the modification. Otherwise, we can't tell you what's wrong.
But yes, you can have different prices for different user groups with the "ACL" column of the product prices listing.
Thank you for your feedback on your template. We'll take it into account.
Please Log in or Create an account to join the conversation.