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

#   Limiting options

##

- **[btbjosh](/forum/user/12727-btbjosh "View btbjosh's Profile")**
- [![btbjosh's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/gallery/splatter_hand.png)](/forum/user/12727-btbjosh "View btbjosh's Profile") Topic Author
- [ Offline](/forum/user/12727-btbjosh)

Less More

- Posts: 90
- Thank you received: 1
-
-
-

13 years 9 months ago [\#85887](#85887) by [btbjosh](/forum/user/12727-btbjosh "View btbjosh's Profile")  *[Limiting options](/forum/2-general-talk-about-hikashop/77507-limiting-options#85887 "Hi I'm trying to implement limits on my software purchase so that a user cannot add more than one instance of a software purchase to their cart. This works fine until they try to add a different option to the cart.  For example:  With Empty Cart&gt; Software with OPTION 1 &gt; Add to cart &gt; DONE With Software+ O1 in Cart&gt; Choose Software with OPTION 1 &gt; Add to cart &gt; Limit Reached (As expected)  With Software+O1 in Cart&gt; Choose Software with OPTION 2 &gt; Add to cart &gt; Adds both product and option to cart!  So I end up with Two instances of the product and two different options in the cart.  This is odd behavior considering I have the limit set on the product level.  Any thoughts or help would be appreciated! Thanks!")* was created by *[btbjosh](/forum/user/12727-btbjosh "View btbjosh's Profile")*

Hi I'm trying to implement limits on my software purchase so that a user cannot add more than one instance of a software purchase to their cart. This works fine until they try to add a different option to the cart.

For example:

With Empty Cart&gt; Software with OPTION 1 &gt; Add to cart &gt; DONE
With Software+ O1 in Cart&gt; Choose Software with OPTION 1 &gt; Add to cart &gt; Limit Reached (As expected)

With Software+O1 in Cart&gt; Choose Software with OPTION 2 &gt; Add to cart &gt; Adds both product and option to cart!

So I end up with Two instances of the product and two different options in the cart.

This is odd behavior considering I have the limit set on the product level.

Any thoughts or help would be appreciated!
Thanks!

---

![:)](/media/kunena/emoticons/3.png ":)") — Josh

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzItZ2VuZXJhbC10YWxrLWFib3V0LWhpa2FzaG9wLzc3NTA3LWxpbWl0aW5nLW9wdGlvbnM/dG1wbD1tYXJrZG93bg==) 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 9 months ago [\#85929](#85929) by [Xavier](/forum/user/4105-xavier "View Xavier's Profile")  Replied by *[Xavier](/forum/user/4105-xavier "View Xavier's Profile")* on topic *[Limiting options](/forum/2-general-talk-about-hikashop/77507-limiting-options#85929 "Hi I'm trying to implement limits on my software purchase so that a user cannot add more than one instance of a software purchase to their cart. This works fine until they try to add a different option to the cart.  For example:  With Empty Cart&gt; Software with OPTION 1 &gt; Add to cart &gt; DONE With Software+ O1 in Cart&gt; Choose Software with OPTION 1 &gt; Add to cart &gt; Limit Reached (As expected)  With Software+O1 in Cart&gt; Choose Software with OPTION 2 &gt; Add to cart &gt; Adds both product and option to cart!  So I end up with Two instances of the product and two different options in the cart.  This is odd behavior considering I have the limit set on the product level.  Any thoughts or help would be appreciated! Thanks!")*

Hi,

How do you have set the limit ? Can you give us a screenshot ?

Try to set the limit on the software category only and not on the product.

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

- **[btbjosh](/forum/user/12727-btbjosh "View btbjosh's Profile")**
- [![btbjosh's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/gallery/splatter_hand.png)](/forum/user/12727-btbjosh "View btbjosh's Profile") Topic Author
- [ Offline](/forum/user/12727-btbjosh)

Less More

- Posts: 90
- Thank you received: 1
-
-
-

13 years 9 months ago [\#85973](#85973) by [btbjosh](/forum/user/12727-btbjosh "View btbjosh's Profile")  Replied by *[btbjosh](/forum/user/12727-btbjosh "View btbjosh's Profile")* on topic *[Limiting options](/forum/2-general-talk-about-hikashop/77507-limiting-options#85973 "Hi I'm trying to implement limits on my software purchase so that a user cannot add more than one instance of a software purchase to their cart. This works fine until they try to add a different option to the cart.  For example:  With Empty Cart&gt; Software with OPTION 1 &gt; Add to cart &gt; DONE With Software+ O1 in Cart&gt; Choose Software with OPTION 1 &gt; Add to cart &gt; Limit Reached (As expected)  With Software+O1 in Cart&gt; Choose Software with OPTION 2 &gt; Add to cart &gt; Adds both product and option to cart!  So I end up with Two instances of the product and two different options in the cart.  This is odd behavior considering I have the limit set on the product level.  Any thoughts or help would be appreciated! Thanks!")*

I misspoke, I did actually set the limit on the category. It still functions the same way. Change the option to a different option and the limit doesn't apply.

[ ![Screen&#95;Shot&#95;2013-01-17&#95;at&#95;8&#95;08&#95;28&#95;AM.png](/forum/attachment/8009) ](/forum/attachment/8009 "...8&#95;08&#95;28&#95;AM.png")

---

![:)](/media/kunena/emoticons/3.png ":)") — Josh

- [ ![Screen&#95;Shot&#95;2013-01-17&#95;at&#95;8&#95;08&#95;28&#95;AM.png](/forum/attachment/8009) ](/forum/attachment/8009 "...8&#95;08&#95;28&#95;AM.png") [ ](/forum/attachment/8009?download=1 "...8&#95;08&#95;28&#95;AM.png")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzItZ2VuZXJhbC10YWxrLWFib3V0LWhpa2FzaG9wLzc3NTA3LWxpbWl0aW5nLW9wdGlvbnM/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: 86541
- Thank you received: 14304
-
-

13 years 9 months ago [\#86036](#86036) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Limiting options](/forum/2-general-talk-about-hikashop/77507-limiting-options#86036 "Hi I'm trying to implement limits on my software purchase so that a user cannot add more than one instance of a software purchase to their cart. This works fine until they try to add a different option to the cart.  For example:  With Empty Cart&gt; Software with OPTION 1 &gt; Add to cart &gt; DONE With Software+ O1 in Cart&gt; Choose Software with OPTION 1 &gt; Add to cart &gt; Limit Reached (As expected)  With Software+O1 in Cart&gt; Choose Software with OPTION 2 &gt; Add to cart &gt; Adds both product and option to cart!  So I end up with Two instances of the product and two different options in the cart.  This is odd behavior considering I have the limit set on the product level.  Any thoughts or help would be appreciated! Thanks!")*

So you're saying that whether the limit is set on the category, or on the product itself, you get the same behavior ?
Is the software category directly linked to your product ? If not, could you try to do it with the direct category of the product ?

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

- **[btbjosh](/forum/user/12727-btbjosh "View btbjosh's Profile")**
- [![btbjosh's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/gallery/splatter_hand.png)](/forum/user/12727-btbjosh "View btbjosh's Profile") Topic Author
- [ Offline](/forum/user/12727-btbjosh)

Less More

- Posts: 90
- Thank you received: 1
-
-
-

13 years 9 months ago [\#86039](#86039) by [btbjosh](/forum/user/12727-btbjosh "View btbjosh's Profile")  Replied by *[btbjosh](/forum/user/12727-btbjosh "View btbjosh's Profile")* on topic *[Limiting options](/forum/2-general-talk-about-hikashop/77507-limiting-options#86039 "Hi I'm trying to implement limits on my software purchase so that a user cannot add more than one instance of a software purchase to their cart. This works fine until they try to add a different option to the cart.  For example:  With Empty Cart&gt; Software with OPTION 1 &gt; Add to cart &gt; DONE With Software+ O1 in Cart&gt; Choose Software with OPTION 1 &gt; Add to cart &gt; Limit Reached (As expected)  With Software+O1 in Cart&gt; Choose Software with OPTION 2 &gt; Add to cart &gt; Adds both product and option to cart!  So I end up with Two instances of the product and two different options in the cart.  This is odd behavior considering I have the limit set on the product level.  Any thoughts or help would be appreciated! Thanks!")*

By "Directly Linked" do you mean this?

[ ![Screen&#95;Shot&#95;2013-01-17&#95;at&#95;11&#95;57&#95;12&#95;AM.png](/forum/attachment/8017) ](/forum/attachment/8017 "...1&#95;57&#95;12&#95;AM.png")

---

![:)](/media/kunena/emoticons/3.png ":)") — Josh

- [ ![Screen&#95;Shot&#95;2013-01-17&#95;at&#95;11&#95;57&#95;12&#95;AM.png](/forum/attachment/8017) ](/forum/attachment/8017 "...1&#95;57&#95;12&#95;AM.png") [ ](/forum/attachment/8017?download=1 "...1&#95;57&#95;12&#95;AM.png")

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

- **[btbjosh](/forum/user/12727-btbjosh "View btbjosh's Profile")**
- [![btbjosh's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/gallery/splatter_hand.png)](/forum/user/12727-btbjosh "View btbjosh's Profile") Topic Author
- [ Offline](/forum/user/12727-btbjosh)

Less More

- Posts: 90
- Thank you received: 1
-
-
-

13 years 9 months ago -  13 years 9 months ago [\#86051](#86051) by [btbjosh](/forum/user/12727-btbjosh "View btbjosh's Profile")  Replied by *[btbjosh](/forum/user/12727-btbjosh "View btbjosh's Profile")* on topic *[Limiting options](/forum/2-general-talk-about-hikashop/77507-limiting-options#86051 "Hi I'm trying to implement limits on my software purchase so that a user cannot add more than one instance of a software purchase to their cart. This works fine until they try to add a different option to the cart.  For example:  With Empty Cart&gt; Software with OPTION 1 &gt; Add to cart &gt; DONE With Software+ O1 in Cart&gt; Choose Software with OPTION 1 &gt; Add to cart &gt; Limit Reached (As expected)  With Software+O1 in Cart&gt; Choose Software with OPTION 2 &gt; Add to cart &gt; Adds both product and option to cart!  So I end up with Two instances of the product and two different options in the cart.  This is odd behavior considering I have the limit set on the product level.  Any thoughts or help would be appreciated! Thanks!")*

What's even more odd is that I can add the option "product" to have its own limit. And the functionality works for the options.
It won't let me add two options no matter if it's the same option or a different option. But if I change the option to a different one it will add the base product to the cart.

So it is working like this:
**B = BaseProduct, O= option

STEP 1: B + O1 (Add to cart) = B + O1

STEP 2: B + O1 (Add to cart) = B + O1 + "YOU HAVE REACHED THE LIMIT FOR B &amp; O1"**
Works great...

Now if I switch the option... **STEP 1: B + O1 (Add to cart) = B + O1

STEP 2: B + O2 (Add to cart) = B + B + O1 + "YOU HAVE REACHED THE LIMIT FOR O2"**

So I end up with two base products...

On top of this I was also wondering why when I remove the base product from the cart that the option does not go with it? It should be impossible for people to buy an option without an product.

Thanks for the help.

---

![:)](/media/kunena/emoticons/3.png ":)") — Josh

Last edit: 13 years 9 months ago by [btbjosh](/forum/user/12727-btbjosh "View btbjosh's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzItZ2VuZXJhbC10YWxrLWFib3V0LWhpa2FzaG9wLzc3NTA3LWxpbWl0aW5nLW9wdGlvbnM/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: 86541
- Thank you received: 14304
-
-

13 years 9 months ago [\#86132](#86132) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Limiting options](/forum/2-general-talk-about-hikashop/77507-limiting-options#86132 "Hi I'm trying to implement limits on my software purchase so that a user cannot add more than one instance of a software purchase to their cart. This works fine until they try to add a different option to the cart.  For example:  With Empty Cart&gt; Software with OPTION 1 &gt; Add to cart &gt; DONE With Software+ O1 in Cart&gt; Choose Software with OPTION 1 &gt; Add to cart &gt; Limit Reached (As expected)  With Software+O1 in Cart&gt; Choose Software with OPTION 2 &gt; Add to cart &gt; Adds both product and option to cart!  So I end up with Two instances of the product and two different options in the cart.  This is odd behavior considering I have the limit set on the product level.  Any thoughts or help would be appreciated! Thanks!")*

Hi,

We found the problem. Please try to replace the file administrator/components/com_hikashop/classes/cart.php with the one in the archive enclosed. That fixes the issues with the limits and options in such case.

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

- **[btbjosh](/forum/user/12727-btbjosh "View btbjosh's Profile")**
- [![btbjosh's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/gallery/splatter_hand.png)](/forum/user/12727-btbjosh "View btbjosh's Profile") Topic Author
- [ Offline](/forum/user/12727-btbjosh)

Less More

- Posts: 90
- Thank you received: 1
-
-
-

13 years 9 months ago -  13 years 9 months ago [\#89046](#89046) by [btbjosh](/forum/user/12727-btbjosh "View btbjosh's Profile")  Replied by *[btbjosh](/forum/user/12727-btbjosh "View btbjosh's Profile")* on topic *[Limiting options](/forum/2-general-talk-about-hikashop/77507-limiting-options#89046 "Hi I'm trying to implement limits on my software purchase so that a user cannot add more than one instance of a software purchase to their cart. This works fine until they try to add a different option to the cart.  For example:  With Empty Cart&gt; Software with OPTION 1 &gt; Add to cart &gt; DONE With Software+ O1 in Cart&gt; Choose Software with OPTION 1 &gt; Add to cart &gt; Limit Reached (As expected)  With Software+O1 in Cart&gt; Choose Software with OPTION 2 &gt; Add to cart &gt; Adds both product and option to cart!  So I end up with Two instances of the product and two different options in the cart.  This is odd behavior considering I have the limit set on the product level.  Any thoughts or help would be appreciated! Thanks!")*

Thank you for posting this.

The limits now seem to work great!

Thanks again! ![:cheer:](/media/kunena/emoticons/2.png ":cheer:")

---

![:)](/media/kunena/emoticons/3.png ":)") — Josh

Last edit: 13 years 9 months ago by [btbjosh](/forum/user/12727-btbjosh "View btbjosh's Profile").

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

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