jigneshkaila

Untitled

Jun 6th, 2019
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.13 KB | None | 0 0
  1. add_filter('angelleye_paypal_ratenzahlung_billing_line_1', 'th_angelleye_paypal_ratenzahlung_billing_line_1', 10, 2);
  2.     function th_angelleye_paypal_ratenzahlung_billing_line_1($billing_address_1, $order_id) {
  3.         $house_no = get_post_meta($order_id, 'billing_hausnummer', true);
  4.         if( !empty($house_no)) {
  5.             $billing_address_1 = th_limit_length($billing_address_1 . ' ' . $house_no, 100);
  6.         }
  7.         return $billing_address_1;
  8.     }
  9.     add_filter('angelleye_paypal_ratenzahlung_shipping_line1', 'th_angelleye_paypal_ratenzahlung_shipping_line1', 10, 2);
  10.     function th_angelleye_paypal_ratenzahlung_shipping_line1($shipping_address_1, $order_id) {
  11.         $house_no = get_post_meta($order_id, 'shipping_haus_nummer', true);
  12.         if( !empty($house_no)) {
  13.             $shipping_address_1 = th_limit_length($shipping_address_1 . ' ' . $house_no, 100);
  14.         }
  15.         return $shipping_address_1;
  16.     }
  17.     function th_limit_length($string, $limit = 127) {
  18.         if (strlen($string) > $limit) {
  19.             $string = substr($string, 0, $limit - 3) . '...';
  20.         }
  21.         return $string;
  22.     }
Add Comment
Please, Sign In to add comment