Hide empty specifications
I'm having trouble with a webshop:
The product view shows specifications such as condition, shipping cost etcetera.
The fields that I leave blank also appear in the product view.
Another webshop i created (my own) doesnt show these fields when left blank.
The only difference is that the other shop is on joomla 2.5.X and this one is on joomla 3
Anyone know where to edit this?
Proud of my website www.hetcomputerwinkeltje.nl
Currently just running catalog mode, but hope to go live soon again
Please Log in or Create an account to join the conversation.
Thanks to check if your view "product / show_block_custom_main" has not been edited.
There is indeed a code in that view which check if the value is empty or not, if empty, we skip the display.
Please Log in or Create an account to join the conversation.
I'm no programmer but I think the code is there? It still shows empty fields
Proud of my website www.hetcomputerwinkeltje.nl
Currently just running catalog mode, but hope to go live soon again
Please Log in or Create an account to join the conversation.
Are you sure that you don't have spaces, or anything else in the field ?
Is it really empty ?
Are these fields custom fields you created, or default fields or the product edition page ?
Please Log in or Create an account to join the conversation.
- Posts: 18
- Thank you received: 0
Same problem here. All empty custom fields appeared in the front end after updating to 2.3.2
"product / show_block_custom_main" looks fine and all fields are indeed empty (no spaces etc.)
Please advise! Thank you
Please Log in or Create an account to join the conversation.
if (!empty ($value) || $value == 0) {
which makes sure that product fields only display if something was entered in them.
So I don't see how that's possible that the custom field displays without value in them.
I've checked on our end and could not reproduce the problem.
So either you have something in the fields (a space, or some other kind of blank character) or you have modified the code in some way and you're not looking at the view file for the correct template.
Please Log in or Create an account to join the conversation.
- Posts: 18
- Thank you received: 0
I just did a quick check in my backup before updating to 2.3.2 and the php code in "show_block_custom_main" was
if (!empty ($value)) {
I changed it to that instead of the: if (!empty ($value) || $value == 0) { you suggested which was already in the view file "show_block_custom_main" after the update, and it now works.
The " || $value == 0) " part of your suggestion seems to be wrong.
Thank you for your prompt reply regardless.
Please Log in or Create an account to join the conversation.
I also had the same issue, where a custom product field was specified, that the heading Specifications and the extra field title were showing, even when the value field was empty. The suggested change to products/show/block_custom_main.php solved that problem for me also.
The Specifications Div now only displays when the extra field is populated.
Thank you to Superpsychics
Please Log in or Create an account to join the conversation.
Thanks for your feedback.
We are investigating on that problem in order to fix it in the next release.
The most difficult part will be to reproduce your problem ; so having details about your configuration could help us to reproduce it and be sure of the fix.
The other possibility is to let you test a potential fix.
Can you please test with the code
Regards,
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Please Log in or Create an account to join the conversation.
I tested with " if(!empty($value) || $value === '0') { " - that code works fine and the Specifications Header and fields are not visible when there is no content in the extra field. If the extra field is populated with a value of '0' or any other value, then the Div with header 'Specifications' and the field Title are visible with the input value also showing.
Should you wish to replicate for testing - I added a single custom product field 'Pallet Quantity' set to show on both frontend and backend - it is not set as a required field as it only applies to a small number of products.
Best Regards
Chris
Please Log in or Create an account to join the conversation.
Replacing
It now ignores empty fields!
Proud of my website www.hetcomputerwinkeltje.nl
Currently just running catalog mode, but hope to go live soon again
Please Log in or Create an account to join the conversation.
For some reason, I guess it must be in views -> compare.php, the empty values(their titles, as the values are empty!) are shown.
Is there something we could add in order not to show them as well in the compare page?
Thank you
Please Log in or Create an account to join the conversation.
You could add the code:
Please Log in or Create an account to join the conversation.
I think this option could be implemented in future releases, tough i know this thread is not the whishing section!
However, I am very happy as it solves allot of problems in my case.
Michael
Please Log in or Create an account to join the conversation.