Skip to main content

Make first variant with stock selected

More
11 years 5 months ago #199398 by ddasios
-- HikaShop version -- : HikaShop Essential: 2.4.0

Hello.
I have a Hikashop shoes eshop and the only variants I have there are shoes sizes.
When someone enters the product page, I want to see all the sizes, but the ones that have no stock I make them disabled through html/css.
I have an overwrite of the file hikashop_characteristics.php in my template where I can control this.
But if the product has no stock in the first size, the page makes this as selected option.
I want the first available size with stock to be selected by default when someone enters the product page.
I can achieve that from the hikashop_characteristics.php file, but the checkout box below is not being displayed, because it is being probably calculated by the first size with no stock.
I would appreciate your help
Thanks
Dennis

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

More
11 years 5 months ago - 11 years 5 months ago #199439 by Mohamed Thelji
Hello Dennis,

When someone enters the product page, I want to see all the sizes, but the ones that have no stock I make them disabled through html/css.

The solution will probably just be to set the "Display out of stock products" to NO, then all your size will be available and a valid size will be selected by default.
Last edit: 11 years 5 months ago by Mohamed Thelji.

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

More
11 years 5 months ago #199471 by ddasios
Unfortunately I have to display them all. It is my client's request.

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

More
11 years 5 months ago #199526 by nicolas
In that case, you'll have to add custom code in that hikashop_characteristics.php file you're talking about in your first message.
I suppose that you want to add custom javascript code to refresh the variants system:
window.hikashop.ready( function() {hikashopUpdateVariant(document.getElementById('ID'));});

where ID is to be replaced by the id of the select dropdown of your characteristic.

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

Time to create page: 0.160 seconds
Powered by Kunena Forum