string_replacer_wccs

The WooCommerce Checkout Manager string replacer wccs function.

Description

string_replacer_wccs( $order ); 

Parameters (1)

0. $order
The order.

Usage

  1. if ( !function_exists( 'string_replacer_wccs' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'woocommerce-checkout-manager/includes/classes/main.php'; 
  3.  
  4. // The order. 
  5. $order = null; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = string_replacer_wccs($order); 
  9.  

Defined (1)

The function is defined in the following location(s).

/includes/classes/main.php  
  1. function string_replacer_wccs( $order ) { 
  2. $options = get_option( 'wccs_settings' ); 
  3.  
  4. ?> 
  5. <header> 
  6. <h2><?php _e( 'Customer details', 'woocommerce' ); ?></h2> 
  7. </header> 
  8.  
  9. <dl class="customer_details"> 
  10. <?php  
  11. if ($order->billing_email) echo '<dt>'.__( 'Email:', 'woocommerce' ).'</dt><dd>'.$order->billing_email.'</dd>'; 
  12. if ($order->billing_phone) echo '<dt>'.__( 'Telephone:', 'woocommerce' ).'</dt><dd>'.$order->billing_phone.'</dd>'; 
  13. ?> 
  14. </dl> 
  15.  
  16. <?php if (get_option('woocommerce_ship_to_billing_address_only')=='no') : ?> 
  17.  
  18. <div class="col2-set addresses"> 
  19.  
  20. <div class="col-1"> 
  21.  
  22. <?php endif; ?> 
  23.  
  24.  
  25. <header class="title"> 
  26. <h3><?php _e( 'Billing Address', 'woocommerce' ); ?></h3> 
  27. </header> 
  28.  
  29. <address> 
  30. <p><?php if (!$order->get_formatted_billing_address()) _e( 'N/A', 'woocommerce' ); else echo $order->get_formatted_billing_address(); ?></p> 
  31. </address> 
  32.  
  33. <?php if (get_option('woocommerce_ship_to_billing_address_only')=='no') : ?> 
  34.  
  35. </div><!-- /.col-1 --> 
  36.  
  37. <div class="col-2"> 
  38.  
  39. <header class="title"> 
  40. <h3><?php _e( 'Shipping Address', 'woocommerce' ); ?></h3> 
  41. </header> 
  42.  
  43. <address> 
  44. <p><?php if (!$order->get_formatted_shipping_address()) _e( 'N/A', 'woocommerce' ); else echo $order->get_formatted_shipping_address(); ?></p> 
  45. </address> 
  46.  
  47. </div><!-- /.col-2 --> 
  48.  
  49. </div><!-- /.col2-set --> 
  50.  
  51. <?php endif; ?> 
  52.  
  53.  
  54.  
  55. <div class="clear"></div> 
  56.  
  57. <script type="text/javascript"> 
  58. var array = []; 
  59. <?php 
  60. foreach ( $options['buttons'] as $btn ) : ?> 
  61.  
  62. array.push("<?php echo $btn['changenamep']; ?>" , "<?php echo $btn['changename']; ?>") 
  63.  
  64. <?php 
  65. endforeach; 
  66. ?> 
  67.  
  68. b(array); 
  69.  
  70. function b(array) { 
  71. for(var i = 0; i<(array.length-1); i=i+2) { 
  72. document.body.innerHTML= document.body.innerHTML.replace(array[i], array[i+1]) 
  73. </script> 
  74.  
  75. <?php