[oik] plugins.com

WordPress plugins and themes

  • Home
  • About
    • lazy shortcodes
    • smart shortcodes
    • oik base plugin
      • oik – donate
      • oik PayPal buttons
      • oik installation
      • oik Button Shortcode button
      • oik changelog
      • oik FAQ
      • oik plugins on SVN
      • oik plugins on GitHub
  • Plugins
    • oik base plugin
    • FREE oik plugins
    • WordPress plugins
    • Premium oik plugins
    • Bespoke oik plugins
  • Shortcodes
    • Shortcode examples
  • Blocks
    • Block examples
  • APIs
    • ALL action and filter hooks
  • Blog

bw_pp_shortcodes() – PayPal generated code for the buttons was

Description

PayPal generated code for the buttons was

Pay now – rather than Buy Now

<form action="https://www.paypal.com/cgi-bin/webscr" method="post"> 
<input type="hidden" name="cmd" value="_xclick"> 
<input type="hidden" name="business" value="herb@bobbingwide.com"> 
<input type="hidden" name="lc" value="GB"> 

<input type="hidden" name="item_name" value="An evening to Enjoy Discovering Wine"> 
<input type="hidden" name="item_number" value="EDW0128"> 
<input type="hidden" name="amount" value="25.00"> 
<input type="hidden" name="currency_code" value="GBP"> 
<input type="hidden" name="button_subtype" value="services"> 
<input type="hidden" name="no_note" value="0"> 
<input type="hidden" name="bn" value="PP-BuyNowBF:btn_paynowCC_LG.gif:NonHostedGuest"> 
<input type="image" src="https://www.paypal.com/en_GB/i/btn/btn_paynowCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online."> 
<img alt="" border="0" src="https://www.paypal.com/en_GB/i/scr/pixel.gif" width="1" height="1"> 
</form> 
Donate
<form action="https://www.paypal.com/cgi-bin/webscr" method="post"> 
<input type="hidden" name="cmd" value="_donations"> 
<input type="hidden" name="business" value="herb@bobbingwide.com"> 
<input type="hidden" name="lc" value="GB"> 
<input type="hidden" name="item_name" value="Bobbing Wide"> 
<input type="hidden" name="item_number" value="oik"> 
<input type="hidden" name="no_note" value="0"> 
<input type="hidden" name="currency_code" value="GBP"> 
<input type="hidden" name="bn" value="PP-DonationsBF:btn_donate_LG.gif:NonHostedGuest"> 
<input type="image" src="https://www.paypal.com/en_GB/i/btn/btn_donate_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online."> 
<img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1"> 
</form> 
Add to cart
<form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post"> 
<input type="hidden" name="cmd" value="_cart"> 
<input type="hidden" name="business" value="herb@bobbingwide.com"> 
<input type="hidden" name="lc" value="GB"> 
<input type="hidden" name="item_name" value="Find a ball tees"> 
<input type="hidden" name="item_number" value="FABT"> 
<input type="hidden" name="amount" value="4.99"> 
<input type="hidden" name="currency_code" value="GBP"> 
<input type="hidden" name="button_subtype" value="products"> 
<input type="hidden" name="no_note" value="0"> 
<input type="hidden" name="tax_rate" value="0.000"> 
<input type="hidden" name="shipping" value="0.00"> 
<input type="hidden" name="add" value="1"> 
<input type="hidden" name="bn" value="PP-ShopCartBF:btn_cart_LG.gif:NonHostedGuest"> 
<input type="image" src="https://www.paypal.com/en_GB/i/btn/btn_cart_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online."> 
<img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1"> 
</form> 
Note: Image locations are currently hardcoded for en_GB

Usage

bw_pp_shortcodes( $atts, $content, $tag );

Parameters

$atts
( mixed ) optional –
$content
( mixed ) optional –
$tag
( mixed ) optional –

Returns

void

Source

