Jump to content
Sign in to follow this  
John2b

Quantity availability image and text Unlimited

Recommended Posts

Hi,

 

Nice contrib - thanks, it has improved the store no end.

 

I operate my store a little differently than many people seem to though.

 

I need 3 different states:

 

1) In Stock (where stock quantity > 0)

2) Out of stock (where stock quantity =<0)

3) On order (where products_date_available > today)

 

Is it possible for this contrib to look at the products_date_available field in the database and show the 'on order' graphic if it's on order?

 

Many thanks

 

Peter

 

I want to do this aswell.. i got as far as this..

 

if ($products_date_available > date("Y-m-d H:i:s")) { $picto = tep_image(DIR_QUANTITY_ICONS.'on_order.gif'); 
}

 

However this doesn't work, i'm assuming because the date function isn't right... can anyone help me work out what to do? I tried entering the date manually and the whole shop died saying there was an error on the general.php file.

Share this post


Link to post
Share on other sites

It's all fixed and works perfectly. I've even made it so it tells you how many days left till it's in stock.

 

Let me know if you want this :).

Share this post


Link to post
Share on other sites
It's all fixed and works perfectly. I've even made it so it tells you how many days left till it's in stock.

 

Let me know if you want this :).

 

Please, please, please tell us how. I've been trying to do this for months!

 

Thank you in advance.

 

Peter

Share this post


Link to post
Share on other sites
Please, please, please tell us how. I've been trying to do this for months!

 

Thank you in advance.

 

Peter

 

Do you have MSN/ICQ/AIm or IRC? The coding is very messy at the moment and i'd have to guide you through it.

 

Regards.

Rob.

Share this post


Link to post
Share on other sites

Hi i have some problem with the script, first of all i wanna know from where the hell it get the $listing variable or function what ever! why that?

becouse i wanna parse two variables in the function and not only one

 

you use the:

$lc_align = 'center';

// $lc_text = ' ' . $listing['products_quantity'] . ' ';

$lc_text = ' ' . picto_qty($listing['products_quantity']) . ' ';

 

but i wanna use this:

$lc_align = 'center';

// $lc_text = ' ' . $listing['products_quantity'] . ' ';

$lc_text = ' ' . picto_qty($listing['products_quantity'], $listing['posotita_prom']) . ' ';

 

and then in the general.php i make this:

 

function picto_qty($quantity=0,prom_avail=0) {

global $warning_stock ;

if ($quantity > 0 ) { $picto = tep_image(DIR_QUANTITY_ICONS.'stock_green_6.gif', TEXT_STOCK_24).'<br>'. TEXT_STOCK_24 ;

}

elseif (($prom_avail == 0 ) and ($quantity == 0 )) { $picto = tep_image(DIR_QUANTITY_ICONS.'stock_red_6.gif', TEXT_STOCK_BUY).'<br>'. TEXT_STOCK_BUY ;

}

elseif (($prom_avail >= 1 ) and ($quantity == 0 )) { $picto = tep_image(DIR_QUANTITY_ICONS.'stock_orange_4.gif', TEXT_STOCK_DAYS).'<br>'. TEXT_STOCK_DAYS ;

}

elseif (($prom_avail >= 10 ) and ($quantity == 0 )) { $picto = tep_image(DIR_QUANTITY_ICONS.'stock_green_5.gif', TEXT_STOCK_SOON).'<br>'. TEXT_STOCK_SOON ;

}

elseif (($prom_avail == $null ) and ($quantity == 0 )) { $picto = tep_image(DIR_WS_ICONS.'pixel_trans.gif', TEXT_STOCK_TIME).'<br>'. TEXT_STOCK_TIME ;

}

else { $picto = tep_image(DIR_QUANTITY_ICONS.'pixel_trans.gif', TEXT_STOCK_TIME ).'<br>'. TEXT_STOCK_TIME ;

}

return $picto;

}

 

 

