Show price without Add to cart button for group

  • Posts: 44
  • Thank you received: 0
10 years 4 months ago #164109

-- HikaShop version -- : 2.3.1

Hi,

I'm trying to set three groups of customers:
1. "Unregistered" - they will see only 'display in div' without prices and 'Add to cart' buttons.
2. "Registered" - they will see only 'display in div' with prices and WITHOUT 'Add to cart' buttons.
3. "Customers" - they will see both 'display in div' and 'display in table' with prices and 'Add to cart' buttons.

Everything is almost ready. "Unregistered" group have no access to prices so 'Add to cart' button is not showing.
The problem is with "Registered" group. They have access to the prices, so they can see 'Add to cart' button, which I want to be shown only to the 3rd group - "Customers".
Is there any Access level option to manage display of the 'Add to cart' button?

Thanks in advance
Denis

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

  • Posts: 12953
  • Thank you received: 1778
10 years 4 months ago #164113

Hello Dennis,
If you have a product with a price and a stock, your customer will automatically be able to add it in his cart, the solution can be to :
- remove "registered" from the access level of your product
- create a "clone" of your product
- set the access level of that new product so that only the "registered" group can access it
- set the quantity of that product to 0

Also note that if you don't want the "No stock" to show, you can directly edit your translation file : www.hikashop.com/download/languages.html#translate

The following user(s) said Thank You: denoo

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

  • Posts: 44
  • Thank you received: 0
10 years 4 months ago #164241

Hi, Mohamed

thank you for your answer. In my case it will be complicated, because I have over 2000 products. And if I got it right, I have to clone all of them. So I'm going to use "display: block;" for 'Add to cart' button on the product page.

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

  • Posts: 846
  • Thank you received: 92
10 years 4 months ago #164251

Hi
Does being log has a register user create a new selector in HTML page ? .
then be register should load a css that override display:none for the add cart button .
in a way custom css attach to status login ?
perhaps a extension laready exist in JED ?
The code ( css js html) ll be here in all case but show or hide using css properties/Values.

Don' know if this make sense ?
extensions.joomla.org/extensions/core-en...tion/head-code/25625

How do you configure register ,unregister , customer ?
Is it implemented by default in joomla ? or do you need some custom code ( php ) ?
does the configuration is set by admin in backEnd or by people themself ( register ,unregister , customer) ?
is there a way to bloc account acces automaticly after create and validate account that need to be activate manually by admin server ?

Regard's

Last edit: 10 years 4 months ago by lionel75.

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

  • Posts: 44
  • Thank you received: 0
10 years 4 months ago #164371

Hi,
no, registered user has no selector in HTML. Is it possible without custom code?
These groups are implemented by default.
Configuration is set by admin.
We have two step registration:
1) on the web, after that user is in "Registered" group
2) by sending some data to us and then admin switches him to "Customers" group.

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

  • Posts: 13201
  • Thank you received: 2322
10 years 4 months ago #164377

Hi,

To hide the add to cart button to everybody but the users in the "customers" group, you can edit the view "product / show_quantity" and add the following code at the top of the view:

<?php
$currUser = JFactory::getUser();
if(!in_array('XX',$currUser->groups)) return false;
?>
Just replace XX by the id of the "customers" group.

Here is documentation about layout edition:
hikashop.com/support/support/documentati...ize-the-display.html

The following user(s) said Thank You: denoo

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

  • Posts: 44
  • Thank you received: 0
10 years 4 months ago #164458

Hi, Xavier

that's it.
Thank you.

Denis

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

Time to create page: 0.088 seconds
Powered by Kunena Forum