Display add to cart only to logged users

  • Posts: 1059
  • Thank you received: 11
  • Hikashop Business
1 year 2 months ago #355551

-- HikaShop version -- : 4.7.5
-- Joomla version -- : 3.10.12

Hello!

I have products without prices (free) and i want to display the "add to cart" button only to the registered users.
How do i do that?

Thank you

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

  • Posts: 83007
  • Thank you received: 13400
  • MODERATOR
1 year 2 months ago #355552

Hi,

You could set a price of 0.0001 restricted to the registered user group. That way, with the "display add to cart button for free products" setting turned off, the add to cart button will appear only for registered users.

Last edit: 1 year 2 months ago by nicolas.
The following user(s) said Thank You: verzevoul

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

  • Posts: 1059
  • Thank you received: 11
  • Hikashop Business
1 year 2 months ago #355627

Hi!

I set the price as you suggested, turned on the "add to cart" button but noting changed.

Thank you

Attachments:

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

  • Posts: 83007
  • Thank you received: 13400
  • MODERATOR
1 year 2 months ago #355631

Hi,

I found that product on your website: mixanismoi-syrtarion/odigoi-syrtarion-metal-box/product/3128-odigoi-syrtarion-metabox-12mm/category_pathway-2
I can see that this product has characteristics. If a variant has a price, the price of the main product will be ignored.
I can also see that the add to cart button is displayed even though no price is being displayed.
That should not happen with the "display add to cart button for free products" setting turned off.
Can you check that this setting is properly set ?

The following user(s) said Thank You: verzevoul

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

  • Posts: 1059
  • Thank you received: 11
  • Hikashop Business
1 year 2 months ago #355867

Hi,

The button worked like you suggested but after an import it doesn't work again.
All the prices are 0.000124 only for registered users and the "Display 'add to cart' button for free products" option is turned off.
But i don't know if it has something to do with the import.
I copied-paste to the text area tab.

I'm attaching the CSV file.

Thank you

Attachments:

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

  • Posts: 83007
  • Thank you received: 13400
  • MODERATOR
1 year 2 months ago #355872

Hi,

I don't know why it doesn't work.
I checked your website but everything looks good.
Could you provide a FTP access in order to look into it ?

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

  • Posts: 1059
  • Thank you received: 11
  • Hikashop Business
1 year 2 months ago #355876

I sent you Nicolas!

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

  • Posts: 83007
  • Thank you received: 13400
  • MODERATOR
1 year 2 months ago #355880

Hi,

The problem comes from the price_access column of your prices.
For some reason, it has been changed from ,2, to just 2
This can be fixed with a small MySQL query:

UPDATE #__hikashop_price SET price_access = ',2,' WHERE price_access='2'

However, I don't see how importing your CSV would lead to this since you don't have anything related to prices in there...
Are you sure that you used the CSV you provided in your message ?

The following user(s) said Thank You: verzevoul

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

  • Posts: 1059
  • Thank you received: 11
  • Hikashop Business
1 year 2 months ago #355929

Nicolas hi,

Another issue came up after the last import. Variants were deleted from several products and when i tried to readd them i got the message "Code already exists". I checked the database and the variants are there. I deleted one variant from the database and added the variant again in the backend of the product and it worked correctly. But this is weird. Any thoughts?

Thank you

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

  • Posts: 83007
  • Thank you received: 13400
  • MODERATOR
1 year 2 months ago #355930

Hi,

This probably means that the CSV is wrong. For example, if the variant rows don't have the cells in the characteristics properly filled in.

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

Time to create page: 0.074 seconds
Powered by Kunena Forum