wpsc_buy_now_button

Located in: Located in: display.functions.php
Version Introduced: 3.8
Parameters Accepted: $product_id

Description: This template tag is used on output the PayPal buy now button instead of the add to cart button.
This tag accepts the product ID as a paramter you can use this function within the product loop and use

 wpsc_the_product_id() 

for the ID. Otherwise if used outside of the product loop you can just enter in any product ID.

Note: It’s best to check if the user has this option turned on in their settings before just out putting the button you can check for that like this:

[php]<?php if((get_option(‘hide_addtocart_button’) == 0) && (get_option(‘addtocart_or_buynow’)==’1′)) : ?>[/php]

Code Example:
[php]
<?php if((get_option(‘hide_addtocart_button’) == 0) && (get_option(‘addtocart_or_buynow’)==’1′)) : ?>
<?php echo wpsc_buy_now_button(wpsc_the_product_id()); ?>
<?php endif ; ?>
[/php]