Kryptronic Software Support Forum

You are viewing this forum as a guest. Login to an existing account, or create a new account, to reply to topics and to create new topics.

#1 12-18-2004 22:09:11

thedon122
Member
Registered: 01-21-2004
Posts: 155

Out Of Stock

hi,

is there a way to show 'in stock' where the 'out of stock' message is??? when the inventory is gerater than 1 but still show the 'out of stock' when inventroy is less then 1???

I tried this in the perl code and it did not work!

anyone done this, all ideas welcome.

thanks in advance
Charlie ;-) 

Offline

 

#2 12-21-2004 02:20:36

ashdog24
Member
Registered: 10-05-2004
Posts: 44

Re: Out Of Stock

Hello thedon122,

Try this:

[/CODE]
sub ste_prod_show_stockinfo {

&initialize_sub_add('ste_prod_show_stockinfo');

#########
######### Parameter passing.
#########

my ($useinv,$inv) = @_;



#########
######### If the product is in stock, we display 'in stock';
######### If the product is not in stock. we display 'out of stock';
#########
#########

if ($useinv eq "Y" && $inv <= "0") {

    &display_print('ste_outstock');

} else {

    &display_print('ste_instock');

} ######### End of if statement.


&initialize_sub_remove('ste_prod_show_stockinfo');

} ######### End of subroutine.

[CODE]

Put this code in your file located in the folder. Create another file called to display your in stock message.  I hope this helps!!

Offline

 

#3 12-21-2004 02:34:21

ashdog24
Member
Registered: 10-05-2004
Posts: 44

Re: Out Of Stock

Forgot to add one more thing:

Use this HTML code to call the function:

[/CODE]

(CGIGET TYPE="SUB" VALUE="ste_prod_show_stockinfo" PARAMS="(CGIVAR)product_useinv(/CGIVAR)|(CGIVAR)product_inv(/CGIVAR)")

[CODE]

Sorry about that!!

Offline

 

#4 12-21-2004 05:18:20

thedon122
Member
Registered: 01-21-2004
Posts: 155

Re: Out Of Stock

Hi,

Thanks for that - i will give it a try later on and let you know how i get on.

Cheers
Charlie

Offline

 

#5 12-21-2004 06:33:31

thedon122
Member
Registered: 01-21-2004
Posts: 155

Re: Out Of Stock

Hi, ashdog24,

just added it - works great thank you.

all the best
Charlie

Offline

 

#6 12-21-2004 10:05:47

ashdog24
Member
Registered: 10-05-2004
Posts: 44

Re: Out Of Stock

no prob!!

Offline

 

#7 01-07-2005 13:42:19

steveblueradio
Member
From: Belfast, Northern Ireland
Registered: 06-28-2004
Posts: 755
Website

Re: Out Of Stock

Hi,
Nice mod, and have added it to my site, but I have a problem when it comes to the out of stock. If a product is out of stock it shows 2 out of stock banners. how do I get it to only show one banner.

Cheers  ;-) ,
Steve


I'm Gene Hunt, Your DCI, And it's 1973, Nearly Dinner Time, I'm havin hoops........

Cheers,
Steve
-------------------

Offline

 

#8 01-18-2005 09:34:12

webmaster
Administrator
From: York, PA
Registered: 04-20-2001
Posts: 19798
Website

Re: Out Of Stock

Does it show the same exact banner twice - or is it calling up two different elements?


Nick Hendler

Offline

 

#9 01-18-2005 16:52:26

steveblueradio
Member
From: Belfast, Northern Ireland
Registered: 06-28-2004
Posts: 755
Website

Re: Out Of Stock

Hi Nick,
I'm getting the exact banner twice.

Cheers  ;-) ,
Steve


I'm Gene Hunt, Your DCI, And it's 1973, Nearly Dinner Time, I'm havin hoops........

Cheers,
Steve
-------------------

Offline

 

#10 01-18-2005 18:17:41

thedon122
Member
Registered: 01-21-2004
Posts: 155

Re: Out Of Stock

hi steve


try chaning (in ste_prod.pl)

Code:

