-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebstarters-autocomplete-zipcode.php
More file actions
executable file
·41 lines (34 loc) · 1.14 KB
/
webstarters-autocomplete-zipcode.php
File metadata and controls
executable file
·41 lines (34 loc) · 1.14 KB
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
<?php
/**
* @package webstarters-autocomplete-zipcode-denmark
* @version 1.0
* @link https://webstarters.dk
*
* Plugin Name: Webstarters autocomplete zipcode Denmark
* Plugin URI: https://webstarters.dk
* Description: Et plugin der automatisk udfylder by under checkout i Woocoommerce når kunden har udfyldt deres zip code.
* Version: 1.2.1
* Author: Webstarters
* Author URI: https://webstarters.dk
*/
// If this file is called directly, abort.
if (! defined('ABSPATH')) {
die;
}
if (! defined('MODUL_DIR')) {
define('MODUL_DIR', dirname(__FILE__));
}
// Instantiate classes
include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
if ( is_plugin_active( 'woocommerce/woocommerce.php' ) ) {
add_action('wp_enqueue_scripts','autocomplete_load_js');
function autocomplete_load_js() {
wp_register_script('autocomplete-zipcode-denmark', plugins_url( '/assets/autocomplete-zip.js', __FILE__ ), array('jquery'), '1.0', true );
// Enqueue script, if checkout
if(is_checkout()){
wp_enqueue_script('autocomplete-zipcode-denmark');
}
}
} else {
}
?>