You've already forked wc-tier-and-package-prices
Fixed critical class redeclaration errors affecting all plugin functionality in version 1.1.12. All plugin component classes now properly guarded. **CRITICAL FIXES:** - Plugin completely non-functional in v1.1.12 (no settings, no frontend, no backend) - Fatal errors for WC_TPP_Admin, WC_TPP_Product_Meta, WC_TPP_Frontend, WC_TPP_Cart, WC_TPP_Settings classes - All classes now wrapped in class_exists() checks **Files Modified:** - includes/class-wc-tpp-admin.php - includes/class-wc-tpp-product-meta.php - includes/class-wc-tpp-frontend.php - includes/class-wc-tpp-cart.php - includes/class-wc-tpp-settings.php **Technical Details:** - Completes comprehensive redeclaration protection started in v1.1.9-1.1.12 - All 2 functions, 4 constants, and 6 classes now protected - Plugin activates successfully and all features functional - Settings page, product meta boxes, frontend display, cart integration all working 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
34 lines
1.0 KiB
PHP
34 lines
1.0 KiB
PHP
<?php
|
|
/**
|
|
* Admin settings and configuration
|
|
*/
|
|
|
|
if (!defined('ABSPATH')) {
|
|
exit;
|
|
}
|
|
|
|
if (!class_exists('WC_TPP_Admin')) {
|
|
class WC_TPP_Admin {
|
|
|
|
public function __construct() {
|
|
add_filter('woocommerce_get_settings_pages', array($this, 'add_settings_page'));
|
|
add_action('admin_enqueue_scripts', array($this, 'enqueue_admin_scripts'));
|
|
}
|
|
|
|
/**
|
|
* Add settings page to WooCommerce settings
|
|
*/
|
|
public function add_settings_page($settings) {
|
|
$settings[] = include WC_TPP_PLUGIN_DIR . 'includes/class-wc-tpp-settings.php';
|
|
return $settings;
|
|
}
|
|
|
|
public function enqueue_admin_scripts($hook) {
|
|
if ('woocommerce_page_wc-settings' === $hook || 'post.php' === $hook || 'post-new.php' === $hook) {
|
|
wp_enqueue_style('wc-tpp-admin', WC_TPP_PLUGIN_URL . 'assets/css/admin.css', array(), WC_TPP_VERSION);
|
|
wp_enqueue_script('wc-tpp-admin', WC_TPP_PLUGIN_URL . 'assets/js/admin.js', array('jquery'), WC_TPP_VERSION, true);
|
|
}
|
|
}
|
|
}
|
|
}
|