Product: maximum quantity per order

  • Posts: 29
  • Thank you received: 0
13 years 3 months ago #25709

Hi.

I am trying to limit the quantity order of a product. I set this to 5.

I am still able to add to cart another 5 of a different characteristic, even though it's the same product? Doesn't this limit include characteristics?

Thanks

Last edit: 13 years 3 months ago by sepyh.

Please Log in or Create an account to join the conversation.

  • Posts: 83045
  • Thank you received: 13406
  • MODERATOR
13 years 3 months ago #25710

Hi,

If you have characteristics for a product that limit parameter is indeed done for each possible variant of the product and not for all the variants as a whole.

Please Log in or Create an account to join the conversation.

  • Posts: 29
  • Thank you received: 0
13 years 3 months ago #25711

Ok thanks. Is there an easy way to change that in the code?

Please Log in or Create an account to join the conversation.

  • Posts: 83045
  • Thank you received: 13406
  • MODERATOR
13 years 3 months ago #25712

No. You would need to change the way the quantities of the products in the cart are checked in the file administrator/components/com_hikashop/classes/cart.php but the function for that is already several hundred lines long as it already needs to handle a lot of things.

Please Log in or Create an account to join the conversation.

  • Posts: 29
  • Thank you received: 0
13 years 3 months ago #25713

right ok, thanks.

Please Log in or Create an account to join the conversation.

  • Posts: 45
  • Thank you received: 1
11 years 3 weeks ago #135464

I am still really pleased with Hikashop although I have gotten confused again :S

I am trying to set up our shop where every one of our products will have a min number of items to order with a price break depending on how many are ordered i.e.

Executive pen
50 - 150 - £1.90 - each minimum order of 50
151 - 250 - £1.70 - each minimum order of 151
251+ - £1.64 - each minimum order of 251

All of our products will be sold in this manner.

I have looked and I am not sure if I should be doing this using Characteristics & Variants or what?

Which tutorial or document should I be looking at please?

Still loving Hilkashop :cheer: and I wish I had chosen it BEFORE I spent almost 2 WEEKS looking at other solutions which ultimately were a waste of my time.

Thanks Nicolas :cheer:

Please Log in or Create an account to join the conversation.

  • Posts: 12953
  • Thank you received: 1778
11 years 3 weeks ago #135479

Hi,
If you want to do this :

50 - 150 - £1.90 - each minimum order of 50
151 - 250 - £1.70 - each minimum order of 151
251+ - £1.64 - each minimum order of 251

You'll just have to do it through the "price" tab of your product configuration page by adding new price regarding the "Minimum quantity".

The following user(s) said Thank You: keithstanley

Please Log in or Create an account to join the conversation.

  • Posts: 45
  • Thank you received: 1
11 years 3 weeks ago #135480

Thanks for the Reply Mohamed; :)

I will take a look.

Please Log in or Create an account to join the conversation.

  • Posts: 45
  • Thank you received: 1
11 years 3 weeks ago #135486

Hello Again Mohamed,
I have attached 3 images to show you what is happening now.
I believe that i have done what you suggested and can be seen in image 1.png and image 2.png. :cheer:
However looking at image 3.png the customer can still order 1 item and worst of all it shows the price as FREE. :ohmy: :(
Have I done something wrong or forgotten to do something? :(
Based on what I think I now need is there a way to force the customer to enter only the minimum number?
Or to make the shop only accept the minimum number or to give an error message to the customer if they do not order enough?
I am not too strong on writing my own code so hopefully I can do this by selecting an option which I have not yet selected, I hope.

Again thanks for your help :cheer:

Attachments:
Last edit: 11 years 3 weeks ago by keithstanley.

Please Log in or Create an account to join the conversation.

  • Posts: 13201
  • Thank you received: 2322
11 years 3 weeks ago #135703

Hi,

This request will require some custom code.
Actually the limit ca only limit the maximum of products in the cart, not the minimum.
The prices set as Mohamed said are only to have different prices depending on the quantity but it didn't restrict to a minimum of product to order.

In your case I think that the best way will be to use a plugin based on the function: onBeforeCartUpdate(&$cartClass,&$cart,$product_id,$quantity,$add,$type,$resetCartWhenUpdate,$force,&$do)

Then in this function, check the quantity of the added product, if it's less than desired, set the $do variable to false in order to not update the cart, and display a joomla system message.

Here is the link to the documentation:
www.hikashop.com/support/documentation/6...umentation.html#cart

It require some PHP skills

The following user(s) said Thank You: keithstanley

Please Log in or Create an account to join the conversation.

  • Posts: 45
  • Thank you received: 1
11 years 3 weeks ago #135722

Thanks Xavier,
Am I understanding you correctly; are you saying that I will need to write my own custom coded plugin to handle this situation?

Are there any plugins that I could modify to help me get this started/done or do I need to start from scratch?

Thanks,

Keith

Please Log in or Create an account to join the conversation.

  • Posts: 12953
  • Thank you received: 1778
11 years 3 weeks ago #135740

Hi,
1. Yes
2. No, but the best solution will be to read the documentation and follow the instructions that xavier gave you :

In your case I think that the best way will be to use a plugin based on the function: onBeforeCartUpdate(&$cartClass,&$cart,$product_id,$quantity,$add,$type,$resetCartWhenUpdate,$force,&$do)

Then in this function, check the quantity of the added product, if it's less than desired, set the $do variable to false in order to not update the cart, and display a joomla system message.

The following user(s) said Thank You: keithstanley

Please Log in or Create an account to join the conversation.

  • Posts: 45
  • Thank you received: 1
10 years 6 months ago #162373

This problem is way beyound my skill level!! :(

I thought I had read somewhere that it was possible to pay someone on the forum to help with specific coding problems; is this true?

I have been looking through the Forum and I can not see the area I should be looking in.

Is it possible to pay someone to write the code I need and if so where should I be posting a request / looking.

Many thanks,

Keith

Please Log in or Create an account to join the conversation.

  • Posts: 13201
  • Thank you received: 2322
10 years 5 months ago #162384

Hi,

Here is the forum category where you can post a commercial job:
hikashop.com/forum/9-commercial-jobs.html

Please Log in or Create an account to join the conversation.

Time to create page: 0.108 seconds
Powered by Kunena Forum