/** * WC_Square_Sync_To_Square_WordPress_Hooks constructor. * * @param WC_Integration $integration * @param WC_Square_Sync_To_Square $square */ public function __construct(WC_Integration $integration, WC_Square_Sync_To_Square $square) { $this->integration = $integration; $this->square = $square; $this->sync_products = 'yes' === $integration->get_option('sync_products'); $this->sync_categories = 'yes' === $integration->get_option('sync_categories'); $this->sync_images = 'yes' === $integration->get_option('sync_images'); $this->sync_inventory = 'yes' === $integration->get_option('sync_inventory'); add_action('wc_square_loaded', array($this, 'attach_hooks')); add_action('wc_square_save_post_event', array($this, 'process_save_post_event'), 10, 2); }
/** * Generate settings page HTML * * @since 4.5 */ public function generate_settings_html($form_fields = array()) { $rates_checked = get_option('wootax_rates_checked'); if (!$rates_checked && wt_has_other_rates()) { require WT_PLUGIN_PATH . 'templates/admin/delete-rates.php'; // Add WooTax tax rate if one is not present WC_WooTax::maybe_add_wootax_rate(); } else { parent::generate_settings_html($form_fields); } }
public function init() { $this->integration = new WC_Square_Integration(); $square_client = new WC_Square_Client(); $access_token = get_option('woocommerce_square_merchant_access_token'); $square_client->set_access_token($access_token); $square_client->set_merchant_id($this->integration->get_option('location')); $this->square_client = $square_client; $this->square_connect = new WC_Square_Connect($square_client); $wc_to_square_sync = new WC_Square_Sync_To_Square($this->square_connect); $square_to_wc_sync = new WC_Square_Sync_From_Square($this->square_connect); $inventory_poll = new WC_Square_Inventory_Poll($this->integration, $square_to_wc_sync); if (is_admin()) { $bulk_handler = new WC_Square_Bulk_Sync_Handler($this->square_connect, $wc_to_square_sync, $square_to_wc_sync); } $this->wc_to_square_wp_hooks = new WC_Square_Sync_To_Square_WordPress_Hooks($this->integration, $wc_to_square_sync); }
public function generate_settings_html($form_fields = false) { parent::generate_settings_html($form_fields); ?> <tr valign="top"> <th scope="row" class="titledesc"> <label >Calculate shipping rates</label> </th> <td class="forminp"> Go to <b><a href="<?php echo admin_url('admin.php?page=wc-settings&tab=shipping§ion=printful_shipping'); ?> ">Shipping → Printful Shipping</a></b> to enable Printful shipping rate calculation </td> </tr> <?php }
public function admin_options() { // check if curl is available if (!function_exists('curl_version')) { ?> <div class="update-nag"> <p><?php _e('Warning, your version of PHP does not support Curl. We highly recommend this when using our BooXtream plugin.', 'woocommerce_booxtream'); ?> </p> </div> <?php } parent::admin_options(); }