X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   How to replace quantity in stock with stock indicator (https://forum.x-cart.com/showthread.php?t=65938)

poweruserlef 01-24-2013 11:51 AM

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

carpeperdiem 01-24-2013 03:19 PM

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?

philrisk 01-25-2013 02:22 AM

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



poweruserlef 01-26-2013 11:24 AM

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??

ADDISON 01-27-2013 12:54 AM

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.

ADDISON 01-27-2013 12:55 AM

Re: How to replace quantity in stock with stock indicator
 
there are a few solutions if you search the forum too.

poweruserlef 02-03-2013 06:47 AM

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.

philrisk 02-04-2013 12:19 AM

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.


All times are GMT -8. The time now is 11:35 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.