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,
I have come up with a little crude mod that changes the add to cart button, say if you want something to be pre-order or special order ect.
It's very crude and has taken me two days to work out, thought i'd share it as i've used this forum and give a bit back.
this works for me and i have tested it please use only if you klnow what your doing and have back ups, i cannot be held responsible for any mess-ups you make.
i'm going to give you my code as i don't have time to explain it fully i'm really sorry about this but if somebody wishes to deveop it further thats great.
It requires you edit the add to cart routine in ste_prod.pl file.
First make another cart button name it preorder.gif or anything and place it into the media/images/button directory.
heres is the main code:
#######################################################################
# Ste Prod Show AddToCart #
#######################################################################
sub ste_prod_show_addtocart {
&initialize_sub_add('ste_prod_show_addtocart');
#########
######### This routine prints the add to cart button for products
######### where inventory levels allow you to add the item to the
######### cart.
#########
if ((($product_useinv eq "Y") || ($product_useinv eq "Y" && $product_inv > "0")) && ($product_pricestatus ne "D") && ($product_pricestatus ne "N")) {
print <<ENDOFTEXT;
<INPUT TYPE="IMAGE" SRC="$images_path/button/submit_addtocart.gif" BORDER="0" VALUE="submit">
ENDOFTEXT
} ######### End of if statement.
&initialize_sub_remove('ste_prod_show_addtocart');
} ######### End of subroutine.
#######################################################################
# Ste Prod Show AddToCart Detail #
#######################################################################
sub ste_prod_show_addtocart_detail {
&initialize_sub_add('ste_prod_show_addtocart_detail');
#########
######### This routine prints the add to cart button for products
######### where inventory levels allow you to add the item to the
######### cart. This is for product detail displays.
#########
if ((($product_useinv eq "Y") || ($product_useinv eq "Y" && $product_inv > "0")) && ($product_pricestatus ne "D")) {
if (($product_pricestatus ne "N") || ($product_pricestatus eq "Y" && $optionproddisp_count > "0")) {
&display_print('ste_proddet_quan');
print <<ENDOFTEXT;
<CENTER><INPUT TYPE="IMAGE" SRC="$images_path/button/submit_addtocart.gif" BORDER="0" VALUE="submit"></CENTER>
ENDOFTEXT
} ######### End of if statement.
} ######### End of if statement.
&initialize_sub_remove('ste_prod_show_addtocart_detail');
} ######### End of subroutine.
** NOW YOU MUST CREATE ROUTINES WHICH ARE CALLED UPON IN YOUR PROUCT CATAGORY AND DETAIL DISPLAYS:
#######################################################################
# Ste Prod Show AddToCart Pre-Order Routine #
#######################################################################
sub ste_prod_show_addtocart_preorder {
&initialize_sub_add('ste_prod_show_addtocart_preorder');
#########
######### This routine prints the pre order add to cart button for products
######### where inventory levels allow you to add the item to the
######### cart.
#########
if ((($product_useinv eq "N") || ($product_useinv eq "N" && $product_inv > "0")) && ($product_pricestatus ne "D") && ($product_pricestatus ne "N")) {
print <<ENDOFTEXT;
<center><INPUT TYPE="IMAGE" SRC="$images_path/button/preorder.gif" BORDER="0" VALUE="submit"></center>
ENDOFTEXT
} ######### End of if statement.
&initialize_sub_remove('ste_prod_show_addtocart_preorder');
} ######### End of subroutine.
#######################################################################
# Ste Prod Show AddToCart PreOrder Detail #
#######################################################################
sub ste_prod_show_addtocart_detail_preorder {
&initialize_sub_add('ste_prod_show_addtocart_detail_preorder');
#########
######### This routine prints the add to cart button for products
######### where inventory levels allow you to add the item to the
######### cart. This is for product detail displays.
#########
if ((($product_useinv eq "N") || ($product_useinv eq "N" && $product_inv > "0")) && ($product_pricestatus ne "D")) {
if (($product_pricestatus ne "N") || ($product_pricestatus eq "N" && $optionproddisp_count > "0")) {
&display_print('ste_proddet_quan');
print <<ENDOFTEXT;
<CENTER><INPUT TYPE="IMAGE" SRC="$images_path/button/preorder.gif" BORDER="0" VALUE="submit"></CENTER>
ENDOFTEXT
} ######### End of if statement.
} ######### End of if statement.
&initialize_sub_remove('ste_prod_show_addtocart_detail_preorder');
} ######### End of subroutine.
**** now you must put (CGIGET TYPE="SUB" VALUE="ste_prod_show_addtocart_preorder") in your Product catagory AND detail displays so it shows up.
Now you can make your item preorder by going to the product and selecting NO in Use Declining Balance Inventory.
The only thing is the add to cart button returns when the item is out of stock but what i did was edited ny set_outofstock with:
Currently Out Of Stock<br>Special Order
And anything which is out of stock and not available for order i just select Pricing Type * | Not For Sales. I have an availablility field for each product so i put out of stock!
I'm sorry if this is confusing i'm hoping webmast ect takes this up as i know its crude but it works and doesn't cause any problems with the cart.
Maybe i have used a sledge hammer to crack a nut but the last programming i did was a beavis and butthead pong game on AMOS on the Amiga 1200 about 12 years ago !!
I'll try my best to help if you have any problems but i cannot promise anything. hope this works for you.
Thanks
CCP is THE best cart software to use !!!
Offline
This sounds like what I need, but I confess I am not enough of a coder to understand the instructions!
Am I replacing code or adding code to the ste_prod.pl?
"now you must put (CGIGET TYPE="SUB" VALUE="ste_prod_show_addtocart_preorder") in your Product catagory AND detail displays so it shows up."
How do you do this?
"I have an availablility field for each product so i put out of stock!"
What do you mean?
Thanks,
Jess
Offline