Deleted error logs
This commit is contained in:
@@ -16,9 +16,7 @@ class Wiaas_Template_Admin_Ajax {
|
||||
add_action('wp_ajax_wiaas_add_template_product', array(__CLASS__, 'ajax_add_wiaas_template_product'));
|
||||
add_action('wp_ajax_wiaas_template_category_search', array(__CLASS__, 'ajax_wiaas_template_category_search'));
|
||||
|
||||
// Ajax add bundled product.
|
||||
add_action('wp_ajax_wiaas_select_template', array(__CLASS__, 'ajax_handle_template_selection'));
|
||||
|
||||
add_action('wp_ajax_wiaas_product_type_change', array(__CLASS__, 'toggle_template_selection_on_type_change'));
|
||||
}
|
||||
|
||||
@@ -85,10 +83,7 @@ class Wiaas_Template_Admin_Ajax {
|
||||
));
|
||||
|
||||
foreach ($terms as $t) {
|
||||
error_log($t->name);
|
||||
error_log($t->term_id);
|
||||
$response[$t->term_id] = $t->name;
|
||||
|
||||
}
|
||||
|
||||
wp_send_json($response);
|
||||
|
||||
@@ -1,46 +0,0 @@
|
||||
<?php
|
||||
|
||||
if (!defined('ABSPATH')) {
|
||||
exit; // Exit if accessed directly
|
||||
}
|
||||
|
||||
if (false === $template_term_exists = get_term_by('slug', 'wiaastemplate', 'product_type')) {
|
||||
wp_insert_term('wiaastemplate', 'product_type');
|
||||
}
|
||||
|
||||
|
||||
function construct_template_products_class() {
|
||||
|
||||
class WC_Product_Template extends WC_Product {
|
||||
|
||||
|
||||
public function __construct($product) {
|
||||
parent::__construct($product);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get internal type.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function get_type() {
|
||||
return 'wiaastemplate';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
add_action('init', 'construct_template_products_class');
|
||||
|
||||
function woocommerce_product_class($classname, $product_type) {
|
||||
|
||||
if ($product_type == 'wiaastemplate') {
|
||||
$classname = 'WC_Product_Template';
|
||||
}
|
||||
|
||||
return $classname;
|
||||
}
|
||||
|
||||
add_filter('woocommerce_product_class', 'woocommerce_product_class', 10, 2);
|
||||
Reference in New Issue
Block a user