Custom fields on Variants

  • Posts: 259
  • Thank you received: 22
9 years 11 months ago #215863

-- url of the page with the problem -- : www.workscene.com.au
-- HikaShop version -- : 2.6.0
-- Joomla version -- : 3.4.4

I have a clothing site with multiple variants (size/color) for each product. I have created a custom date field for "Expected Stock Availability" which is intended to be applied to each variant when they are out of stock. Not all size/color combinations sell out at the same time or are ordered at the same time so typically the custom date field will only apply to one or two of the variants for a product.

It appears that the custom field only displays on the variant view, if a date has been entered into the parent product page. In the event that one size is out of stock and the date field is filled in, that field won't display on the page unless a due date (not necessarily the same one) is entered for the parent product. Of course if a date is entered for the parent it displays on all of the variants that don't have their own date.

How do we display a custom field for a variant if the custom field is not filled in for the parent product?

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

  • Posts: 84306
  • Thank you received: 13701
  • MODERATOR
9 years 11 months ago #215865

Hi,

Actually, this comes from an improvement we made a while back so that the div around the fields display and the title of the area wouldn't appear when no custom fields would need to be displayed. That way it avoids the display of an empty area with just the title and the border around.
And since the main product is displayed before the variants data, when you display the main product data on the product page, you don't know yet if the variants will need the area or not.
So in your specific case, the simplest will be to edit the file show_block_custom_main via the menu Display>Views and change the code:
$displayTitle = false;
to:
$displayTitle = true;

That will force the custom field area to always be displayed so that the characteristics system can do the dynamic update of the area when you change the characteristic selection.

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

  • Posts: 259
  • Thank you received: 22
9 years 11 months ago #216544

Thanks Nicholas, but this still doesn't display unless the parent product has the custom field populated. I've also tried removing if($displayTitle){
but no change.

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

  • Posts: 84306
  • Thank you received: 13701
  • MODERATOR
9 years 11 months ago #216611

Hi,

Could you provide a link to such product with screenshots of the settings of the product/variants so that we can analyze the issue more in depth ?

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

  • Posts: 259
  • Thank you received: 22
9 years 11 months ago #216688

This is the link to an affected product. www.workscene.com.au/search-results/prod...ow-tradie-short.html
Most of the Khaki variants have no stock and an Expected Stock date. Attached are screen shots of the product and the related view files.

You will also see that unpublished variants (khaki 72R) also still display on the front page.

Attachments:

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

  • Posts: 26274
  • Thank you received: 4045
  • MODERATOR
9 years 11 months ago #216780

Hi,

Please provide a screenshot of that custom field configuration.
(if you can use a regular image instead of a PDF file ; it will be great)

Regarding your variant selector (dropdowns), it is logical that all possible combination are displayed in the lists.
The unpublished variants like the variants without stock will be displayed an "unavailable" and the "add to cart" button will be hidden.

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: 259
  • Thank you received: 22
9 years 11 months ago #216961

Screenshot is attached.

I disagree that is is logical to keep displaying variables that are no longer available and never will be. In the clothing industry colors are added and removed from a product range at every change of season. If last years colors have to be displayed, within a year to 18 months you would be displaying more unavailable products than available ones. This is not a good customer experience.

Attachments:

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

  • Posts: 259
  • Thank you received: 22
9 years 11 months ago #217487

Polite bump

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

  • Posts: 259
  • Thank you received: 22
9 years 10 months ago #218019

Still looking for a solution to the custom field not being displayed.

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

  • Posts: 259
  • Thank you received: 22
9 years 10 months ago #218798

Have I offended someone? It certainly wasn't intentional. I'm just trying to get an answer to my problem with custom fields.

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

  • Posts: 84306
  • Thank you received: 13701
  • MODERATOR
9 years 10 months ago #219097

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.

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

Time to create page: 0.071 seconds
Powered by Kunena Forum