- Posts: 9
- Thank you received: 0
Price is 0, but "Add to cart" not hidden
8 years 10 months ago #282447
by samsup
Price is 0, but "Add to cart" not hidden was created by samsup
-- url of the page with the problem -- :
www.samwelsupplies.com/index.php/part-gr...linders-and-heads-wl
-- HikaShop version -- : 3.2.1
-- Joomla version -- : 3.something
Hello,
I have a little problem. Before today, my hikashop always worked fine, when price is 0euro ( acces level public) the "Add to cart" button was hidden, instead a text was displaying "contact your dealer for more information" <- this text was setup in the dictionary file. AS of today, for unknown reasons to me, the add to cart button will not hide. I did make sure that the Display 'add to cart' button for free products is set to "NO"
The dealer and distributor usergroups see their prices, and the add to cart button shows as intended.
Am I missing another possible button or override setting here? I had some ACL issues today with Joomla, and after I got that figured out this issue showed up, but I cannot figure out how this is linked to the "add to cart" button showing..
Any help or suggestion that can point in the right way will be much appreciated, thanks!
-- HikaShop version -- : 3.2.1
-- Joomla version -- : 3.something
Hello,
I have a little problem. Before today, my hikashop always worked fine, when price is 0euro ( acces level public) the "Add to cart" button was hidden, instead a text was displaying "contact your dealer for more information" <- this text was setup in the dictionary file. AS of today, for unknown reasons to me, the add to cart button will not hide. I did make sure that the Display 'add to cart' button for free products is set to "NO"
The dealer and distributor usergroups see their prices, and the add to cart button shows as intended.
Am I missing another possible button or override setting here? I had some ACL issues today with Joomla, and after I got that figured out this issue showed up, but I cannot figure out how this is linked to the "add to cart" button showing..
Any help or suggestion that can point in the right way will be much appreciated, thanks!
Please Log in or Create an account to join the conversation.
8 years 10 months ago #282451
by nicolas
Replied by nicolas on topic Price is 0, but "Add to cart" not hidden
Hi,
If the price displays 0.00€ instead of "Free", ( which you have changed with a translation override to your custom message ), it means that the price in the database is not 0.00000. It must be something like 0.00001, which is rounded to 0, but is not 0 and that's why the add to cart button still displays.
I would recommend checking your product prices (edit them when you are on the product page to see the exact value in the input field).
If the price displays 0.00€ instead of "Free", ( which you have changed with a translation override to your custom message ), it means that the price in the database is not 0.00000. It must be something like 0.00001, which is rounded to 0, but is not 0 and that's why the add to cart button still displays.
I would recommend checking your product prices (edit them when you are on the product page to see the exact value in the input field).
Please Log in or Create an account to join the conversation.
8 years 10 months ago - 8 years 10 months ago #282482
by samsup
Replied by samsup on topic Price is 0, but "Add to cart" not hidden
Hi Nicholas,
Thanks for replying. When I look in the product field, the public price shows to me as:
Price
0.00000
Price with tax
0
I have imported the products via CSV file. I put the prices into the file in this fashion which has so far always worked fine ( 0 showing as free) but today it suddenly decided to go another way..
price_value;price_access
245|199|0;,14,|,15,|,1 ,
Edit;
Display 'Add to cart' button
I just found out that the "add to cart" button remains visible even when " Display 'Add to cart' button " in menu Display > Default parameters for products is set to "NO"
Is there another master override for the add to cart button somewhere else?
Thanks for replying. When I look in the product field, the public price shows to me as:
Price
0.00000
Price with tax
0
I have imported the products via CSV file. I put the prices into the file in this fashion which has so far always worked fine ( 0 showing as free) but today it suddenly decided to go another way..
price_value;price_access
245|199|0;,14,|,15,|,1 ,
Edit;
Display 'Add to cart' button
I just found out that the "add to cart" button remains visible even when " Display 'Add to cart' button " in menu Display > Default parameters for products is set to "NO"
Is there another master override for the add to cart button somewhere else?
Last edit: 8 years 10 months ago by samsup. Reason: Got some more information
Please Log in or Create an account to join the conversation.
8 years 10 months ago #282485
by nicolas
Replied by nicolas on topic Price is 0, but "Add to cart" not hidden
Hi,
You have an extra space between the 1 and the last comma.
That might contribute to the issue.
Besides that I don't know.
If that doesn't help, then we'll need a backend access in order to check on the situation.
You can provide that via our contact form if necessary:
www.hikashop.com/support/contact-us.html
You have an extra space between the 1 and the last comma.
That might contribute to the issue.
Besides that I don't know.
If that doesn't help, then we'll need a backend access in order to check on the situation.
You can provide that via our contact form if necessary:
www.hikashop.com/support/contact-us.html
Please Log in or Create an account to join the conversation.
8 years 10 months ago #282633
by samsup
Replied by samsup on topic Price is 0, but "Add to cart" not hidden
The space before the comma is a copy paste error, I just typed the comma afterward to fix it. In the CSV file there is no space. I will contact you with backend acces as I am lost here
Please Log in or Create an account to join the conversation.
8 years 10 months ago #282780
by nicolas
Replied by nicolas on topic Price is 0, but "Add to cart" not hidden
Hi,
We got the access.
I seems I got confused.
Note that if you create a price through the interface of HikaShop with the price 0.00000 and save the product, you'll see that the price will disappear from the prices listing.
You only have the price there because you specifically asked the import system to add a price entry with a value of 0.
But you actually don't want that.
You want just nothing.
So your CSV shouldn't be :
price_value;price_access
245|199|0;,14,|,15,|,1,
but it should actually be:
price_value;price_access
245|199;,14,|,15,
And in that case, it will work properly.
We got the access.
I seems I got confused.
Note that if you create a price through the interface of HikaShop with the price 0.00000 and save the product, you'll see that the price will disappear from the prices listing.
You only have the price there because you specifically asked the import system to add a price entry with a value of 0.
But you actually don't want that.
You want just nothing.
So your CSV shouldn't be :
price_value;price_access
245|199|0;,14,|,15,|,1,
but it should actually be:
price_value;price_access
245|199;,14,|,15,
And in that case, it will work properly.
The following user(s) said Thank You: samsup
Please Log in or Create an account to join the conversation.
8 years 10 months ago #282783
by samsup
Replied by samsup on topic Price is 0, but "Add to cart" not hidden
Nicholas, thank you so much for finding this out! I see how you changed my first record, it works indeed.
It did work in previous versions of hikashop like you told before, as we had been uploading CVS in that format for the past year or so without problems. Only when we did a reinstall ( and went to latest version) something must have changed. Not a problem, but good to know for others too maybe!
In any case I now know how to fix up my export scripts to provide the correct information
It did work in previous versions of hikashop like you told before, as we had been uploading CVS in that format for the past year or so without problems. Only when we did a reinstall ( and went to latest version) something must have changed. Not a problem, but good to know for others too maybe!
In any case I now know how to fix up my export scripts to provide the correct information
Please Log in or Create an account to join the conversation.
6 months 2 weeks ago - 6 months 2 weeks ago #370714
by arnask
Replied by arnask on topic Price is 0, but "Add to cart" not hidden
The problem is that when you save product with price 0, it removes the price and displays as free product. But if you set the price directly in DB (for many reasons) it shoes 0,00 and Add to cart button is still present. I hide the Add to cart button in CSS with
but i think its not right way to do
Code:
.nx-right:has(.hikashop_product_price_0) .hikabtn.hikacart,
.nx-right:has(.hikashop_product_price_0) .hikashop_quantity_form,
.nx-right:has(.hikashop_product_price_0) .nx-qty-line {
display: none !important;
}
.hikashop_subcontainer:has(.hikashop_product_price_0) .hikabtn.hikacart,
.hikashop_subcontainer:has(.hikashop_product_price_0) .hikashop_product_stock_count,
.hikashop_subcontainer:has(.hikashop_product_price_0) input[name="add"] {
display: none !important;
}
Last edit: 6 months 2 weeks ago by arnask.
Please Log in or Create an account to join the conversation.
6 months 2 weeks ago #370716
by nicolas
Replied by nicolas on topic Price is 0, but "Add to cart" not hidden
Hi,
The "Display add to cart button for free products" setting applies to products that have no price entry at all. A product with a price row set to 0 is not considered "free" by this logic - it has a price, it just happens to be zero. So the add to cart button will still display.
If that's a problem on your end because you have prices with a 0 value, you can simply run a SQL query to delete those price entries:
DELETE FROM #__hikashop_price WHERE price_value = 0
That way, those products will truly have no price and the "Display add to cart button for free products" setting will apply to them correctly.
If you only want to target specific products (e.g., from a certain category), you can use a mass action with a filter and a SQL action using:
DELETE FROM #__hikashop_price WHERE price_value = 0 AND price_product_id = {product_id}
www.hikashop.com/support/documentation/167-massaction-form.html
The "Display add to cart button for free products" setting applies to products that have no price entry at all. A product with a price row set to 0 is not considered "free" by this logic - it has a price, it just happens to be zero. So the add to cart button will still display.
If that's a problem on your end because you have prices with a 0 value, you can simply run a SQL query to delete those price entries:
DELETE FROM #__hikashop_price WHERE price_value = 0
That way, those products will truly have no price and the "Display add to cart button for free products" setting will apply to them correctly.
If you only want to target specific products (e.g., from a certain category), you can use a mass action with a filter and a SQL action using:
DELETE FROM #__hikashop_price WHERE price_value = 0 AND price_product_id = {product_id}
www.hikashop.com/support/documentation/167-massaction-form.html
Please Log in or Create an account to join the conversation.
Time to create page: 0.256 seconds