diff --git a/pmpro-shipping.php b/pmpro-shipping.php index e36740f..2a97c96 100755 --- a/pmpro-shipping.php +++ b/pmpro-shipping.php @@ -12,7 +12,7 @@ if(!defined('PMPRO_SHIPPING_SHOW_REQUIRED')) define( 'PMPRO_SHIPPING_SHOW_REQUIRED', true ); //if false required fields won't have asterisks and non-required fields will say (optional) -define( 'PMPRO_SHIPPING_VERSION', '.7' ); +define( 'PMPRO_SHIPPING_VERSION', '.8' ); /** * Load plugin textdomain. @@ -463,17 +463,11 @@ function pmproship_pmpro_confirmation_message( $confirmation_message, $pmpro_inv $szipcode = get_user_meta( $current_user->ID, "pmpro_szipcode", true ); $sphone = get_user_meta( $current_user->ID, "pmpro_sphone", true ); $scountry = get_user_meta( $current_user->ID, "pmpro_scountry", true ); - - if ( ! empty( $scity ) && ! empty( $sstate ) ) { - $shipping_address = $sfirstname . " " . $slastname . "
" . $saddress1 . "
"; - if ( $saddress2 ) { - $shipping_address .= $saddress2 . "
"; - } - $shipping_address .= $scity . ", " . $sstate . " " . $szipcode; - $shipping_address .= "
" . $scountry; + + $shipping_address = pmpro_formatAddress( trim( $sfirstname . ' ' . $slastname ), $saddress1, $saddress2, $scity, $sstate, $szipcode, $scountry, $sphone ); - $confirmation_message .= '

' . __( 'Shipping Information:', 'pmpro-shipping' ) . '

' . $shipping_address . '

'; - } + $confirmation_message .= '

' . __( 'Shipping Information:', 'pmpro-shipping' ) . '

' . $shipping_address . '

'; + return $confirmation_message; } @@ -509,15 +503,8 @@ function pmproship_pmpro_email_body( $body, $pmpro_email ) { $sphone = get_user_meta( $user_id, "pmpro_sphone", true ); $scountry = get_user_meta( $user_id, "pmpro_scountry", true ); - if ( ! empty( $scity ) && ! empty( $sstate ) ) { - $shipping_address = $sfirstname . " " . $slastname . "
" . $saddress1 . "
"; - if ( $saddress2 ) { - $shipping_address .= $saddress2 . "
"; - } - $shipping_address .= $scity . ", " . $sstate . " " . $szipcode; - } - $shipping_address .= "
" . $scountry; - + $shipping_address = pmpro_formatAddress( trim( $sfirstname . ' ' . $slastname ), $saddress1, $saddress2, $scity, $sstate, $szipcode, $scountry, $sphone ); + if ( ! empty( $shipping_address ) ) { //squeeze the shipping address above the billing information or above the log link if ( strpos( $body, "Billing Information:" ) ) { diff --git a/readme.txt b/readme.txt index d5d0838..3bbfbac 100755 --- a/readme.txt +++ b/readme.txt @@ -29,6 +29,8 @@ Please visit our premium support site at http://www.paidmembershipspro.com for m == Changelog == = .8 - 2020-01-06 = +* ENHANCEMENT: Added phone data to confirmation message, email and Member's List area. +* ENHANCEMENT: General code improvements and optimization. * BUG FIX: Improved registration checks for when users did not select the "Same as Billing" option. * BUG FIX/ENHANCEMENT: Better support for PayPal and other offsite gateways.