Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls

Allow customers to order a product in specific quantities only
 
Reply
   X-Cart forums > X-Cart 5 > General questions (X-Cart 5)
 
Thread Tools Search this Thread
  #1  
Old 09-23-2019, 03:02 AM
 
welly welly is offline
 

eXpert
  
Join Date: Mar 2011
Location: UK
Posts: 209
 

Default Allow customers to order a product in specific quantities only

Hi there

Is it possible to force customers to order specific quantities of a product? I'm sure this could be done in 4.x although I never tried it myself, but I can't find any way to do it in 5.x.

For example, I want to offer one of my products in quantities of 32, 64, 96, 128, and 250. I would prefer not to make the quantity an option/variant (eg, 'pack size'), as I think there will be far too many variants this way.

The product in question has 6 base styles and two print options. Each style is priced individually, and there is a per-unit price uplift on one of the print options (the price uplift is the same regardless of the base style).

I admit that my products are usually configured in a very basic way and I try to have only few variants. There are probably some simple ways to achieve what I want. I just don't know what they are!

Many thanks

Welly
__________________
X-Cart Business 5.3.6
Various add-ons

www.traininglines.co.uk
Reply With Quote
  #2  
Old 09-23-2019, 05:29 AM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 13,601
 

Default Re: Allow customers to order a product in specific quantities only

Not without custom coding it. I did a similar one for a client not long ago.
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote
  #3  
Old 09-23-2019, 05:42 AM
 
welly welly is offline
 

eXpert
  
Join Date: Mar 2011
Location: UK
Posts: 209
 

Default Re: Allow customers to order a product in specific quantities only

Thanks, Steve. I thought that might be the answer.

As it is only for one product, I'll see if I can achieve what I want a different way.

Cheers

Welly
__________________
X-Cart Business 5.3.6
Various add-ons

www.traininglines.co.uk
Reply With Quote
  #4  
Old 09-29-2019, 08:35 AM
 
Ed B. Ed B. is online now
 

eXpert
  
Join Date: Apr 2016
Posts: 221
 

Default Re: Allow customers to order a product in specific quantities only

If I am not mistaken, the subject is treated on the page https://devs.x-cart.com/changing_store_logic/forcing_product_quantity_while_adding_to_cart.html
__________________
X-cart 5.2.12, php 5.6
Ed from Grenoble, France
Reply With Quote
  #5  
Old 09-30-2019, 07:26 AM
 
welly welly is offline
 

eXpert
  
Join Date: Mar 2011
Location: UK
Posts: 209
 

Default Re: Allow customers to order a product in specific quantities only

That is a good spot, Ed, many thanks, and a solution might well be derived from that, but I assume it would globally affect all products, and would require some customisation to restrict it to a single one.

I'm not sure I have the skills or inclination for that, but I really appreciate the pointer.

Many thanks

Welly
__________________
X-Cart Business 5.3.6
Various add-ons

www.traininglines.co.uk
Reply With Quote
  #6  
Old 09-30-2019, 09:23 PM
 
Ed B. Ed B. is online now
 

eXpert
  
Join Date: Apr 2016
Posts: 221
 

Default Re: Allow customers to order a product in specific quantities only

If there is just one product, and if its product id doesn't change (it won't unless you remove from and add again to the catalog), probably all you need is to add an if clause like
Code:
if ($item->getProductId()=x){ }
(here x is the product id of your product) in an appropriate place in the code.
__________________
X-cart 5.2.12, php 5.6
Ed from Grenoble, France
Reply With Quote
Reply
   X-Cart forums > X-Cart 5 > General questions (X-Cart 5)


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 09:25 PM.

   

 
X-Cart forums © 2001-2018