- Posts: 84
- Thank you received: 9
Display 'add to cart' button for free products
10 years 9 months ago #224126
by huwhuw
Display 'add to cart' button for free products was created by huwhuw
-- HikaShop version -- : 2.6.0
-- Joomla version -- : 3.4.5
Hi I have Display 'add to cart' button for free products = No in the Config file however products with a price of 0.00 are still showing the add to cart button.
Is this a bug or is there some other setting I am missing?
I am trying to achieve:
If a price is set to 0.00
1. hide the price and
2. hide the add to cart button.
If I could get the "Display 'add to cart' button for free products = No" function working I can figure out how to hide the price then.
I can confirm I have no template overrides setup in my template html dir.
Thanks for any help
-- Joomla version -- : 3.4.5
Hi I have Display 'add to cart' button for free products = No in the Config file however products with a price of 0.00 are still showing the add to cart button.
Is this a bug or is there some other setting I am missing?
I am trying to achieve:
If a price is set to 0.00
1. hide the price and
2. hide the add to cart button.
If I could get the "Display 'add to cart' button for free products = No" function working I can figure out how to hide the price then.
I can confirm I have no template overrides setup in my template html dir.
Thanks for any help
Please Log in or Create an account to join the conversation.
10 years 9 months ago #224169
by huwhuw
Replied by huwhuw on topic Display 'add to cart' button for free products
I have used the following to hide my price value = 0.00
Got the element property from
www.hikashop.com/support/documentation/157
price_value
Made a template override for
templates/mytemplate/html/com_hikashop/product/listing_price.php
Then after line 46
Add the following
I then changed the language value to "Call for Price" in the joomla Language override.
Can any of the devs shed any light as to why Hikashop is ignoring the "Display 'add to cart' button for free products = No" Setting
Thanks
Got the element property from
www.hikashop.com/support/documentation/157
price_value
Made a template override for
templates/mytemplate/html/com_hikashop/product/listing_price.php
Then after line 46
Code:
<?php
if(empty($this->row->prices)){
echo JText::_('FREE_PRICE');
}
Code:
if (($this->row->prices->price_value == 0.00 )){
echo JText::_('FREE_PRICE');}
Can any of the devs shed any light as to why Hikashop is ignoring the "Display 'add to cart' button for free products = No" Setting
Thanks
Please Log in or Create an account to join the conversation.
10 years 9 months ago #224182
by nicolas
Replied by nicolas on topic Display 'add to cart' button for free products
Hi,
It looks like there is a price for your product but with a value of 0, instead of no price.
Try deleting the price and then saving the product.
Normally, you should not have any price in $this->row->prices and thus the check should work.
It looks like there is a price for your product but with a value of 0, instead of no price.
Try deleting the price and then saving the product.
Normally, you should not have any price in $this->row->prices and thus the check should work.
Please Log in or Create an account to join the conversation.
10 years 9 months ago - 10 years 9 months ago #224201
by huwhuw
Replied by huwhuw on topic SOLVED Display 'add to cart' button for free prod
Ok I see that now and I can confirm the Add to Cart function no longer displays.
However as i am importing hundreds or products for future reference is there a mass action that can set the price_value field to blank.
It seems price_value requires a decimal hence all the prices on import are set to 0.0000
e.g I tried Mass Action > Update the Values > price_value = Null
I found the only way to mass remove prices from free products was to execute a dump of the table
DELETE FROM `jos_database`.`jos_hikashop_price` WHERE `jos_hikashop_price`.`price_value` = 0.0000;
Thanks for the support!
However as i am importing hundreds or products for future reference is there a mass action that can set the price_value field to blank.
It seems price_value requires a decimal hence all the prices on import are set to 0.0000
e.g I tried Mass Action > Update the Values > price_value = Null
I found the only way to mass remove prices from free products was to execute a dump of the table
DELETE FROM `jos_database`.`jos_hikashop_price` WHERE `jos_hikashop_price`.`price_value` = 0.0000;
Thanks for the support!
Last edit: 10 years 9 months ago by huwhuw.
Please Log in or Create an account to join the conversation.
Time to create page: 0.172 seconds