File name: oik/shortcodes/oik-paypal.php
Lines:
1 to 100 of 164
function bw_pp_shortcodes( $atts=NULL, $content=null, $tag=null) {

  oik_require( "bobbforms.inc" );
  //  @TODO When the block is rendered then the default values are set if not already set.
  $bw_paypal_email = bw_array_get( $atts, "email", null );
  if ( !$bw_paypal_email ) {
    $bw_paypal_email = bw_get_option( "paypal-email" );
  }
  $atts['location'] = bw_array_get( $atts, "location", null );
  if ( !$atts['location'] ) {
    $atts['location'] = bw_get_option( "paypal-country" );
  }
  $bw_paypal_location = bw_array_get( $atts, "location", "GB" );
  
  $atts['currency'] = bw_array_get( $atts, "currency", null );
  if ( !$atts['currency'] ) {
    $atts['currency'] = bw_get_option( 'paypal-currency'); 
  } 
  $bw_paypal_currency = bw_array_get( $atts, "currency", 'GBP' ); // hardcoded at present
  $atts['productname'] = bw_array_get( $atts, "productname", "oik-plugin" );
  $atts['sku'] = bw_array_get( $atts, "sku", "oik" );
  $atts['type'] = bw_array_get( $atts, "type", "donate" );
                
  $shipadd = bw_array_get( $atts, 'shipadd', 2 );
  if (!is_numeric($shipadd)) 
    $shipadd = '2';
                
                // set up the common fields for the form
                
                $code  = '<form action="https://www.paypal.com/cgi-bin/webscr" method="post">';
                $code .= ihidden( "business", $bw_paypal_email );
                $code .= ihidden( "lc", $bw_paypal_location );
                $code .= ihidden( "currency_code", $bw_paypal_currency );
                $code .= ihidden( "item_name", $atts['productname'] );
                $code .= ihidden( "item_number", $atts['sku'] );
                
    switch($atts['type']):
                case "pay":
        case "pay-noCC":
                         $code .= ihidden( "cmd", "_xclick" );
                         
                        $code .= ihidden( "amount", bw_array_get( $atts, 'amount', "0.00" ) );
                         $code .= ihidden( "button_subtype", "services" );
                         $code .= ihidden( "no_note", "0" );
                         if ( $atts['type'] === 'pay' ) {
                           $code .= ihidden( "bn", "PP-BuyNowBF:btn_paynowCC_LG.gif:NonHostedGuest" );
                           $code.='<input type="image" src="https://www.paypal.com/en_GB/i/btn/btn_paynowCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online.">';
                         } else {
                           $code .= ihidden( "bn", "PP-BuyNowBF:btn_paynow_LG.gif:NonHostedGuest" );
                            $code.= '<input type="image" src="https://www.paypal.com/en_GB/i/btn/btn_paynow_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online.">';
                         }
                         // <img alt="" border="0" src="https://www.paypal.com/en_GB/i/scr/pixel.gif" width="1" height="1">    
                         // $code .= retimage( NULL, "https://www.paypal.com/en_GB/i/scr/pixel.gif", "", 1, 1 );

                         $code .= retetag( "form" );
                  break;
                  
                  case "buy":
      case "buy-noCC":
                         /* Buy Now and Pay Now are very similar except for the buttons. This one doesn't show the CC (credit cards)
                         */
                         $code .= ihidden( "cmd", "_xclick" );
                         $code .= ihidden( "amount", $atts['amount'] );
                         $code .= ihidden( "button_subtype", "services" );
                         $code .= ihidden( "no_note", "0" );
                         if ( $atts['type'] === 'buy') {
                           $code .= ihidden( "bn", "PP-BuyNowBF:btn_buynowCC_LG.gif:NonHostedGuest" );
                           $code.='<input type="image" src="https://www.paypal.com/en_GB/i/btn/btn_buynowCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online.">';
                         } else {
                           $code .= ihidden( "bn", "PP-BuyNowBF:btn_buynow_LG.gif:NonHostedGuest" );
                           $code.='<input type="image" src="https://www.paypal.com/en_GB/i/btn/btn_buynow_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online.">';
                         }

                         // <img alt="" border="0" src="https://www.paypal.com/en_GB/i/scr/pixel.gif" width="1" height="1">    
                         // $code .= retimage( NULL, "https://www.paypal.com/en_GB/i/scr/pixel.gif", "", 1, 1 );

                         $code .= retetag( "form" );
                  break;
                  

                         

                  case "donate":
                          $code .= ihidden( "cmd", "_donations" );
                          $code .= ihidden( "no_note", "0" );
                          
                          $code .= ihidden( "bn", "PP-DonationsBF:btn_donate_LG.gif:NonHostedGuest" );
                          $code .= '<input type="image" src="https://www.paypal.com/en_GB/i/btn/btn_donate_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online.">';
                          
                          //$code .= retimage( NULL, "https://www.paypal.com/en_GB/i/scr/pixel.gif", "", 1, 1 );

                          $code .= retetag( "form" );
                  break;
                  

      case "add":
      $code .= ihidden( "cmd", "_cart" );
                        $code .= ihidden( "amount", bw_array_get( $atts, 'amount', "0.00" ) );
                        $code .= ihidden( "button_subtype", "products" );
                        $code .= ihidden( "no_note", "0" );
 
[1][2]Next »
 View on GitHub View on Trac

Called by

1 to 1 of 1
  • oik_support() – Display the PayPal donate button

Invoked by

    Calls

    1 to 5 of 5
    • bw_array_get() – Return the array[index] or array->index (for an object) or a default value if not set
    • bw_get_option() – Get the value of an option field
    • ihidden() – Return a hidden input field for a form
    • oik_require() – Invoke require_once on an oik include file or other file
    • retetag() – Return an end tag

    Call hooks

    Function name: bw_pp_shortcodes
    Plugin ref: oik – oik information kit
    Version: 4.15.3
    Sourcefile: shortcodes/oik-paypal.php
    File ref: shortcodes/oik-paypal.php
    API type: shortcode
    Deprecated?: No
    API Letters: B,P,S

    Published: February 2, 2018 | Last updated: February 2, 2018

    Information

    Function name: bw_pp_shortcodes
    Plugin ref: oik – oik information kit
    Version: 4.15.3
    Sourcefile: shortcodes/oik-paypal.php
    File ref: shortcodes/oik-paypal.php
    API type: shortcode
    Deprecated?: No
    API Letters: B,P,S

    Recent plugin updates

    oik-weight-zone-shipping v0.2.13 oik-weight-zone-shipping v0.2.13 has been tested with WooCommerce 10.1.2 and WordPress 6.8.2 ...
    SB Children Block v1.3.0 Upgrade to SB Children Block v1.3.0 for support for PHP 8.3 and PHP 8.4  ...
    oik v4.15.3 Update to oik v4.15.3 for a couple of security fixes. Tested with WordPress 6.8.2 ...
    oik-privacy-policy v1.4.9 Update to oik-privacy-policy v1.4.9 for a security fix. Tested with WordPress 6.8.2 and PHP 8.3 and PHP 8.4 ...
    oik-nivo-slider v1.17.0 oik-nivo-slider v1.17.0 introduces the Nivo slider block - oik-nivo-slider/nivo. ...

    Plugins

    • All Plugins
    • oik base plugin
    • FREE oik plugins
    • WordPress plugins
    • Premium oik plugins

    Themes

    • FREE themes
    • Bespoke themes
    • Premium themes

    Blocks

    • All Blocks
    • Block examples
    • About Blocks

    Shortcodes

    • All Shortcodes
    • Shortcode examples
    • About Shortcodes

    Reference

    • About APIs
    • All APIs
    • All Classes
    • All Files
    • All Hooks

    Support

    • Contact
    • Cookies policy
    • Get API key
    • Privacy
    • Request support
    • Sitemap
    • Stay informed
    • Terms and Conditions
    oik-plugins
    Email: herb@bobbingwide.com

    Weight shipping plugins

    Find out which cart weight shipping plugin you need for your WooCommerce site.
    Which cart weight based plugin do I need?

    Site:  www.oik-plugins.com
    © Copyright oik-plugins 2011-2025. All rights reserved.


    Website designed and developed by Herb Miller of Bobbing Wide
    Proudly powered by WordPress and oik-plugins

    WordPress version: 6.8.3

    Gutenberg version: 21.7.0

    PHP version: 8.2.29