Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Quantity availability image and text Unlimited


Guest

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.

Link to comment
Share on other sites

  • 3 weeks later...

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

Link to comment
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.

Link to comment
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 ??? :(((

Link to comment
Share on other sites

  • 3 weeks later...

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

Link to comment
Share on other sites

  • 4 months later...
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. :)

Link to comment
Share on other sites

  • 2 weeks later...
  • 4 months later...

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

Link to comment
Share on other sites

  • 1 month later...

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

Link to comment
Share on other sites

  • 3 months later...
  • 1 month later...
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?

Link to comment
Share on other sites

  • 1 year later...
  • 4 months later...
  • 1 month later...

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

Link to comment
Share on other sites

  • 3 months later...
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

Link to comment
Share on other sites

  • 3 months later...

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
Link to comment
Share on other sites

  • 1 year later...

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
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...