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

#   How to display remaining quantity for a variant

##

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

Less More

- Posts: 100
- Thank you received: 1
-
-

13 years 8 months ago [\#93378](#93378) by [paddyrolls](/forum/user/1931-paddyrolls "View paddyrolls's Profile")  *[How to display remaining quantity for a variant](/forum/2-general-talk-about-hikashop/79046-how-to-display-remaining-quantity-for-a-variant#93378 "Hi  I have an option setup called &quot;Term 1 Week 1&quot; and added to this option is a variant: For example Tuesday 6pm - 8pm ( + AUD $17.00 )  Could you tell me how I can display the remaining quantity for the variant  For example: Tuesday 6pm - 8pm ( + AUD $17.00 ) Remaining Spots: 5  Thanks for your help  Patrick")* was created by *[paddyrolls](/forum/user/1931-paddyrolls "View paddyrolls's Profile")*

Hi

I have an option setup called "Term 1 Week 1" and added to this option is a variant:
For example Tuesday 6pm - 8pm ( + AUD $17.00 )

[ ![Variant.jpg](/forum/attachment/8969) ](/forum/attachment/8969 "Variant.jpg")

Could you tell me how I can display the remaining quantity for the variant

For example:
Tuesday 6pm - 8pm ( + AUD $17.00 ) Remaining Spots: 5

Thanks for your help

Patrick

- [ ![Variant.jpg](/forum/attachment/8969) ](/forum/attachment/8969 "Variant.jpg") [ ](/forum/attachment/8969?download=1 "Variant.jpg")

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

- **[Xavier](/forum/user/4105-xavier "View Xavier's Profile")**
- [![Xavier's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar4105.png)](/forum/user/4105-xavier "View Xavier's Profile")
- [ Offline](/forum/user/4105-xavier)

Less More

- Posts: 13201
- Thank you received: 2322
-
-
-
- [](http://www.kidiweb.fr)
-

13 years 8 months ago [\#93427](#93427) by [Xavier](/forum/user/4105-xavier "View Xavier's Profile")  Replied by *[Xavier](/forum/user/4105-xavier "View Xavier's Profile")* on topic *[How to display remaining quantity for a variant](/forum/2-general-talk-about-hikashop/79046-how-to-display-remaining-quantity-for-a-variant#93427 "Hi  I have an option setup called &quot;Term 1 Week 1&quot; and added to this option is a variant: For example Tuesday 6pm - 8pm ( + AUD $17.00 )  Could you tell me how I can display the remaining quantity for the variant  For example: Tuesday 6pm - 8pm ( + AUD $17.00 ) Remaining Spots: 5  Thanks for your help  Patrick")*

Hi,

You can edit the view "product / option" and use the var "$optionElement-&gt;product_quantity" to display the quantity where you want.

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

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

Less More

- Posts: 100
- Thank you received: 1
-
-

13 years 8 months ago [\#93685](#93685) by [paddyrolls](/forum/user/1931-paddyrolls "View paddyrolls's Profile")  Replied by *[paddyrolls](/forum/user/1931-paddyrolls "View paddyrolls's Profile")* on topic *[How to display remaining quantity for a variant](/forum/2-general-talk-about-hikashop/79046-how-to-display-remaining-quantity-for-a-variant#93685 "Hi  I have an option setup called &quot;Term 1 Week 1&quot; and added to this option is a variant: For example Tuesday 6pm - 8pm ( + AUD $17.00 )  Could you tell me how I can display the remaining quantity for the variant  For example: Tuesday 6pm - 8pm ( + AUD $17.00 ) Remaining Spots: 5  Thanks for your help  Patrick")*

HI Xavier

I changed line 87 in file product\option.php file

$text.=' ( '.($positive?'+ ':'').strip_tags($this-&gt;loadTemplate()).' )' . " " . $optionElement-&gt;product_quantity;

However, if I have

Option 1 Variant 1 - quantity = 3
Option 1 Variant 2 - quantity = 4

The quantity 3 gets displayed for both Variant 1 and Variant 2.

Could you tell me if that is the correct file and where I should add $optionElement-&gt;product_quantity

thanks

Patrick

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzItZ2VuZXJhbC10YWxrLWFib3V0LWhpa2FzaG9wLzc5MDQ2LWhvdy10by1kaXNwbGF5LXJlbWFpbmluZy1xdWFudGl0eS1mb3ItYS12YXJpYW50P3RtcGw9bWFya2Rvd24=) 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: 86587
- Thank you received: 14325
-
-

13 years 8 months ago [\#93967](#93967) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[How to display remaining quantity for a variant](/forum/2-general-talk-about-hikashop/79046-how-to-display-remaining-quantity-for-a-variant#93967 "Hi  I have an option setup called &quot;Term 1 Week 1&quot; and added to this option is a variant: For example Tuesday 6pm - 8pm ( + AUD $17.00 )  Could you tell me how I can display the remaining quantity for the variant  For example: Tuesday 6pm - 8pm ( + AUD $17.00 ) Remaining Spots: 5  Thanks for your help  Patrick")*

Hi,

$optionElement-&gt;product_quantity is the quantity of the default variant of the current option.
You should use instead $variant-&gt;product_quantity which is the quantity of the current variant of the current option.

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

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