- Posts: 259
- Thank you received: 22
Custom fields on Variants
- rodfarrell
-
Topic Author
- Offline
Less
More
11 years 6 days ago #215863
by rodfarrell
Custom fields on Variants was created by rodfarrell
-- 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?
-- 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.
11 years 5 days ago #215865
by nicolas
Replied by nicolas on topic Custom fields on Variants
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.
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.
- rodfarrell
-
Topic Author
- Offline
Less
More
- Posts: 259
- Thank you received: 22
11 years 8 hours ago #216544
by rodfarrell
Replied by rodfarrell on topic Custom fields on Variants
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.
but no change.
Please Log in or Create an account to join the conversation.
10 years 11 months ago #216611
by nicolas
Replied by nicolas on topic Custom fields on Variants
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 ?
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.
- rodfarrell
-
Topic Author
- Offline
Less
More
- Posts: 259
- Thank you received: 22
10 years 11 months ago #216688
by rodfarrell
Replied by rodfarrell on topic Custom fields on Variants
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.
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.
Please Log in or Create an account to join the conversation.
10 years 11 months ago #216780
by Jerome
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Replied by Jerome on topic Custom fields on Variants
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,
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.
Please Log in or Create an account to join the conversation.
- rodfarrell
-
Topic Author
- Offline
Less
More
- Posts: 259
- Thank you received: 22
10 years 11 months ago #216961
by rodfarrell
Replied by rodfarrell on topic Custom fields on Variants
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.
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.
Please Log in or Create an account to join the conversation.
- rodfarrell
-
Topic Author
- Offline
Less
More
- Posts: 259
- Thank you received: 22
10 years 11 months ago #217487
by rodfarrell
Replied by rodfarrell on topic Custom fields on Variants
Polite bump
Please Log in or Create an account to join the conversation.
- rodfarrell
-
Topic Author
- Offline
Less
More
- Posts: 259
- Thank you received: 22
10 years 11 months ago #218019
by rodfarrell
Replied by rodfarrell on topic Custom fields on Variants
Still looking for a solution to the custom field not being displayed.
Please Log in or Create an account to join the conversation.
- rodfarrell
-
Topic Author
- Offline
Less
More
- Posts: 259
- Thank you received: 22
10 years 11 months ago #218798
by rodfarrell
Replied by rodfarrell on topic Custom fields on Variants
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.
10 years 11 months ago #219097
by nicolas
Replied by nicolas on topic Custom fields on Variants
Hi,
1. Try changing the code:
to:
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.
1. Try changing the code:
Code:
if(!empty($this->fields)){
$this->setLayout('show_block_custom_main');
echo $this->loadTemplate();
}
Code:
$this->setLayout('show_block_custom_main');
echo $this->loadTemplate();
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.224 seconds