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

How to replace quantity in stock with stock indicator

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 01-24-2013, 11:51 AM
 
poweruserlef poweruserlef is offline
 

Newbie
  
Join Date: Mar 2012
Posts: 4
 

Default How to replace quantity in stock with stock indicator

How we can displays quantity of product in stock with stock indicator and not the exact number, something like the following link??

http://www.magentocommerce.com/magento-connect/product-stock-quantity-indicator-3259.html
__________________
X-Cart Gold Version 4.4.5
Reply With Quote
  #2  
Old 01-24-2013, 03:19 PM
 
carpeperdiem carpeperdiem is offline
 

X-Guru
  
Join Date: Jul 2006
Location: New York City, USA
Posts: 5,399
 

Default Re: How to replace quantity in stock with stock indicator

You can do this with smarty

file:
/skin/common_files/customer/main/product_details.tpl
(or whatever template file you use for product_details.tpl for your skin)

FIND this code:
Code:
{if $config.Appearance.show_in_stock eq "Y" and $config.General.unlimited_products ne "Y" and $product.distribution eq ""} <tr> <td class="property-name">{$lng.lbl_in_stock}</td> <td class="property-value product-quantity-text" colspan="2"> {if $product.avail gt 0} {$lng.txt_items_available|substitute:"items":$product.avail}

And replace:
Code:
{if $product.avail gt 0} {$lng.txt_items_available|substitute:"items":$product.avail}
with:
{if $product.avail gt 0 and $product.avail lt 4}
<img src="RED_BAR.gif" />
{elseif $product.avail etc....
etc...
{/if}

use smarty to trap for number in stock and display the color bar. This shouldn't take you more than a few minutes to code it.

Yes?
__________________
xcart 4.5.4 gold+ w/x-payments 1.0.6; xcart gold 4.4.4
Reply With Quote
  #3  
Old 01-25-2013, 02:22 AM
 
philrisk philrisk is offline
 

X-Adept
  
Join Date: Jul 2009
Location: Newcastle upon Tyne, UK
Posts: 412
 

Default Re: How to replace quantity in stock with stock indicator

A simple version is this:

PHP Code:
Traffic lights for stock levels:

{if 
$product.avail eq 0}
    
No Stock
{elseif $product.avail lt 10}
    
Low Stock
{else}
    
Good Stock

__________________
Live with Gold 4.5.1
Dedicated Linux server
MaxCDN 4 pull zones
Dedicated SSL

Reply With Quote
  #4  
Old 01-26-2013, 11:24 AM
 
poweruserlef poweruserlef is offline
 

Newbie
  
Join Date: Mar 2012
Posts: 4
 

Default Re: How to replace quantity in stock with stock indicator

I was thinking for something more complex combining the Low limit in stock and the Minimum order amount of every product.


From that numbers I would like to produce the tree or more steps limits and to be different for every product.



Let say that we have some product counted in pieces and some others in meters, some other have minimum quantity to order 10 pieces and some other have 100 meter.



I am trying to find a solution to combining all this data.


Any ideas??
__________________
X-Cart Gold Version 4.4.5
Reply With Quote
  #5  
Old 01-27-2013, 12:54 AM
  ADDISON's Avatar 
ADDISON ADDISON is offline
 

X-Man
  
Join Date: Jan 2008
Posts: 2,613
 

Default Re: How to replace quantity in stock with stock indicator

Make the list of variable you want to manipulate. Then identify them as XC variables. Use them according to your needs. It is a job done with Smarty if statement.
__________________
X-Cart Next: Business 5.2 (learning and testing)
X-Cart Classic: Gold and Gold Plus 4.7
Lots of Modules and Customizations
OS in use: Red Hat Enterprise, Fedora, CentOS, Debian, Ubuntu, Linux Mint, Kali Linux
Ideas for Server configuration (basicaly): Nginx/Pound (reverse proxy), Apache/Nginx (webserver), Squid/Varnish (cache server), HHVM or (PHP-FPM + PHP 5.6 + opcache), MariaDB/Percona MySQL Server, Redis (storing sessions)

You can catch my ideas here: http://ideas.x-cart.com
Reply With Quote
  #6  
Old 01-27-2013, 12:55 AM
  ADDISON's Avatar 
ADDISON ADDISON is offline
 

X-Man
  
Join Date: Jan 2008
Posts: 2,613
 

Default Re: How to replace quantity in stock with stock indicator

there are a few solutions if you search the forum too.
__________________
X-Cart Next: Business 5.2 (learning and testing)
X-Cart Classic: Gold and Gold Plus 4.7
Lots of Modules and Customizations
OS in use: Red Hat Enterprise, Fedora, CentOS, Debian, Ubuntu, Linux Mint, Kali Linux
Ideas for Server configuration (basicaly): Nginx/Pound (reverse proxy), Apache/Nginx (webserver), Squid/Varnish (cache server), HHVM or (PHP-FPM + PHP 5.6 + opcache), MariaDB/Percona MySQL Server, Redis (storing sessions)

You can catch my ideas here: http://ideas.x-cart.com
Reply With Quote
  #7  
Old 02-03-2013, 06:47 AM
 
poweruserlef poweruserlef is offline
 

Newbie
  
Join Date: Mar 2012
Posts: 4
 

Default Re: How to replace quantity in stock with stock indicator

I have try to search the forum and google as well but i have not find something.
Possibly i am searching wrong. Is it possible someone to help me complete this add on
Personally believe that will be useful for many people. At the moment this "module is already created for zen car, magento, and others.
__________________
X-Cart Gold Version 4.4.5
Reply With Quote
  #8  
Old 02-04-2013, 12:19 AM
 
philrisk philrisk is offline
 

X-Adept
  
Join Date: Jul 2009
Location: Newcastle upon Tyne, UK
Posts: 412
 

Default Re: How to replace quantity in stock with stock indicator

Quote:
Originally Posted by poweruserlef
I have try to search the forum and google as well but i have not find something.
Possibly i am searching wrong. Is it possible someone to help me complete this add on
Personally believe that will be useful for many people. At the moment this "module is already created for zen car, magento, and others.

Just use my previous post and add a couple of extra steps and instead of the wording add image refs instead for the steps of the indicator.
__________________
Live with Gold 4.5.1
Dedicated Linux server
MaxCDN 4 pull zones
Dedicated SSL

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


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 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 03:28 PM.

   

 
X-Cart forums © 2001-2020