whyisjake

ninnypants

May 19th, 2010
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.54 KB | None | 0 0
  1. function add_some_stuff($content) {
  2.     if (is_post_type('the_store')) {
  3.         $display = get_post_custom_values('thestore_display');
  4.         if($display[0]){
  5.             $item_name = the_title('', '', false);
  6.             $shopping_url = get_permalink();
  7.             $item_number = get_the_ID();
  8.             $amount = get_post_custom_values('thestore_price');
  9.             $amount = $amount[0];
  10.             $shipping = get_post_custom_values('thestore_shipping');
  11.             $shipping = $shipping[0];
  12.             $shipping2 = get_post_custom_values('thestore_shipping2');
  13.             $shipping2 = $shipping2[0];
  14.            
  15.             $paypal = <<<PAYPAL
  16.                     <form method="post" action="https://www.paypal.com/cgi-bin/webscr" target="paypal">
  17.                     <input type="hidden" name="cmd" value="_cart">
  18.                     <input type="hidden" name="business" value="$mama_paypal">
  19.                     <input type="hidden" name="item_name" value="$item_name">
  20.                     <input type="hidden" name="shopping_url" value="$shopping_url">
  21.                     <input type="hidden" name="item_number" value="$item_number">
  22.                     <input type="hidden" name="amount" value="$amount">
  23.                     <input type="hidden" name="currency_code" value="USD">
  24.                     <input type="hidden" name="shipping" value="$shipping">
  25.                     <input type="hidden" name="shipping2" value="$shipping2">
  26.                     <input type="hidden" name="handling_cart" value="">
  27.                     <input type="hidden" name="bn"  value="ButtonFactory.PayPal.001">
  28.                     <input type="image" name="add" src="http://www.powersellersunite.com/buttonfactory/sc-but-01.gif">
  29.                     </form>
  30. PAYPAL;
  31.            
  32.            
  33.            
  34.             return $content.$paypal;
  35.         }
  36.     }
  37. }
  38.  
  39. add_action('the_content', 'add_some_stuff');
Add Comment
Please, Sign In to add comment