[Skip to main content](#vessel-content)

#   Make first variant with stock selected

##

- **[ddasios](/forum/user/36689-ddasios "View ddasios's Profile")**
- [![ddasios's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar36689.jpg)](/forum/user/36689-ddasios "View ddasios's Profile") Topic Author
- [ Offline](/forum/user/36689-ddasios)

Less More

- Posts: 17
- Thank you received: 1
-
-

11 years 6 months ago [\#199398](#199398) by [ddasios](/forum/user/36689-ddasios "View ddasios's Profile")  *[Make first variant with stock selected](/forum/26-product-category-display/876516-make-first-variant-with-stock-selected#199398 "-- 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&#95;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&#95;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")* was created by *[ddasios](/forum/user/36689-ddasios "View ddasios's Profile")*

-- 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](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84NzY1MTYtbWFrZS1maXJzdC12YXJpYW50LXdpdGgtc3RvY2stc2VsZWN0ZWQ/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Mohamed Thelji](/forum/user/6861-mohamed-thelji "View Mohamed Thelji's Profile")**
- [![Mohamed Thelji's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar6861.png)](/forum/user/6861-mohamed-thelji "View Mohamed Thelji's Profile")
- [ Offline](/forum/user/6861-mohamed-thelji)

Less More

- Posts: 12953
- Thank you received: 1778
-
-
-

11 years 6 months ago -  11 years 6 months ago [\#199439](#199439) by [Mohamed Thelji](/forum/user/6861-mohamed-thelji "View Mohamed Thelji's Profile")  Replied by *[Mohamed Thelji](/forum/user/6861-mohamed-thelji "View Mohamed Thelji's Profile")* on topic *[Make first variant with stock selected](/forum/26-product-category-display/876516-make-first-variant-with-stock-selected#199439 "-- 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&#95;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&#95;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 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 6 months ago by [Mohamed Thelji](/forum/user/6861-mohamed-thelji "View Mohamed Thelji's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84NzY1MTYtbWFrZS1maXJzdC12YXJpYW50LXdpdGgtc3RvY2stc2VsZWN0ZWQ/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[ddasios](/forum/user/36689-ddasios "View ddasios's Profile")**
- [![ddasios's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar36689.jpg)](/forum/user/36689-ddasios "View ddasios's Profile") Topic Author
- [ Offline](/forum/user/36689-ddasios)

Less More

- Posts: 17
- Thank you received: 1
-
-

11 years 6 months ago [\#199471](#199471) by [ddasios](/forum/user/36689-ddasios "View ddasios's Profile")  Replied by *[ddasios](/forum/user/36689-ddasios "View ddasios's Profile")* on topic *[Make first variant with stock selected](/forum/26-product-category-display/876516-make-first-variant-with-stock-selected#199471 "-- 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&#95;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&#95;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")*

Unfortunately I have to display them all. It is my client's request.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84NzY1MTYtbWFrZS1maXJzdC12YXJpYW50LXdpdGgtc3RvY2stc2VsZWN0ZWQ/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86359
- Thank you received: 14296
-
-

11 years 6 months ago [\#199526](#199526) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Make first variant with stock selected](/forum/26-product-category-display/876516-make-first-variant-with-stock-selected#199526 "-- 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&#95;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&#95;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")*

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](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84NzY1MTYtbWFrZS1maXJzdC12YXJpYW50LXdpdGgtc3RvY2stc2VsZWN0ZWQ/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.051 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
