1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333
<?php
class orddd_additional_settings {
public static function orddd_additional_settings_section_callback() { }
public static function orddd_show_column_on_orders_page_check_callback( $args ) {
$orddd_show_column_on_orders_page_check = $orddd_enable_default_sorting_of_column = '';
if ( get_option( 'orddd_show_column_on_orders_page_check' ) == 'on' ) {
$orddd_show_column_on_orders_page_check = "checked";
}
if ( get_option( 'orddd_enable_default_sorting_of_column' ) == 'on' ) {
$orddd_enable_default_sorting_of_column = "checked";
}
echo '<input type="checkbox" name="orddd_show_column_on_orders_page_check" id="orddd_show_column_on_orders_page_check" class="day-checkbox" ' . $orddd_show_column_on_orders_page_check . '/>';
$html = '<label for="orddd_show_column_on_orders_page_check"> ' . $args[ 0 ] . '</label></br>';
echo $html;
if ( get_option( 'orddd_show_column_on_orders_page_check' ) == 'on' ) {
echo '<input type="checkbox" name="orddd_enable_default_sorting_of_column" id="orddd_enable_default_sorting_of_column" class="day-checkbox" ' . $orddd_enable_default_sorting_of_column . '/>';
$html_arr = '<label for="orddd_enable_default_sorting_of_column">' . __( 'Enable default sorting of orders (in descending order) by Delivery Date on WooCommerce -> Orders page', 'order-delivery-date' ) . '</label>';
echo $html_arr;
} else {
echo '<input type="checkbox" name="orddd_enable_default_sorting_of_column" id="orddd_enable_default_sorting_of_column" class="day-checkbox" ' . $orddd_enable_default_sorting_of_column . '/>';
$html_arr = '<label for="orddd_enable_default_sorting_of_column" id="orddd_enable_default_sorting_of_column">' . __( 'Enable default sorting of orders (in descending order) by Delivery Date on WooCommerce -> Orders page', 'order-delivery-date' ) . '</label>';
echo $html_arr;
}
?>
<script type='text/javascript'>
jQuery( document ).ready( function(){
if ( jQuery( "#orddd_show_column_on_orders_page_check" ).is(':checked') ) {
jQuery( '#orddd_enable_default_sorting_of_column' ).fadeIn();
jQuery( 'label[ for=\"orddd_enable_default_sorting_of_column\" ]' ).fadeIn();
} else {
jQuery( '#orddd_enable_default_sorting_of_column' ).fadeOut();
jQuery( 'label[ for=\"orddd_enable_default_sorting_of_column\" ]' ).fadeOut();
}
jQuery( "#orddd_show_column_on_orders_page_check" ).on( 'change', function() {
if ( jQuery( this ).is(':checked') ) {
jQuery( '#orddd_enable_default_sorting_of_column' ).fadeIn();
jQuery( 'label[ for=\"orddd_enable_default_sorting_of_column\" ]' ).fadeIn();
} else {
jQuery( '#orddd_enable_default_sorting_of_column' ).fadeOut();
jQuery( 'label[ for=\"orddd_enable_default_sorting_of_column\" ]' ).fadeOut();
}
})
});
</script>
<?php
}
public static function orddd_show_filter_on_orders_page_check_callback( $args ) {
$orddd_show_filter_on_orders_page_check = '';
if ( get_option( 'orddd_show_filter_on_orders_page_check' ) == 'on' ) {
$orddd_show_filter_on_orders_page_check = "checked";
}
echo '<input type="checkbox" name="orddd_show_filter_on_orders_page_check" id="orddd_show_filter_on_orders_page_check" class="day-checkbox" ' . $orddd_show_filter_on_orders_page_check . ' />';
$html = '<label for="orddd_show_filter_on_orders_page_check"> ' . $args[ 0 ] . '</label>';
echo $html;
}
public static function orddd_appearance_virtual_product_callback( $args ) {
if ( get_option( 'orddd_no_fields_for_virtual_product' ) == 'on' ) {
$orddd_no_fields_for_virtual_product = "checked";
} else {
$orddd_no_fields_for_virtual_product = "";
}
echo '<input type="checkbox" name="orddd_no_fields_for_virtual_product" id="orddd_no_fields_for_virtual_product" class="day-checkbox"' . $orddd_no_fields_for_virtual_product . '/><label class="orddd_no_fields_for_product_type">' . __( 'Virtual Products', 'order-delivery-date' ) . '</label>';
if ( get_option( 'orddd_no_fields_for_featured_product' ) == 'on' ) {
$orddd_no_fields_for_featured_product = "checked";
} else {
$orddd_no_fields_for_featured_product = "";
}
echo '<input type="checkbox" name="orddd_no_fields_for_featured_product" id="orddd_no_fields_for_featured_product" class="day-checkbox"' . $orddd_no_fields_for_featured_product . '/><label class="orddd_no_fields_for_product_type">' . __( 'Featured products', 'order-delivery-date' ) . '</label>';
$html = '<label for="orddd_no_fields_for_product_type"> ' . $args[ 0 ] . '</label>';
echo $html;
}
public static function orddd_integration_with_other_plugins_callback() { }
public static function orddd_show_fields_in_csv_export_check_callback( $args ) {
$orddd_show_fields_in_csv_export_check = '';
if ( get_option( 'orddd_show_fields_in_csv_export_check' ) == 'on' ) {
$orddd_show_fields_in_csv_export_check = "checked";
}
echo '<input type="checkbox" name="orddd_show_fields_in_csv_export_check" id="orddd_show_fields_in_csv_export_check" class="day-checkbox" ' . $orddd_show_fields_in_csv_export_check . ' />';
$html = '<label for="orddd_show_fields_in_csv_export_check"> ' . $args[ 0 ] . '</label>';
echo $html;
}
public static function orddd_show_fields_in_pdf_invoice_and_packing_slips_callback( $args ) {
$orddd_show_fields_in_pdf_invoice_and_packing_slips = '';
if ( get_option( 'orddd_show_fields_in_pdf_invoice_and_packing_slips' ) == 'on' ) {
$orddd_show_fields_in_pdf_invoice_and_packing_slips = "checked";
}
echo '<input type="checkbox" name="orddd_show_fields_in_pdf_invoice_and_packing_slips" id="orddd_show_fields_in_pdf_invoice_and_packing_slips" class="day-checkbox" ' . $orddd_show_fields_in_pdf_invoice_and_packing_slips . '/>';
$html = '<label for="orddd_show_fields_in_pdf_invoice_and_packing_slips"> ' . $args[ 0 ] . '</label>';
echo $html;
}
public static function orddd_show_fields_in_invoice_and_delivery_note_callback( $args ) {
$orddd_show_fields_in_invoice_and_delivery_note = '';
if ( get_option( 'orddd_show_fields_in_invoice_and_delivery_note' ) == 'on' ) {
$orddd_show_fields_in_invoice_and_delivery_note = "checked";
}
echo '<input type="checkbox" name="orddd_show_fields_in_invoice_and_delivery_note" id="orddd_show_fields_in_invoice_and_delivery_note" class="day-checkbox" ' . $orddd_show_fields_in_invoice_and_delivery_note . '/>';
$html = '<label for="orddd_show_fields_in_invoice_and_delivery_note"> ' . $args[ 0 ] . '</label>';
echo $html;
}
public static function orddd_show_fields_in_cloud_print_orders_callback( $args ) {
$orddd_show_fields_in_cloud_print_orders_check = '';
if ( get_option( 'orddd_show_fields_in_cloud_print_orders' ) == 'on' ) {
$orddd_show_fields_in_cloud_print_orders_check = "checked";
}
echo '<input type="checkbox" name="orddd_show_fields_in_cloud_print_orders" id="orddd_show_fields_in_cloud_print_orders" class="day-checkbox" ' . $orddd_show_fields_in_cloud_print_orders_check . '/>';
$html = '<label for="orddd_show_fields_in_cloud_print_orders"> '. $args[ 0 ] . '</label>';
echo $html;
}
public static function orddd_enable_tax_calculation_for_delivery_charges_callback( $args ) {
$orddd_enable_tax_calculation_for_delivery_charges = '';
if ( get_option( 'orddd_enable_tax_calculation_for_delivery_charges' ) == 'on' ) {
$orddd_enable_tax_calculation_for_delivery_charges = "checked";
}
echo '<input type="checkbox" name="orddd_enable_tax_calculation_for_delivery_charges" id="orddd_enable_tax_calculation_for_delivery_charges" class="day-checkbox" ' . $orddd_enable_tax_calculation_for_delivery_charges . '/>';
$html = '<label for="orddd_enable_tax_calculation_for_delivery_charges"> '. $args[ 0 ] . '</label>';
echo $html;
}
public static function orddd_compatibility_with_other_plugins_callback() {}
public static function orddd_shipping_multiple_address_compatibility_callback( $args ) {
$orddd_shipping_multiple_address_compatibility = '';
if ( get_option( 'orddd_shipping_multiple_address_compatibility' ) == 'on' ) {
$orddd_shipping_multiple_address_compatibility = "checked";
}
echo '<input type="checkbox" name="orddd_shipping_multiple_address_compatibility" id="orddd_shipping_multiple_address_compatibility" class="day-checkbox" ' . $orddd_shipping_multiple_address_compatibility . '/>';
$html = '<label for="orddd_shipping_multiple_address_compatibility"> '. $args[ 0 ] . '</label>';
echo $html;
}
public static function orddd_amazon_payments_advanced_gateway_compatibility_callback( $args ) {
$orddd_amazon_payments_advanced_gateway_compatibility = '';
if ( get_option( 'orddd_amazon_payments_advanced_gateway_compatibility' ) == 'on' ) {
$orddd_amazon_payments_advanced_gateway_compatibility = "checked";
}
echo '<input type="checkbox" name="orddd_amazon_payments_advanced_gateway_compatibility" id="orddd_amazon_payments_advanced_gateway_compatibility" class="day-checkbox" ' . $orddd_amazon_payments_advanced_gateway_compatibility . '/>';
$html = '<label for="orddd_amazon_payments_advanced_gateway_compatibility"> '. $args[ 0 ] . '</label>';
echo $html;
}
public static function orddd_enable_autofill_of_delivery_date_callback( $args ) {
$orddd_enable_autofill_of_delivery_date = '';
if ( get_option( 'orddd_enable_autofill_of_delivery_date' ) == 'on' ) {
$orddd_enable_autofill_of_delivery_date = "checked";
}
echo '<input type="checkbox" name="orddd_enable_autofill_of_delivery_date" id="orddd_enable_autofill_of_delivery_date" class="day-checkbox" ' . $orddd_enable_autofill_of_delivery_date . '/>';
$html = '<label for="orddd_enable_autofill_of_delivery_date"> '. $args[ 0 ] . '</label>';
echo $html;
}
public static function orddd_allow_customers_to_edit_date_callback( $args ) {
$orddd_allow_customers_to_edit_date = $orddd_send_email_to_admin_when_date_updated = '';
if ( get_option( 'orddd_allow_customers_to_edit_date' ) == 'on' ) {
$orddd_allow_customers_to_edit_date = "checked";
}
if ( get_option( 'orddd_send_email_to_admin_when_date_updated' ) == 'on' ) {
$orddd_send_email_to_admin_when_date_updated = "checked";
}
echo '<input type="checkbox" name="orddd_allow_customers_to_edit_date" id="orddd_allow_customers_to_edit_date" class="day-checkbox" ' . $orddd_allow_customers_to_edit_date . '/>';
$html = '<label for="orddd_allow_customers_to_edit_date"> '. $args[ 0 ] . '</label>';
echo $html;
if ( get_option( 'orddd_allow_customers_to_edit_date' ) == 'on' ) {
echo '<input type="checkbox" name="orddd_send_email_to_admin_when_date_updated" id="orddd_send_email_to_admin_when_date_updated" class="day-checkbox" ' . $orddd_send_email_to_admin_when_date_updated . '/>';
$html_arr = '<label for="orddd_send_email_to_admin_when_date_updated">' . __( 'Send a notification to the Admin when the Delivery Date & Time is updated by the customers.', 'order-delivery-date' ) . '</label>';
echo $html_arr;
} else {
echo '<input type="checkbox" name="orddd_send_email_to_admin_when_date_updated" id="orddd_send_email_to_admin_when_date_updated" class="day-checkbox" ' . $orddd_send_email_to_admin_when_date_updated . '/>';
$html_arr = '<label for="orddd_send_email_to_admin_when_date_updated" id="orddd_send_email_to_admin_when_date_updated">' . __( 'When enabled, email notification will be sent to the admin when the Delivery Date & Time is edited by the customers on the My Account -> Orders -> View page. So customers will be able to edit the date and time once the order is placed.', 'order-delivery-date' ) . '</label>';
echo $html_arr;
}
?>
<script type='text/javascript'>
jQuery( document ).ready( function(){
if ( jQuery( "#orddd_allow_customers_to_edit_date" ).is(':checked') ) {
jQuery( '#orddd_send_email_to_admin_when_date_updated' ).fadeIn();
jQuery( 'label[ for=\"orddd_send_email_to_admin_when_date_updated\" ]' ).fadeIn();
} else {
jQuery( '#orddd_send_email_to_admin_when_date_updated' ).fadeOut();
jQuery( 'label[ for=\"orddd_send_email_to_admin_when_date_updated\" ]' ).fadeOut();
}
jQuery( "#orddd_allow_customers_to_edit_date" ).on( 'change', function() {
if ( jQuery( this ).is(':checked') ) {
jQuery( '#orddd_send_email_to_admin_when_date_updated' ).fadeIn();
jQuery( 'label[ for=\"orddd_send_email_to_admin_when_date_updated\" ]' ).fadeIn();
} else {
jQuery( '#orddd_send_email_to_admin_when_date_updated' ).fadeOut();
jQuery( 'label[ for=\"orddd_send_email_to_admin_when_date_updated\" ]' ).fadeOut();
}
})
});
</script>
<?php
}
}