snubbr.com

I keep gettin message saying my outgoing SMTP server doesn't support Verisign SSL-Secured connection

Get a Verisign SSL certificate for 30 days FREE. Click here to use coupon...

Get a free trial of Verisign SSL certificates. Click here for this special deal...
Got a question... I keep gettin message saying my outgoing SMTP server doesn't support Verisign SSL-Secured connection Many thanks for any answer. 2nd question I got is.. I have the following line of code in my product_listing.php file..

<a href="<?= tep_href_link("products_new.php","action=buy_now&products_id=".$new_p_id[$i-1])?>"><?=tep_image_button("button_add_to_cart1.gif");?></a>.

If the product is out of stock I want to display a different image, i.e soldout.gif. I have trid the following, but when I load it up I can just see the text of the whole IF statement in my browser. Does anyone know where I am going wrong?.

//BEGIN SOLDOUT.

If ($listing['products_quantity']>-0) {.

<a href="<?= tep_href_link("products_new.php","action=buy_now&products_id=".$new_p_id[$i-1])?>"><?=tep_image_button("button_add_to_cart1.gif");?></a>.

}.

Else{.

<a href="<?= tep_href_link("products_new.php","action=buy_now&products_id=".$new_p_id[$i-1])?>"><?=tep_image_button("soldout.gif");?></a>.

}.

//END SOLDOUT..

Comments (88)

Hmm... I need to find out myself. I don't know what is the answer to that question. I'll do some research and get back to you if I find an good answer. You should email the people at Verisign as they probably could give you an answer..

Comment #1

Ah I see. Im totally not used to coding, I dont suppose you know how I would do this....is it even possible?..

Comment #2

Any pointer in the right direction would really be appreciated with this. Spent a couple of days on it so far...

Comment #3

Like Burt said, you have php and html mixed. You need an opening and closing php tag for the php. Try something like this.

<?php.

//BEGIN SOLDOUT.

If ($listing['products_quantity']>-0) {.

?>.

<a href="<?= tep_href_link("products_new.php","action=buy_now&products_id=".$new_p_id[$i-1])?>"><?=tep_image_button("button_add_to_cart1.gif");?></a>.

<?php.

} else {.

?>.

<a href="<?= tep_href_link("products_new.php","action=buy_now&products_id=".$new_p_id[$i-1])?>"><?=tep_image_button("soldout.gif");?></a>.

<?php.

}.

//END SOLDOUT.

?>.

This post has been edited by.

Bktrain.

: 13 January 2009, 17:48..

Comment #4

Thanks so much, thats been an amazing help and saved me hours...and I've learnt something about PHP!!.

However, it's still not working, but I think there is an issue with the original code. The line that isnt working is;.

If ($listing['products_quantity']>-0).

This if statement isnt capturing products which have 1 or more in stock, everytime it's just going to the ELSE part of the statement. So every single product is getting the soldout.gif.

I've tried changing it to;.

If ($listing['products_quantity']>-0).

But that still doesnt work..

Just for clarity, my current code is;.

<?php.

//BEGIN SOLDOUT.

If ($listing['products_quantity']>-0) {.

?>.

<a href="<?= tep_href_link("products_new.php","action=buy_now&products_id=".$new_p_id[$i-1])?>"><?=tep_image_button("button_add_to_cart1.gif");?></a>.

<?php.

} else { ?>.

<a href="<?= tep_href_link("products_new.php","action=buy_now&products_id=".$new_p_id[$i-1])?>"><?=tep_image_button("soldout.gif");?></a>.

<?php.

}.

//END SOLDOUT.

?>.

Does anyone have any ideas why it is ALWAYS doing soldout.giof and never button_add_to_cart1.gif?..

Comment #5

Try changing this line:.

If ($listing['products_quantity']>0) {.

To.

If ( tep_get_products_stock( $new_p_id[$i-1] ) > 0 ) {..

Comment #6

My friend you are a genius! Worked perfect..

I dont suppose you could explain what that did and why the original didnt work....just so I can get my head around it?.

Thanks again...

Comment #7

The only reason the other code didn't work was this variable:.

$listing['products_quantity'].

Didn't contain correct information (for whatever reason)...

Comment #8

I have the following line of code in my product_listing.php file..

<a href="<?= tep_href_link("products_new.php","action=buy_now&products_id=".$new_p_id[$i-1])?>"><?=tep_image_button("button_add_to_cart1.gif");?></a>.

If the product is out of stock I want to display a different image, i.e soldout.gif. I have trid the following, but when I load it up I can just see the text of the whole IF statement in my browser. Does anyone know where I am going wrong?.

//BEGIN SOLDOUT.

If ($listing['products_quantity']>-0) {.

<a href="<?= tep_href_link("products_new.php","action=buy_now&products_id=".$new_p_id[$i-1])?>"><?=tep_image_button("button_add_to_cart1.gif");?></a>.

}.

Else{.

<a href="<?= tep_href_link("products_new.php","action=buy_now&products_id=".$new_p_id[$i-1])?>"><?=tep_image_button("soldout.gif");?></a>.

}.

//END SOLDOUT..

Comment #9

Because it's not all PHP..

You have some HTML and some PHP in each line of code, hence you must start and stop your PHP properly...

Comment #10


This question was taken from a support group/message board and re-posted here so others can learn from it.

 

Categories: Home | Diet & Weight Management | Vitamins & Supplements | Herbs & Cleansing |

Sexual Health | Medifast Support | Nutrisystem Support | Medifast Questions |

Web Hosting | Web Hosts | Website Hosting | Hosting |

Web Hosting | GoDaddy | Digital Cameras | Best WebHosts |

Web Hosting FAQ | Web Hosts FAQ | Hosting FAQ | Hosting Group |

Hosting Questions | Camera Tips | Best Cameras To Buy | Best Cameras This Year |

Camera Q-A | Digital Cameras Q-A | Camera Forum | Nov 2010 - Cameras |

Oct 2010 - Cameras | Oct 2010 - DSLRs | Oct 2010 - Camera Tips | Sep 2010 - Cameras |

Sep 2010 - DSLRS | Sep 2010 - Camera Tips | Aug 2010 - Cameras | Aug 2010 - DSLR Tips |

Aug 2010 - Camera Tips | July 2010 - Cameras | July 2010 - Nikon Cameras | July 2010 - Canon Cameras |

July 2010 - Pentax Cameras | Medifast Recipes | Medifast Recipes Tips | Medifast Recipes Strategies |

Medifast Recipes Experiences | Medifast Recipes Group | Medifast Recipes Forum | Medifast Support Strategies |

Medifast Support Experiences |

 

(C) Copyright 2010 All rights reserved.