/**
  * Settings scripts
  */
 public function enqueue_admin_scripts()
 {
     // deregister scripts
     wp_deregister_script('underscore');
     wp_deregister_script('select2');
     wp_deregister_script('backbone');
     // register
     $external_libs = WC_POS_Template::get_external_js_libraries();
     wp_register_script('underscore', $external_libs['lodash'], array('jquery'), null, true);
     wp_register_script('backbone', $external_libs['backbone'], array('jquery', 'underscore'), null, true);
     wp_register_script('backbone.radio', $external_libs['radio'], array('jquery', 'backbone', 'underscore'), null, true);
     wp_register_script('marionette', $external_libs['marionette'], array('jquery', 'backbone', 'underscore'), null, true);
     wp_register_script('handlebars', $external_libs['handlebars'], false, null, true);
     wp_register_script('moment', $external_libs['moment'], false, null, true);
     wp_register_script('accounting', $external_libs['accounting'], false, null, true);
     wp_register_script('select2', 'https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.0/js/select2.min.js', array('jquery'), null, true);
     wp_register_script('idb-wrapper', $external_libs['idb-wrapper'], false, null, true);
     // enqueue
     wp_enqueue_script('jquery-ui-sortable');
     $build = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? 'build' : 'min';
     wp_enqueue_script(WC_POS_PLUGIN_NAME . '-admin-app', WC_POS_PLUGIN_URL . 'assets/js/admin.' . $build . '.js', array('backbone', 'backbone.radio', 'marionette', 'handlebars', 'accounting', 'moment', 'select2', 'idb-wrapper'), WC_POS_VERSION, true);
     wp_enqueue_script('eventsource-polyfill', WC_POS_PLUGIN_URL . 'assets/js/vendor/eventsource.min.js', array(), null, true);
     $scripts = apply_filters('woocommerce_pos_admin_enqueue_scripts', array());
     if (isset($scripts['locale'])) {
         wp_enqueue_script(WC_POS_PLUGIN_NAME . '-js-locale', $scripts['locale'], array(WC_POS_PLUGIN_NAME . '-admin-app'), WC_POS_VERSION, true);
     }
 }
Exemplo n.º 2
0
    <tr>
      <th><?php 
_e('Receipt Template', 'woocommerce-pos');
?>
</th>
      <td>
        <a href="<?php 
esc_attr_e(wc_pos_url('#print'));
?>
" target="_blank" class="button">
          <?php 
_e('View Sample Receipt', 'woocommerce-pos');
?>
        </a>
        <?php 
printf(__('<strong class="red">Template path:</strong> %s', 'woocommerce-pos'), '<code style="font-size: 11px">' . WC_POS_Template::locate_template_file('print/tmpl-receipt.php') . '</code>');
?>
      </td>
    </tr>

    <tr>
      <th><?php 
_e('Legacy Server Support', 'woocommerce-pos');
?>
</th>
      <td>
        <?php 
$toggle = get_option('woocommerce_pos_emulateHTTP') === '1';
?>
        <a href="#" data-action="legacy-<?php 
echo $toggle ? 'disable' : 'enable';
Exemplo n.º 3
0
    <tr>
      <th><?php 
_e('Receipt Template', 'woocommerce-pos');
?>
</th>
      <td>
        <a href="<?php 
esc_attr_e(wc_pos_url('#print'));
?>
" target="_blank" class="button">
          <?php 
_e('View Sample Receipt', 'woocommerce-pos');
?>
        </a>
        <?php 
$template_path = WC_POS_Template::locate_print_receipt_template();
printf(__('<strong class="red">Template path:</strong> %s', 'woocommerce-pos'), '<code style="font-size: 11px">' . $template_path . '</code>');
?>
      </td>
    </tr>

    <tr>
      <th><?php 
_e('Legacy Server Support', 'woocommerce-pos');
?>
</th>
      <td>
        <?php 
$toggle = get_option('woocommerce_pos_emulateHTTP') === '1';
?>
        <a href="#" data-action="legacy-<?php