#########
######### If the product is inventoried and it is out of stock,
######### we display a message instead of the price.
#########

} elsif ($useinv eq "Y" && $inv <= "0") {

$display_price = "N";

&display_print('ste_outstock');

with

Code:

if ($useinv eq "Y" && $inv <= "0") {
$display_price = "N";
&display_print('ste_outstock');

} else {

&display_print('ste_instock');

} ######### End of if statement.

this is wot i did to sovle the problem of the messeage showing up twice.

hope this helps

Charlie

Offline

 

#11 01-19-2005 17:25:35

steveblueradio
Member
From: Belfast, Northern Ireland
Registered: 06-28-2004
Posts: 755
Website

Re: Out Of Stock

Hi Charlie,

Thanks for the info, tried your hack, but for some reason it didnt work, my site stoped displaying any products. But I did manage to get it to work.

I change this:

Code:

#########
######### If the product is in stock, we display 'in stock';
######### If the product is not in stock. we display 'out of stock';
#########
#########

if ($useinv eq "Y" && $inv <= "0") {

&display_print('ste_outstock');

} else {

&display_print('ste_instock');

} ######### End of if statement.

To this:

Code:

#########
######### If the product is in stock, we display 'in stock';
######### If the product is not in stock. we display 'out of stock';
#########
#########

if ($useinv eq "Y" && $inv <= "0") {

&display_print(' ');

} else {

&display_print('ste_instock');

} ######### End of if statement.


&initialize_sub_remove('ste_prod_show_stockinfo');

} ######### End of subroutine.

It seemed to do the trick

Cheers  ;-) ,
Steve


I'm Gene Hunt, Your DCI, And it's 1973, Nearly Dinner Time, I'm havin hoops........

Cheers,
Steve
-------------------

Offline

 

#12 01-19-2005 18:57:46

thedon122
Member
Registered: 01-21-2004
Posts: 155

Re: Out Of Stock

hi steve

glad u got it to work - shame it wasn't what i siad, must be as i have hacked that file around alot so it works for mine but not others.


all the best
Charlie

Offline

 

#13 01-21-2005 15:31:32

myfunkyshop
Member
From: I Live In The Computer
Registered: 12-28-2004
Posts: 152
Website

Re: Out Of Stock

Hi there,

I was testing my stock balance today and doing checkout via cheque payment and when i except the payment the stock balance stays the same.. How can i edit the code so if someone buys via cheque the stock balance drops by the total the buyer buys...

Hope someone can help


Miss George Clooney



Offline

 

#14 01-21-2005 19:36:43

thedon122
Member
Registered: 01-21-2004
Posts: 155

Re: Out Of Stock

hi,

go to admin panel

Orders & Payment | Manage Payment Methods > click on update Cheque payment

Then at the bottom of the form it says:-


Perform Order Updates (Status, Inventory, Commissions, Downloads, Shipper Email, Stats, Discount Codes) *
change drop down box to 'yes'

plus make sure you have the drop down box in the product set to 'yes' for Use declining Balance Inventory.

have fun

Charlie smile 

Offline

 

#15 09-18-2005 12:25:43

mdarvill
Member
Registered: 09-07-2005
Posts: 4

Re: Out Of Stock

Hi,

I was trying to take this mod one stage further and add a message for pre-order if I set the inventory for the product to 9999.  This is the code that I added based on the orginal suggestions.

#########
######### If the product is in stock, we display 'in stock';
######### If the product has a temp inv of 9999 we display 'pre-order'
######### If the product is not in stock. we display 'out of stock';
#########

if ($useinv eq "Y" && $inv <= "0") {

&display_print(' ');

} elseif ($useinv eq "Y" && $inv = "9999") {

&display_print('ste_preorder');

} else {

&display_print('ste_instock');

} ######### End of if statement.

The problem is that this elseif does not work and I get a blank display.  With the elseif commented out it does work and I get the Instock message.  Can anyone help the syntax for the perl looks correct from what I have read but I am new to Perl!

Thanks, Mark

Offline

 

#16 09-18-2005 12:56:27

dtwg
Member
From: California
Registered: 11-15-2004
Posts: 1339
Website

Re: Out Of Stock

Hi Mark,

In Perl, it's elsif not elseif....

Good luck!

Dave

Offline

 

#17 09-18-2005 17:13:10

mdarvill
Member
Registered: 09-07-2005
Posts: 4

Re: Out Of Stock

Dave,

Fixed... Thanks, this has been driving me nuts this afternoon. Have programmed a fair bit before but told you I was new to Perl!

Thanks for your help.

Mark smile 

Offline

 

#18 07-23-2007 06:32:01

BlossomPink
Member
From: Cumbria, UK.
Registered: 03-19-2004
Posts: 225
Website

Re: Out Of Stock

hi again

thanks for this link, i have added it but it still doesn't show how many are in stock

is it supposed too

if so can you help, if not, does anyone know how to get the amount of items left in stock to show on website please

thanks


BlossomPink

~*~*~*~*~*~*~*~*~*~*~*~

~*~*~*~*~*~*~*~*~*~*~*~

Offline

 

Board footer