- Posts: 1184
- Thank you received: 13
Add to cart button always visible
-- Joomla version -- : 3.4.5
-- PHP version -- : 5.4
Hello!
When the quantity of a product is 0, the add to cart button is not displayed.
I read in this topic that hikashop by default doesn't alow it.
My client wants the button to be always visible. I m guessing i have to change or add some php code?
Could you help me?
Thank you!
Please Log in or Create an account to join the conversation.
There is indeed no system to allow for that in HikaShop.
You would have to change at least the code in the _checkQuantity function of the file administrator/components/com_hikashop/classes/cart.php
That's the main function controlling the quantity of the products added to the cart.
Then, you'll want to edit the file 'quantity' of the view "product" which displays the add to cart button itself.
Please Log in or Create an account to join the conversation.
I m not so familiar with php!
Actually, the retail price is only visible to registered group, which is correct, but they must not be able to perchuse, they just see the price.
So the add to cart button needs not to be visible to the registered group or to the unlogged users.
Thank you
Please Log in or Create an account to join the conversation.
In your first message you talk about always displaying the add to cart button regardless of the quantity of the product.
In your last message, you talk about displaying the add to cart button based on the user group.
So which one is it and what do you want ?
For such customizations I would recommend to ask a third party developer to help you with it:
www.hikashop.com/home/our-partners.html
Please Log in or Create an account to join the conversation.
I made it work, sorry for confusing you! It 's my client's demands.
He finally decided that the add to cart button is visible only to the group "Πελάτες".
Anyway, i have one more question, the group "Πελάτες" can see both the retail and the wholesale price, which is correct.
The group "Registered" can see only the retail price, also correct, but instead of the wholesale price the see the title of it "Συνδεθείτε για Τιμές". (see the screenshot)
Attachment PRICE.jpg not found
Is it possible that the group "Registered" see the retail price without seeing also the wholesale price title?
Thank you!
Please Log in or Create an account to join the conversation.
I think that you have done a view edition to display this title, so you have to edit again that view and add a php if condition around the HTML displaying this text in order to display it only when there is a wholesale price.
The view in question should be "product / listing_price".
Please Log in or Create an account to join the conversation.
I have made changes with your help yes, i mnot really sure how to do that yet.
What exactly shoud i add to the code?
Please Log in or Create an account to join the conversation.
This content seems to be correct, do you have edited another view related on the product listing page ?
Please give us a backend access to your website via our contact form with a link to that topic in the message.
hikashop.com/support/contact-us.html
Please Log in or Create an account to join the conversation.
i sent you email with backend access.
Please Log in or Create an account to join the conversation.
I misunderstood your issue, the string "Συνδεθείτε για Τιμές" is the translation for "FREE_PRICE", so the translation is maybe not correct.
To fix your issue I just added a translation override on the "FREE_PRICE" string in order to let it empty.
That way nothing is displayed when no price set.
Here is the documentation for the translation overrides:
hikashop.com/support/faq.html#tran
Please Log in or Create an account to join the conversation.
It' s working now yes, but if i m not logged in at all i can't see the "Συνδεθείτε για Τιμές".
Non logged in users must be able to see the "Συνδεθείτε για Τιμές" so that they know that to see the prices they must login.
Thank you again for your help!
Please Log in or Create an account to join the conversation.
So you have to remove the translation override and edit the view "product / listing_price" and before the line:
Please Log in or Create an account to join the conversation.
It worked just fine! And i did not have to delete the overide, i renamed it to "Συνδεθείτε για τιμές".
Please Log in or Create an account to join the conversation.