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

Displaying number of items left when product quantity reaches certain level

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 10-07-2009, 03:43 AM
 
joannet joannet is offline
 

Senior Member
  
Join Date: Mar 2006
Posts: 105
 

Default Displaying number of items left when product quantity reaches certain level

I would like to display a message on the product page when the quantity of the product reaches a certain level.

For example, when the quantity reaches 10 (but is >0), the following message displays on the product page:

"Only 10 left".

Then, as further items are sold, this message changes as appropriate - i.e. "Only 9 left", "Only X left", etc

When the product quantity reaches 0, then the product will be Out of Stock and will not be displayed.

Thanks in advance for help.

----

Further to this: if the product quantity is above 10, then no text will be shown, i.e. "Quantity in Stock" text does not show and neither does the quantity itself.

----

This is a version 4.2.2 store.
__________________
/joannet/
X-Cart version 4.1.9 and above
Reply With Quote
  #2  
Old 10-07-2009, 03:54 AM
  amy2203's Avatar 
amy2203 amy2203 is offline
 

X-Wizard
  
Join Date: Jul 2004
Location: Watford, UK
Posts: 1,509
 

Default Re: Displaying number of items left when product quantity reaches certain level

theres a few mods on the forums for this kind of thing, you basically need an if statement to query the amount in stock, and then either display your text, or not.
__________________
X-Cart version 5 (Previously 3.5-4)

Previous Versions included
BCSE Reward Points Mod
Altered Cart On Sale Mod
Wordpress Plugin

Please don't PM me for support. I help where I can on the forum and your question will more likely be answered there.

Shout me a Coffee!
Reply With Quote
  #3  
Old 10-07-2009, 03:57 AM
 
joannet joannet is offline
 

Senior Member
  
Join Date: Mar 2006
Posts: 105
 

Default Re: Displaying number of items left when product quantity reaches certain level

I have searched but haven't found anything suitable in the forum on the subject.

Hopefully someone can provide me with exact instructions.

Thanks for your help Amy
__________________
/joannet/
X-Cart version 4.1.9 and above
Reply With Quote
  #4  
Old 10-07-2009, 04:01 AM
  amy2203's Avatar 
amy2203 amy2203 is offline
 

X-Wizard
  
Join Date: Jul 2004
Location: Watford, UK
Posts: 1,509
 

Default Re: Displaying number of items left when product quantity reaches certain level

http://forum.x-cart.com/showthread.php?t=21276
__________________
X-Cart version 5 (Previously 3.5-4)

Previous Versions included
BCSE Reward Points Mod
Altered Cart On Sale Mod
Wordpress Plugin

Please don't PM me for support. I help where I can on the forum and your question will more likely be answered there.

Shout me a Coffee!
Reply With Quote
  #5  
Old 10-07-2009, 04:16 AM
 
joannet joannet is offline
 

Senior Member
  
Join Date: Mar 2006
Posts: 105
 

Default Re: Displaying number of items left when product quantity reaches certain level

thanks for the link to the thread, however it doesn't quite fit what I'm after.

The statement should be something like:

if qty is less than 11 but greater than 0, then display "Only qty left", otherwise if qty greater than 11, don't display any message.

Note that "Only qty left" will change as the qty drops - e.g. "Only 10 left", "Only 9 left".

[Note: if qty = 0, the product is not displayed at all - which can be enabled in admin anyway].

Thanks
__________________
/joannet/
X-Cart version 4.1.9 and above
Reply With Quote
  #6  
Old 10-07-2009, 04:25 AM
  amy2203's Avatar 
amy2203 amy2203 is offline
 

X-Wizard
  
Join Date: Jul 2004
Location: Watford, UK
Posts: 1,509
 

Default Re: Displaying number of items left when product quantity reaches certain level

yu just need a combination of the standard display and an if, so basically,

if qty is less than 11 disply text "Only " + qty in stock variable + "left"

you need to think around mods like these to adjust them to your exact requirements.
__________________
X-Cart version 5 (Previously 3.5-4)

Previous Versions included
BCSE Reward Points Mod
Altered Cart On Sale Mod
Wordpress Plugin

Please don't PM me for support. I help where I can on the forum and your question will more likely be answered there.

Shout me a Coffee!
Reply With Quote
  #7  
Old 10-07-2009, 04:38 AM
 
joannet joannet is offline
 

Senior Member
  
Join Date: Mar 2006
Posts: 105
 

Default Re: Displaying number of items left when product quantity reaches certain level

Thanks - Appreciate your help, Amy.
__________________
/joannet/
X-Cart version 4.1.9 and above
Reply With Quote
  #8  
Old 01-18-2010, 02:03 AM
 
Learner Learner is offline
 

X-Adept
  
Join Date: Dec 2008
Posts: 807
 

Default Re: Displaying number of items left when product quantity reaches certain level

Yes I am also finding the same If the quantities are five pieces left then say"Almost Sold out" and if one piece left then say "last One" in products/product page.

Is it possible?
__________________
4.6.1 Platinum


Reply With Quote
  #9  
Old 01-18-2010, 02:50 AM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,201
 

Default Re: Displaying number of items left when product quantity reaches certain level

Yes it is. Did that for joannet. Contact me if you are interested, I can do it for you
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote
  #10  
Old 01-18-2010, 02:55 AM
 
Learner Learner is offline
 

X-Adept
  
Join Date: Dec 2008
Posts: 807
 

Default Re: Displaying number of items left when product quantity reaches certain level

Quote:
Originally Posted by cflsystems
Yes it is. Did that for joannet. Contact me if you are interested, I can do it for you

Can you help me how to do this?
__________________
4.6.1 Platinum


Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not 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 10:05 AM.

   

 
X-Cart forums © 2001-2020