- Posts: 17
- Thank you received: 1
Make first variant with stock selected
11 years 5 months ago #199398
by ddasios
Make first variant with stock selected was created 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
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.
Less
More
- Posts: 12953
- Thank you received: 1778
11 years 5 months ago - 11 years 5 months ago #199439
by Mohamed Thelji
Replied by Mohamed Thelji on topic Make first variant with stock selected
Hello Dennis,
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.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.
Last edit: 11 years 5 months ago by Mohamed Thelji.
Please Log in or Create an account to join the conversation.
11 years 5 months ago #199471
by ddasios
Replied by ddasios on topic Make first variant with stock selected
Unfortunately I have to display them all. It is my client's request.
Please Log in or Create an account to join the conversation.
11 years 5 months ago #199526
by nicolas
Replied by nicolas on topic Make first variant with stock selected
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.
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