So my question is , how should i pass a variable from my database? i can pass all the other variable that exist in my database, but not the one that i have make for all products , why ??? :(

Share this post


Link to post
Share on other sites
Hi i have some problem with the script, first of all i wanna know from where the hell it get the $listing variable or function what ever! why that?

becouse i wanna parse two variables in the function and not only one

 

you use the:

        $lc_align = 'center';

//      $lc_text = ' ' . $listing['products_quantity'] . ' ';

        $lc_text = ' ' . picto_qty($listing['products_quantity']) . ' ';

 

but i wanna use this:

        $lc_align = 'center';

//      $lc_text = ' ' . $listing['products_quantity'] . ' ';

        $lc_text = ' ' . picto_qty($listing['products_quantity'], $listing['posotita_prom']) . ' ';

 

and then in the general.php i make this:

 

function picto_qty($quantity=0,prom_avail=0) {

global $warning_stock ;

if      ($quantity  > 0 ) { $picto = tep_image(DIR_QUANTITY_ICONS.'stock_green_6.gif', TEXT_STOCK_24).'<br>'. TEXT_STOCK_24 ;

}

elseif (($prom_avail == 0 ) and ($quantity == 0 )) {  $picto = tep_image(DIR_QUANTITY_ICONS.'stock_red_6.gif', TEXT_STOCK_BUY).'<br>'. TEXT_STOCK_BUY ;

}

elseif (($prom_avail >= 1 ) and ($quantity == 0 )) {  $picto = tep_image(DIR_QUANTITY_ICONS.'stock_orange_4.gif', TEXT_STOCK_DAYS).'<br>'. TEXT_STOCK_DAYS ;

}

elseif (($prom_avail >= 10 ) and ($quantity == 0 )) {  $picto = tep_image(DIR_QUANTITY_ICONS.'stock_green_5.gif', TEXT_STOCK_SOON).'<br>'. TEXT_STOCK_SOON ;

}

elseif (($prom_avail == $null ) and ($quantity == 0 )) {  $picto = tep_image(DIR_WS_ICONS.'pixel_trans.gif', TEXT_STOCK_TIME).'<br>'. TEXT_STOCK_TIME ;

}

else  { $picto = tep_image(DIR_QUANTITY_ICONS.'pixel_trans.gif', TEXT_STOCK_TIME ).'<br>'. TEXT_STOCK_TIME ;

}

return $picto;

}

So my question is , how should i pass a variable from my database? i can pass all the other variable that exist in my database, but not the one that i have make for all products , why ??? :(

 

 

 

Hi karamelos,

 

I see your point, but my knowledge of PhP and MqSQL is poor, so i'm sorry I can't help you about this issue.


A friendship founded on business is better than a business founded on friendship

Share this post


Link to post
Share on other sites
Hi i have some problem with the script, first of all i wanna know from where the hell it get the $listing variable or function what ever! why that?

becouse i wanna parse two variables in the function and not only one

 

you use the:

        $lc_align = 'center';

//      $lc_text = ' ' . $listing['products_quantity'] . ' ';

        $lc_text = ' ' . picto_qty($listing['products_quantity']) . ' ';

 

but i wanna use this:

        $lc_align = 'center';

//      $lc_text = ' ' . $listing['products_quantity'] . ' ';

        $lc_text = ' ' . picto_qty($listing['products_quantity'], $listing['posotita_prom']) . ' ';

 

and then in the general.php i make this:

 

function picto_qty($quantity=0,prom_avail=0) {

global $warning_stock ;

if      ($quantity  > 0 ) { $picto = tep_image(DIR_QUANTITY_ICONS.'stock_green_6.gif', TEXT_STOCK_24).'<br>'. TEXT_STOCK_24 ;

}

elseif (($prom_avail == 0 ) and ($quantity == 0 )) {  $picto = tep_image(DIR_QUANTITY_ICONS.'stock_red_6.gif', TEXT_STOCK_BUY).'<br>'. TEXT_STOCK_BUY ;

}

elseif (($prom_avail >= 1 ) and ($quantity == 0 )) {  $picto = tep_image(DIR_QUANTITY_ICONS.'stock_orange_4.gif', TEXT_STOCK_DAYS).'<br>'. TEXT_STOCK_DAYS ;

}

elseif (($prom_avail >= 10 ) and ($quantity == 0 )) {  $picto = tep_image(DIR_QUANTITY_ICONS.'stock_green_5.gif', TEXT_STOCK_SOON).'<br>'. TEXT_STOCK_SOON ;

}

elseif (($prom_avail == $null ) and ($quantity == 0 )) {  $picto = tep_image(DIR_WS_ICONS.'pixel_trans.gif', TEXT_STOCK_TIME).'<br>'. TEXT_STOCK_TIME ;

}

else  { $picto = tep_image(DIR_QUANTITY_ICONS.'pixel_trans.gif', TEXT_STOCK_TIME ).'<br>'. TEXT_STOCK_TIME ;

}

return $picto;

}

So my question is , how should i pass a variable from my database? i can pass all the other variable that exist in my database, but not the one that i have make for all products , why ??? :(

 

 

 

Greaaaaatttttttttt!!!!!!!! :((((((( now where should i ask for this ??? :(((

Share this post


Link to post
Share on other sites

Great contribution, but I can't quite get it working.

 

When I upload the changed configure.php file, I lose the colour and images from my site.

 

I can't understand why adding one define line does this. I've checked the name and position of the qicons directory but nothing works.

 

Help :o

 

Tamsyn

Share this post


Link to post
Share on other sites
I want to do this aswell.. i got as far as this..

 

if ($products_date_available > date("Y-m-d H:i:s")) { $picto = tep_image(DIR_QUANTITY_ICONS.'on_order.gif'); 
}

 

However this doesn't work, i'm assuming because the date function isn't right... can anyone help me work out what to do? I tried entering the date manually and the whole shop died saying there was an error on the general.php file.

 

 

 

 

Any Follow up on this??

 

I would like this feature also. Please let us know the answer. :)

Share this post


Link to post
Share on other sites

Hi

 

Is there anyway to add the stock qtys images to the specials page and new products page

I have in the root of my store front

 

Mark

Share this post


Link to post
Share on other sites

I just tried to install it but no success for now.

I get the following message when I enter the site.

 

Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/xxxxxxxxxxx/HTML/catalog/includes/languages/dutch.php on line 314

 

I can not find the problem (with my poor PHP knowledge).

 

Can anybody give me a hint!

 

thanks in advance.

 

Gauthier

Share this post


Link to post
Share on other sites

Please Help Me

ive installed this contribution, but i also have the allprods contribution (AllProducts_V_4.4), the problem im having is that my categories product listing all work fine but my click here to view all products(with image) product listing (which is actually the same page referenced by allprods.php) gives me a quantity of -8? please assist my problem can be found on

 

http://www.adbmarketing.org/catalog

 

This incorrect quantity in result does not show the buy button because i have the contribution no buy button if quantity < 0.

 

where did i go wrong? my php level is poor, but i try

Share this post


Link to post
Share on other sites

Thanks for this contrib! Just what I was looking for!

 

But, is it possible to remove the "buy now"-button if status of the product is EOL (End of life)?

 

Thanks!

Share this post


Link to post
Share on other sites
EXAMPLE: If you use -300 for stock status <available in 1 week> and someone orders a productm the stock number will be changed from -300 to -301 and so on. SO with other words, after selling more then 100 products it will have passed the number of -399, and the produckt availability will be changed to the next availability order you have set.

 

NOTE: Depending how mutch products you sell, you may have to reset the stock back to -300 (so keep that in mind)

 

That seams kind of silly to me.

 

I think if one changes in the "checkout_process.php" (arround 150ish) the line

$stock_left = $stock_values['products_quantity'] - $order->products[$i]['qty'];

to

if($stock_values['products_quantity']>0){
$stock_left = $stock_values['products_quantity'] - $order->products[$i]['qty'];
if($stock_left<0){$stock_left=0}
}else{
$stock_left = $stock_values['products_quantity']; 
}

the shop will stop counting negativ stock numbers down. I hope so. Since my Shop does not count down at all, I will not test it :D .

 

 

By the way:

What does

<?php echo $lc_text = '' . picto_qty($product_info['products_quantity']) . ''; ?>

do?

I changed it to a

<?php $lc_text = '' . picto_qty($product_info['products_quantity']) . ''; echo $lc_text; ?>

for me. I am not sure if this does the same. Sugestions?

Share this post


Link to post
Share on other sites

Hi

 

I installed this contribution and it works fine on product_listing.php, but not on product_info.php.

Here it always shows the red "out of stock" image.

 

What could be the problem/solution?

 

I am using STS - could this be the problem?

 

please help.

 

thanks marco

Share this post


Link to post
Share on other sites
Hi

 

I installed this contribution and it works fine on product_listing.php, but not on product_info.php.

Here it always shows the red "out of stock" image.

 

What could be the problem/solution?

 

I am using STS - could this be the problem?

 

please help.

 

thanks marco

 

 

I Have the same problems but on "new_products.php"...

 

Anyone have an idea how can i solve this

Share this post


Link to post
Share on other sites
I Have the same problems but on "new_products.php"...

 

Anyone have an idea how can i solve this

 

 

Solved, :blink:

Share this post


Link to post
Share on other sites

I installed this contribution and it works fine on product_listing.php, but not on product_info.php.

Here it always shows the red "out of stock" image.

 

 

i have the same problem. Have we news for this?

Edited by Grorakel

Share this post


Link to post
Share on other sites

Hi Guys,

I'm from Spain,and i have a problem with the images.

 

Instead of the images It displayed the blade to indicate the error and when I look at the image properties such as direction of the image I get:

http://localhost/catalog/DIR_QUANTITY_ICONSstock_green_6.gif

 

Why did't it change "DIR_QUANTITY_ICONS" to "images/icons/qicons/"???

 

Thanks.

Edited by mikimiguelon

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×