Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / traffic light stock level indicator

traffic light stock level indicator

Locked

Views: 8,691

Results 21 to 33 of 33
This thread is locked. New replies are disabled.
4 Oct 2008, 10:34 PM
#21
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

traffic light stock level indicator

dscott1966:

Thanks that worked for me. THats twice you have helped me Linda i owe you. :clap:

Really?

How much? :smartalec:

Glad that this solution worked for you ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

4 Oct 2008, 10:37 PM
#22
dscott1966 avatar

dscott1966

Zen Follower

Join Date:
Apr 2005
Posts:
298
Plugin Contributions:
0

Re: traffic light stock level indicator

Ajeh:

Really?

How much? :smartalec:

Glad that this solution worked for you ...

You just let me know?:smile:

4 Oct 2008, 10:57 PM
#23
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: traffic light stock level indicator

$5, $10, $50 ... $500 ... :cool:

The Free Forums are, just that, Free ...

We do, however, always extend the offer to our users to consider the 1 time or Monthly Donations to help support both the software and the Free Forums ...

The more everyone supports us, the more we can support each and every one of you in keeping your Online Shops running and your incomes growing and growing and growing ... with the current release as well as future releases ...

Good luck with your shop!

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

8 Nov 2008, 9:58 PM
#24
starbuck avatar

starbuck

New Zenner

Join Date:
Jun 2008
Posts:
47
Plugin Contributions:
0

Re: traffic light stock level indicator

Hi what i want to do is add a 4th state as there are thing that i sell that i dont stock and order on demand. so what i was thinking is that if i have.

1 is good(Green)
=1 is Low stock (yellow)
=0 is Out of stock (Red)
<0 is Pre order (Blue) or =-1 is Pre order

but if I try to put = in the code the page won't work i must be missing something but I don't know what.
can anyone help with this?

9 Nov 2008, 3:10 PM
#25
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: traffic light stock level indicator

Either you have a code issue or you have space(s) or blank line(s) at the bottom of the file after the closing php bracket ?> and that will cause errors ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

9 Nov 2008, 5:17 PM
#26
starbuck avatar

starbuck

New Zenner

Join Date:
Jun 2008
Posts:
47
Plugin Contributions:
0

Re: traffic light stock level indicator

this is the code when i edited it but it don't seem to work aye clues? ```php

<?php if (zen_get_products_stock((int)$_GET['products_id']) >1) { $zc_stock_level_image = '' . "In Stock " . zen_image(DIR_WS_TEMPLATE_ICONS . 'icon_status_green.gif', '', 150, 80) . ''; } elseif (zen_get_products_stock((int)$_GET['products_id']) =0) { $zc_stock_level_image = '' . "out of Stock " . zen_image(DIR_WS_TEMPLATE_ICONS . 'icon_status_red.gif', '', 10, 10) . ''; } elseif (zen_get_products_stock((int)$_GET['products_id']) =-1) { $zc_stock_level_image = '' . "Pre order " . zen_image(DIR_WS_TEMPLATE_ICONS . 'icon_status_blue.gif', '', 10, 10) . ''; } elseif (zen_get_products_stock((int)$_GET['products_id']) =1) { $zc_stock_level_image = '' . "Low Stock " . zen_image(DIR_WS_TEMPLATE_ICONS . 'icon_status_yellow.gif', '', 10, 10) . ''; } echo 'Stock level is ' . $zc_stock_level_image; ?>
9 Nov 2008, 5:35 PM
#27
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: traffic light stock level indicator

You are using:

if (something = somethingelse) {

More or less that is setting something to be the value of somethingelse

Try using == instead of = and see if that doesn't fix things for you ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

9 Nov 2008, 5:49 PM
#28
starbuck avatar

starbuck

New Zenner

Join Date:
Jun 2008
Posts:
47
Plugin Contributions:
0

Re: traffic light stock level indicator

thats cracked it Thanks alot

9 Nov 2008, 5:55 PM
#29
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: traffic light stock level indicator

You are most welcome ... Thanks for the update that this worked and glad that this helped get you back on track ... :smile:

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

9 Aug 2009, 12:37 AM
#30
roryg1 avatar

roryg1

New Zenner

Join Date:
Nov 2007
Posts:
34
Plugin Contributions:
0

Re: traffic light stock level indicator

The code works great! How can I show the dot without the number in stock. Just the image. I must be a little slow but I can't figure it out.

26 Aug 2009, 1:29 PM
#31
omg_entertainment avatar

omg_entertainment

New Zenner

Join Date:
Dec 2008
Location:
Netherlands
Posts:
1
Plugin Contributions:
0

Re: traffic light stock level indicator

Hi there,

I stumbled across this topic while looking for a script to show images instead of numbers for stock.

But I don't have to much experience with php so I hoped someone could help me with it. I only want to show this on th eproduct page itself, not on any lists.

This is what is use (form this topic):

```php

case 'PRODUCT_LIST_QUANTITY':
$lc_align = 'right';
$lc_text = $listing->fields['products_quantity'];
if (zen_get_products_stock((int)$listing->fields['products_id']) >1) {
$zc_stock_level_image = '' . $products_quantity . zen_image(DIR_WS_TEMPLATE_ICONS . 'levertijd-groen.jpg', '', 10, 10) . '';
}

elseif (zen_get_products_stock((int)$listing->fields['products_id']) =1) {
$zc_stock_level_image = '' . $products_quantity . zen_image(DIR_WS_TEMPLATE_ICONS . 'levertijd-oranje.jpg', '', 10, 10) . '';
}

else {
$zc_stock_level_image = '' . $products_quantity . zen_image(DIR_WS_TEMPLATE_ICONS . 'levertijd-rood.jpg', '', 10, 10) . '';
}
$lc_text .= $zc_stock_level_image;


I thinks this (DIR_WS_TEMPLATE_ICONS) is where I point to the directory were the images are located? 

They are in <http://www.mystore.com/levertijdpics>, how do I put this in?

TYA
13 Nov 2009, 10:11 PM
#33
endre avatar

endre

New Zenner

Join Date:
Dec 2008
Posts:
38
Plugin Contributions:
0

Re: traffic light stock level indicator

Hi,
Does anyone how to put the traffic light images under the product images?
I only seem to get them on either the side or the right side of the product image.:huh:

Kind regards
Endre