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.
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
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
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
Hi,
Thanks for that - i will give it a try later on and let you know how i get on.
Cheers
Charlie
Offline
Hi, ashdog24,
just added it - works great thank you.
all the best
Charlie
Offline
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
Offline
Hi Nick,
I'm getting the exact banner twice.
Cheers ;-) ,
Steve
Offline
hi steve
try chaning (in ste_prod.pl)
######### ######### 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
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
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:
######### ######### 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:
######### ######### 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
Offline
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
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
Offline
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
Offline
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
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
Offline
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
Offline