whyisjake

ninnypants

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