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

#   Product Variants and Radio Buttons annoying issue

##

- **[Sod1991](/forum/user/37127-sod1991 "View Sod1991's Profile")**
- [![Sod1991's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/37127-sod1991 "View Sod1991's Profile") Topic Author
- [ Offline](/forum/user/37127-sod1991)

Less More

- Posts: 3
- Thank you received: 0
-
-

11 years 5 months ago -  11 years 5 months ago [\#200424](#200424) by [Sod1991](/forum/user/37127-sod1991 "View Sod1991's Profile")  *[Product Variants and Radio Buttons annoying issue](/forum/26-product-category-display/876719-product-variants-and-radio-buttons-annoying-issue#200424 "-- url of the page with the problem -- :   hammocks.ie/index.php/hammocks/product/4...s-setting-and-sleeve  -- HikaShop version -- : 2.4.0 -- Joomla version -- : 3.3.6 -- PHP version -- : 5.4.33  My client wants to keep radio buttons as the way to select a product, he also wants to have the default option - called &quot;Select from below&quot; to display general product pictures. This causes problems because if the quantity for this variant is set to zero then the product is listed as out of stock. If I change the quantity to unlimited then customers buy the product but then have to be emailed asking which color they want.  Is there a way to keep the radio buttons, keep the first option as select from below, and have it so that users cannot add this option to cart - without it saying that the product is out of stock?")* was created by *[Sod1991](/forum/user/37127-sod1991 "View Sod1991's Profile")*

-- url of the page with the problem -- : [ hammocks.ie/index.php/hammocks/product/4...s-setting-and-sleeve](http://hammocks.ie/index.php/hammocks/product/467-ticket-to-the-moon-new-parachute-single-hammock-with-express-setting-and-sleeve)
-- HikaShop version -- : 2.4.0
-- Joomla version -- : 3.3.6
-- PHP version -- : 5.4.33

My client wants to keep radio buttons as the way to select a product, he also wants to have the default option - called "Select from below" to display general product pictures. This causes problems because if the quantity for this variant is set to zero then the product is listed as out of stock. If I change the quantity to unlimited then customers buy the product but then have to be emailed asking which color they want.

Is there a way to keep the radio buttons, keep the first option as select from below, and have it so that users cannot add this option to cart - without it saying that the product is out of stock?

Last edit: 11 years 5 months ago by [Sod1991](/forum/user/37127-sod1991 "View Sod1991's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84NzY3MTktcHJvZHVjdC12YXJpYW50cy1hbmQtcmFkaW8tYnV0dG9ucy1hbm5veWluZy1pc3N1ZT90bXBsPW1hcmtkb3du) 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)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86290
- Thank you received: 14268
-
-

11 years 5 months ago [\#200428](#200428) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Product Category and Radio Buttons](/forum/26-product-category-display/876719-product-variants-and-radio-buttons-annoying-issue#200428 "-- url of the page with the problem -- :   hammocks.ie/index.php/hammocks/product/4...s-setting-and-sleeve  -- HikaShop version -- : 2.4.0 -- Joomla version -- : 3.3.6 -- PHP version -- : 5.4.33  My client wants to keep radio buttons as the way to select a product, he also wants to have the default option - called &quot;Select from below&quot; to display general product pictures. This causes problems because if the quantity for this variant is set to zero then the product is listed as out of stock. If I change the quantity to unlimited then customers buy the product but then have to be emailed asking which color they want.  Is there a way to keep the radio buttons, keep the first option as select from below, and have it so that users cannot add this option to cart - without it saying that the product is out of stock?")*

Hi,

There is no option for that, so what you want to do is to edit your product page layout ( show_default normally, but in your case it's show_tabular) via the menu Display&gt;Views and remove the lines: Code:

$this-&gt;setLayout('quantity'); echo $this-&gt;loadTemplate();

That will remove the add to cart and "no stock" message for the default variant of the products.
Note that this supposes that all the products are like that. If you have other products without variants, or without a default variant that you don't want to be purchasable, you want to add a condition on that piece of code instead of removing the code, so that you remove the display of that area only when necessary.

The following user(s) said Thank You: [Sod1991](/forum/user/37127-sod1991 "View Sod1991's Profile")

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

- **[Sod1991](/forum/user/37127-sod1991 "View Sod1991's Profile")**
- [![Sod1991's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/37127-sod1991 "View Sod1991's Profile") Topic Author
- [ Offline](/forum/user/37127-sod1991)

Less More

- Posts: 3
- Thank you received: 0
-
-

11 years 5 months ago [\#200484](#200484) by [Sod1991](/forum/user/37127-sod1991 "View Sod1991's Profile")  Replied by *[Sod1991](/forum/user/37127-sod1991 "View Sod1991's Profile")* on topic *[Product Category and Radio Buttons](/forum/26-product-category-display/876719-product-variants-and-radio-buttons-annoying-issue#200484 "-- url of the page with the problem -- :   hammocks.ie/index.php/hammocks/product/4...s-setting-and-sleeve  -- HikaShop version -- : 2.4.0 -- Joomla version -- : 3.3.6 -- PHP version -- : 5.4.33  My client wants to keep radio buttons as the way to select a product, he also wants to have the default option - called &quot;Select from below&quot; to display general product pictures. This causes problems because if the quantity for this variant is set to zero then the product is listed as out of stock. If I change the quantity to unlimited then customers buy the product but then have to be emailed asking which color they want.  Is there a way to keep the radio buttons, keep the first option as select from below, and have it so that users cannot add this option to cart - without it saying that the product is out of stock?")*

Thanks for the quick reply,

There are some products that don't have variants, and some default variants need to be purchasable, what should the modified line look like?

-Sean.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84NzY3MTktcHJvZHVjdC12YXJpYW50cy1hbmQtcmFkaW8tYnV0dG9ucy1hbm5veWluZy1pc3N1ZT90bXBsPW1hcmtkb3du) 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)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86290
- Thank you received: 14268
-
-

11 years 5 months ago [\#200493](#200493) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Product Category and Radio Buttons](/forum/26-product-category-display/876719-product-variants-and-radio-buttons-annoying-issue#200493 "-- url of the page with the problem -- :   hammocks.ie/index.php/hammocks/product/4...s-setting-and-sleeve  -- HikaShop version -- : 2.4.0 -- Joomla version -- : 3.3.6 -- PHP version -- : 5.4.33  My client wants to keep radio buttons as the way to select a product, he also wants to have the default option - called &quot;Select from below&quot; to display general product pictures. This causes problems because if the quantity for this variant is set to zero then the product is listed as out of stock. If I change the quantity to unlimited then customers buy the product but then have to be emailed asking which color they want.  Is there a way to keep the radio buttons, keep the first option as select from below, and have it so that users cannot add this option to cart - without it saying that the product is out of stock?")*

Then you would have to create a custom product field via the menu Display&gt;Custom fields to select in each product edition page if the area should be displayed or not by default.
For example, suppose that you call that field "not_display_area" with two values "yes" and "no", the code would then look like this: Code:

if(!empty($this-&gt;element-&gt;main)) $this-&gt;element-&gt;not_display_area = $this-&gt;element-&gt;main-&gt;not_display_area; if($this-&gt;element-&gt;not_display_area !='yes'){ $this-&gt;setLayout('quantity'); echo $this-&gt;loadTemplate(); }

The following user(s) said Thank You: [Sod1991](/forum/user/37127-sod1991 "View Sod1991's Profile")

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

- **[Sod1991](/forum/user/37127-sod1991 "View Sod1991's Profile")**
- [![Sod1991's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/37127-sod1991 "View Sod1991's Profile") Topic Author
- [ Offline](/forum/user/37127-sod1991)

Less More

- Posts: 3
- Thank you received: 0
-
-

11 years 5 months ago [\#200732](#200732) by [Sod1991](/forum/user/37127-sod1991 "View Sod1991's Profile")  Replied by *[Sod1991](/forum/user/37127-sod1991 "View Sod1991's Profile")* on topic *[Product Category and Radio Buttons](/forum/26-product-category-display/876719-product-variants-and-radio-buttons-annoying-issue#200732 "-- url of the page with the problem -- :   hammocks.ie/index.php/hammocks/product/4...s-setting-and-sleeve  -- HikaShop version -- : 2.4.0 -- Joomla version -- : 3.3.6 -- PHP version -- : 5.4.33  My client wants to keep radio buttons as the way to select a product, he also wants to have the default option - called &quot;Select from below&quot; to display general product pictures. This causes problems because if the quantity for this variant is set to zero then the product is listed as out of stock. If I change the quantity to unlimited then customers buy the product but then have to be emailed asking which color they want.  Is there a way to keep the radio buttons, keep the first option as select from below, and have it so that users cannot add this option to cart - without it saying that the product is out of stock?")*

Perfect thank you.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84NzY3MTktcHJvZHVjdC12YXJpYW50cy1hbmQtcmFkaW8tYnV0dG9ucy1hbm5veWluZy1pc3N1ZT90bXBsPW1hcmtkb3du) 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.227 seconds

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

[](#top)
