Hi,
1. Try changing the code:
if(!empty($this->fields)){
$this->setLayout('show_block_custom_main');
echo $this->loadTemplate();
}
to:
$this->setLayout('show_block_custom_main');
echo $this->loadTemplate();
in the show_default view file.
2. Variants not available won't display if you turn off the "show out of stock products" option of the HikaShop configuration. So make sure that this is the case. Then, you'll only see the values that are necessary for the existing variants of your products.
Of course, if you have only one variant for a value of a characteristic, the value will still be available for other value combinations and thus you'll still be able to select unavailable variants due to the way you display the characteristics.
If you want to only be able to display available variants regardless, you can change the "characteristics display method" setting to "list" in the HikaShop configuration.