Custom fields - not visible when the value "0"

  • Posts: 68
  • Thank you received: 0
11 years 5 months ago #150955

Hi,

I would like to have possibility to setup in custom fields value="0" and display this field on front-end and also at back-end side of eshop.

For price comparator I need to set up value "0" for availability.
Availability zero means that the goods is on stock.

Could you please, help me to solve this problem?

Best regards

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

  • Posts: 12953
  • Thank you received: 1778
11 years 5 months ago #150962

Hello,
I didn't totally understood what you wanted to do with your custom field, can give me more information about it ?
Thanks.

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

  • Posts: 68
  • Thank you received: 0
11 years 5 months ago #151019

I need to have possibility to full fill the value of the custom field which is equal to zero and display this field on back-end and front-end side of eshop.

Now, when the value = 0, the custom field is not display.

See attachement

Attachments:

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

  • Posts: 13201
  • Thank you received: 2322
11 years 5 months ago #151288

Hi,

Can you try to set a different value where the title is equal to "0" ?
It's a temporary fix, the customer will see "0" but the value is something else.

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

  • Posts: 68
  • Thank you received: 0
11 years 5 months ago #151295

I realy talk about value. When the value is setup to "0", the title can be anything, than this exact item with value=0 is not visible on the FE even on BE.
The title is not case. I don´t find solutin for title.

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

  • Posts: 13201
  • Thank you received: 2322
11 years 5 months ago #151332

Hi,

Thanks to edit the view "product / show_block_custom_main" and replace:

if (!empty ($value)) {
By:
if (!empty ($value) || $value == 0) {

The following user(s) said Thank You: kopretina

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

  • Posts: 68
  • Thank you received: 0
11 years 5 months ago #151411

Thank you very much. Works perfectly.

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

  • Posts: 68
  • Thank you received: 0
11 years 2 days ago #170532

I am back with question concerning the value of custom fields, which is equal to "0".
It is work perfectly for main produkt. The problem is with variants.

When the value of custom field is equal to zero, the field is not display. When the value is not equal to zero, it si work for variatns well.

Could you help me with this? How I can correct the code to display the custom fields also for variants correctly.

Thank you.

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

  • Posts: 26274
  • Thank you received: 4045
  • MODERATOR
11 years 1 day ago #170589

Hi,

Can you please provide us your :
- HikaShop version number
- Configuration of your (product) custom field (screenshot is good)
- Some link to some product page, if possible.

We will have to reproduce your configuration in our side in order to fix it.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

  • Posts: 68
  • Thank you received: 0
11 years 1 day ago #170613

Hi,

Hikashop version: Bussines 2.3.2
Configuration of product: in attachement

Link to the page, where si not used custom field with value zero and the item "dostupnost" is display well.
sperky.webhotovo.eu/subdom/sperky/index....ranta-livia-corsetti

Link to page, where is used custom field with value zero and the item "dostupnost" is not display well for variants.
In main produkt you see dostupnost "skladem" and value of this is zero. Then you clik on variants. "černá/L" is display well. Then clik on the first one (bílá/M) and the custom field "dostupnos" is not display.
sperky.webhotovo.eu/subdom/sperky/index....6301-julia-obsessive

The web is for the moment on working domain.

Attachments:

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

  • Posts: 26274
  • Thank you received: 4045
  • MODERATOR
11 years 22 hours ago #170717

Hi,

Please override the view "product | show" (or the file "components/com_hikashop/views/products/tmpl/show.php" and replace

	if(!empty($variant->$fieldName))
		$variant->$fieldName = trim($variant->$fieldName);
	if(!empty($variant->$fieldName)) {
By:
	if(!empty($variant->$fieldName))
		$variant->$fieldName = trim($variant->$fieldName);
	if(!empty($variant->$fieldName) || $variant->$fieldName === '0') {
It would fix the issue you got.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

  • Posts: 68
  • Thank you received: 0
11 years 14 hours ago #170733

Thank you very much for help. This fixed the problem.

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

Time to create page: 0.087 seconds
Powered by Kunena Forum