Changeset 3466822
- Timestamp:
- 02/22/2026 10:26:24 AM (5 weeks ago)
- Location:
- bizzswatches
- Files:
-
- 150 added
- 2 deleted
- 9 edited
-
tags/1.0.1 (added)
-
tags/1.0.1/admin (added)
-
tags/1.0.1/admin/admin-loader.php (added)
-
tags/1.0.1/admin/class-bizzswatches-admin.php (added)
-
tags/1.0.1/admin/class-bizzswatches-attribute-meta.php (added)
-
tags/1.0.1/admin/class-bizzswatches-getting-started.php (added)
-
tags/1.0.1/admin/class-bizzswatches-product-panel.php (added)
-
tags/1.0.1/admin/framework-loader.php (added)
-
tags/1.0.1/admin/html (added)
-
tags/1.0.1/admin/html/browse-plugin.php (added)
-
tags/1.0.1/admin/html/getting-started.php (added)
-
tags/1.0.1/admin/index.php (added)
-
tags/1.0.1/admin/options-framework (added)
-
tags/1.0.1/admin/options-framework/assets (added)
-
tags/1.0.1/admin/options-framework/assets/css (added)
-
tags/1.0.1/admin/options-framework/assets/css/components (added)
-
tags/1.0.1/admin/options-framework/assets/css/components/api-section.css (added)
-
tags/1.0.1/admin/options-framework/assets/css/dark-mode.css (added)
-
tags/1.0.1/admin/options-framework/assets/css/fields (added)
-
tags/1.0.1/admin/options-framework/assets/css/fields/checkbox.css (added)
-
tags/1.0.1/admin/options-framework/assets/css/fields/color.css (added)
-
tags/1.0.1/admin/options-framework/assets/css/fields/date.css (added)
-
tags/1.0.1/admin/options-framework/assets/css/fields/file.css (added)
-
tags/1.0.1/admin/options-framework/assets/css/fields/html.css (added)
-
tags/1.0.1/admin/options-framework/assets/css/fields/image-select.css (added)
-
tags/1.0.1/admin/options-framework/assets/css/fields/image.css (added)
-
tags/1.0.1/admin/options-framework/assets/css/fields/option-select.css (added)
-
tags/1.0.1/admin/options-framework/assets/css/fields/plugins.css (added)
-
tags/1.0.1/admin/options-framework/assets/css/fields/post-select.css (added)
-
tags/1.0.1/admin/options-framework/assets/css/fields/radio.css (added)
-
tags/1.0.1/admin/options-framework/assets/css/fields/repeater.css (added)
-
tags/1.0.1/admin/options-framework/assets/css/fields/select.css (added)
-
tags/1.0.1/admin/options-framework/assets/css/fields/single-repeater.css (added)
-
tags/1.0.1/admin/options-framework/assets/css/fields/slider.css (added)
-
tags/1.0.1/admin/options-framework/assets/css/fields/switch.css (added)
-
tags/1.0.1/admin/options-framework/assets/css/fields/text.css (added)
-
tags/1.0.1/admin/options-framework/assets/css/fields/textarea.css (added)
-
tags/1.0.1/admin/options-framework/assets/css/framework-common.css (added)
-
tags/1.0.1/admin/options-framework/assets/css/metabox.css (added)
-
tags/1.0.1/admin/options-framework/assets/css/setup-wizard.css (added)
-
tags/1.0.1/admin/options-framework/assets/images (added)
-
tags/1.0.1/admin/options-framework/assets/images/logo.png (added)
-
tags/1.0.1/admin/options-framework/assets/images/no-sidebar.svg (added)
-
tags/1.0.1/admin/options-framework/assets/images/sidebar-left.svg (added)
-
tags/1.0.1/admin/options-framework/assets/images/sidebar-right.svg (added)
-
tags/1.0.1/admin/options-framework/assets/js (added)
-
tags/1.0.1/admin/options-framework/assets/js/bizzplugin-common.js (added)
-
tags/1.0.1/admin/options-framework/assets/js/framework.js (added)
-
tags/1.0.1/admin/options-framework/assets/js/metabox.js (added)
-
tags/1.0.1/admin/options-framework/assets/js/setup-wizard.js (added)
-
tags/1.0.1/admin/options-framework/assets/js/wp-color-picker-alpha.min.js (added)
-
tags/1.0.1/admin/options-framework/class-bizzplugin-framework.php (added)
-
tags/1.0.1/admin/options-framework/class-bizzplugin-metabox.php (added)
-
tags/1.0.1/admin/options-framework/class-bizzplugin-panel.php (added)
-
tags/1.0.1/admin/options-framework/includes (added)
-
tags/1.0.1/admin/options-framework/includes/class-ajax-handler.php (added)
-
tags/1.0.1/admin/options-framework/includes/class-api-handler.php (added)
-
tags/1.0.1/admin/options-framework/includes/class-field-sanitizer.php (added)
-
tags/1.0.1/admin/options-framework/includes/class-field-validator.php (added)
-
tags/1.0.1/admin/options-framework/includes/class-helper-common.php (added)
-
tags/1.0.1/admin/options-framework/includes/class-render-field.php (added)
-
tags/1.0.1/admin/options-framework/includes/class-setup-wizard.php (added)
-
tags/1.0.1/admin/options-framework/includes/class-webhook-handler.php (added)
-
tags/1.0.1/admin/options-framework/options-loader.php (added)
-
tags/1.0.1/assets (added)
-
tags/1.0.1/assets/css (added)
-
tags/1.0.1/assets/css/admin.css (added)
-
tags/1.0.1/assets/css/frontend.css (added)
-
tags/1.0.1/assets/css/getting-started.css (added)
-
tags/1.0.1/assets/css/index.php (added)
-
tags/1.0.1/assets/images (added)
-
tags/1.0.1/assets/images/index.php (added)
-
tags/1.0.1/assets/index.php (added)
-
tags/1.0.1/assets/js (added)
-
tags/1.0.1/assets/js/admin.js (added)
-
tags/1.0.1/assets/js/frontend.js (added)
-
tags/1.0.1/assets/js/index.php (added)
-
tags/1.0.1/bizzswatches.php (added)
-
tags/1.0.1/includes (added)
-
tags/1.0.1/includes/class-bizzswatches-autoloader.php (added)
-
tags/1.0.1/includes/class-bizzswatches-helper.php (added)
-
tags/1.0.1/includes/class-bizzswatches.php (added)
-
tags/1.0.1/includes/index.php (added)
-
tags/1.0.1/languages (added)
-
tags/1.0.1/languages/bizzswatches.pot (added)
-
tags/1.0.1/languages/index.php (added)
-
tags/1.0.1/public (added)
-
tags/1.0.1/public/class-bizzswatches-frontend.php (added)
-
tags/1.0.1/public/class-bizzswatches-swatches-display.php (added)
-
tags/1.0.1/public/index.php (added)
-
tags/1.0.1/readme.txt (added)
-
tags/1.0.1/uninstall.php (added)
-
trunk/admin/admin-loader.php (added)
-
trunk/admin/class-bizzswatches-admin.php (modified) (3 diffs)
-
trunk/admin/class-bizzswatches-product-panel.php (modified) (5 diffs)
-
trunk/admin/class-bizzswatches-settings.php (deleted)
-
trunk/admin/framework-loader.php (added)
-
trunk/admin/html (added)
-
trunk/admin/html/browse-plugin.php (added)
-
trunk/admin/html/getting-started.php (added)
-
trunk/admin/options-framework (added)
-
trunk/admin/options-framework/assets (added)
-
trunk/admin/options-framework/assets/css (added)
-
trunk/admin/options-framework/assets/css/components (added)
-
trunk/admin/options-framework/assets/css/components/api-section.css (added)
-
trunk/admin/options-framework/assets/css/dark-mode.css (added)
-
trunk/admin/options-framework/assets/css/fields (added)
-
trunk/admin/options-framework/assets/css/fields/checkbox.css (added)
-
trunk/admin/options-framework/assets/css/fields/color.css (added)
-
trunk/admin/options-framework/assets/css/fields/date.css (added)
-
trunk/admin/options-framework/assets/css/fields/file.css (added)
-
trunk/admin/options-framework/assets/css/fields/html.css (added)
-
trunk/admin/options-framework/assets/css/fields/image-select.css (added)
-
trunk/admin/options-framework/assets/css/fields/image.css (added)
-
trunk/admin/options-framework/assets/css/fields/option-select.css (added)
-
trunk/admin/options-framework/assets/css/fields/plugins.css (added)
-
trunk/admin/options-framework/assets/css/fields/post-select.css (added)
-
trunk/admin/options-framework/assets/css/fields/radio.css (added)
-
trunk/admin/options-framework/assets/css/fields/repeater.css (added)
-
trunk/admin/options-framework/assets/css/fields/select.css (added)
-
trunk/admin/options-framework/assets/css/fields/single-repeater.css (added)
-
trunk/admin/options-framework/assets/css/fields/slider.css (added)
-
trunk/admin/options-framework/assets/css/fields/switch.css (added)
-
trunk/admin/options-framework/assets/css/fields/text.css (added)
-
trunk/admin/options-framework/assets/css/fields/textarea.css (added)
-
trunk/admin/options-framework/assets/css/framework-common.css (added)
-
trunk/admin/options-framework/assets/css/metabox.css (added)
-
trunk/admin/options-framework/assets/css/setup-wizard.css (added)
-
trunk/admin/options-framework/assets/images (added)
-
trunk/admin/options-framework/assets/images/logo.png (added)
-
trunk/admin/options-framework/assets/images/no-sidebar.svg (added)
-
trunk/admin/options-framework/assets/images/sidebar-left.svg (added)
-
trunk/admin/options-framework/assets/images/sidebar-right.svg (added)
-
trunk/admin/options-framework/assets/js (added)
-
trunk/admin/options-framework/assets/js/bizzplugin-common.js (added)
-
trunk/admin/options-framework/assets/js/framework.js (added)
-
trunk/admin/options-framework/assets/js/metabox.js (added)
-
trunk/admin/options-framework/assets/js/setup-wizard.js (added)
-
trunk/admin/options-framework/assets/js/wp-color-picker-alpha.min.js (added)
-
trunk/admin/options-framework/class-bizzplugin-framework.php (added)
-
trunk/admin/options-framework/class-bizzplugin-metabox.php (added)
-
trunk/admin/options-framework/class-bizzplugin-panel.php (added)
-
trunk/admin/options-framework/includes (added)
-
trunk/admin/options-framework/includes/class-ajax-handler.php (added)
-
trunk/admin/options-framework/includes/class-api-handler.php (added)
-
trunk/admin/options-framework/includes/class-field-sanitizer.php (added)
-
trunk/admin/options-framework/includes/class-field-validator.php (added)
-
trunk/admin/options-framework/includes/class-helper-common.php (added)
-
trunk/admin/options-framework/includes/class-render-field.php (added)
-
trunk/admin/options-framework/includes/class-setup-wizard.php (added)
-
trunk/admin/options-framework/includes/class-webhook-handler.php (added)
-
trunk/admin/options-framework/options-loader.php (added)
-
trunk/assets/css/admin.css (modified) (1 diff)
-
trunk/assets/css/frontend.css (modified) (2 diffs)
-
trunk/assets/css/getting-started.css (added)
-
trunk/bizzswatches.php (modified) (5 diffs)
-
trunk/docs (deleted)
-
trunk/includes/class-bizzswatches.php (modified) (2 diffs)
-
trunk/public/class-bizzswatches-frontend.php (modified) (3 diffs)
-
trunk/public/class-bizzswatches-swatches-display.php (modified) (13 diffs)
-
trunk/readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
bizzswatches/trunk/admin/class-bizzswatches-admin.php
r3461356 r3466822 102 102 */ 103 103 protected function init() { 104 $this->settings = Settings::instance(); 105 $this->getting_started = Getting_Started::instance(); 104 106 105 $this->product_panel = Product_Panel::instance(); 107 106 $this->attribute_meta = Attribute_Meta::instance(); … … 114 113 */ 115 114 public function register_admin_menu() { 116 add_menu_page( 117 esc_html__( 'Bizz Swatchs', 'bizzswatches' ), 118 esc_html__( 'Bizz Swatchs', 'bizzswatches' ), 119 'manage_woocommerce', 120 'bizzswatches', 121 array( $this->settings, 'render_settings_page' ), 122 'dashicons-image-filter', 123 56 124 ); 125 126 add_submenu_page( 127 'bizzswatches', 128 esc_html__( 'Settings', 'bizzswatches' ), 129 esc_html__( 'Settings', 'bizzswatches' ), 130 'manage_woocommerce', 131 'bizzswatches', 132 array( $this->settings, 'render_settings_page' ) 133 ); 134 135 add_submenu_page( 136 'bizzswatches', 137 esc_html__( 'Getting Started', 'bizzswatches' ), 138 esc_html__( 'Getting Started', 'bizzswatches' ), 139 'manage_woocommerce', 140 'bizzswatches-getting-started', 141 array( $this->getting_started, 'render_page' ) 142 ); 115 143 116 } 144 117 … … 159 132 ); 160 133 161 if ( in_array( $screen_id, $allowed_screens, true ) || strpos( $screen_id, 'edit-pa_' ) !== false ) {134 if ( strpos( $screen_id, 'bizzswatches' ) !== false || in_array( $screen_id, $allowed_screens, true ) || strpos( $screen_id, 'edit-pa_' ) !== false ) { 162 135 wp_enqueue_style( 'wp-color-picker' ); 163 136 wp_enqueue_media(); -
bizzswatches/trunk/admin/class-bizzswatches-product-panel.php
r3461356 r3466822 102 102 $swatch_meta = is_array( $swatch_meta ) ? $swatch_meta : array(); 103 103 104 $override_global = isset( $swatch_meta['override_global'] ) ? $swatch_meta['override_global'] : ' no';104 $override_global = isset( $swatch_meta['override_global'] ) ? $swatch_meta['override_global'] : '0'; 105 105 $shape_style = isset( $swatch_meta['shape_style'] ) ? $swatch_meta['shape_style'] : ''; 106 $enable_tooltip = isset( $swatch_meta['enable_tooltip'] ) ? $swatch_meta['enable_tooltip'] : ' ';106 $enable_tooltip = isset( $swatch_meta['enable_tooltip'] ) ? $swatch_meta['enable_tooltip'] : '0'; 107 107 $attribute_behavior = isset( $swatch_meta['attribute_behavior'] ) ? $swatch_meta['attribute_behavior'] : ''; 108 108 ?> … … 111 111 <p class="form-field"> 112 112 <label for="bizzswatches_override_global"> 113 <input type="checkbox" id="bizzswatches_override_global" name="bizzswatches_override_global" value=" yes" <?php checked( $override_global, 'yes' ); ?> />113 <input type="checkbox" id="bizzswatches_override_global" name="bizzswatches_override_global" value="1" <?php checked( $override_global, '1' ); ?> /> 114 114 <?php esc_html_e( 'Override Global Settings', 'bizzswatches' ); ?> 115 115 </label> … … 118 118 </div> 119 119 120 <div class="options_group bizzswatches-override-settings" style="<?php echo ' yes' === $override_global ? '' : 'display:none;'; ?>">120 <div class="options_group bizzswatches-override-settings" style="<?php echo '1' === $override_global ? '' : 'display:none;'; ?>"> 121 121 <p class="form-field"> 122 122 <label for="bizzswatches_shape_style"><?php esc_html_e( 'Swatch Shape', 'bizzswatches' ); ?></label> … … 135 135 <select id="bizzswatches_enable_tooltip" name="bizzswatches_enable_tooltip"> 136 136 <option value=""><?php esc_html_e( 'Use Global Setting', 'bizzswatches' ); ?></option> 137 <option value=" yes" <?php selected( $enable_tooltip, 'yes' ); ?>><?php esc_html_e( 'Yes', 'bizzswatches' ); ?></option>138 <option value=" no" <?php selected( $enable_tooltip, 'no' ); ?>><?php esc_html_e( 'No', 'bizzswatches' ); ?></option>137 <option value="1" <?php selected( $enable_tooltip, '1' ); ?>><?php esc_html_e( 'Yes', 'bizzswatches' ); ?></option> 138 <option value="0" <?php selected( $enable_tooltip, '0' ); ?>><?php esc_html_e( 'No', 'bizzswatches' ); ?></option> 139 139 </select> 140 140 </p> … … 187 187 188 188 $swatch_meta = array( 189 'override_global' => isset( $_POST['bizzswatches_override_global'] ) ? ' yes' : 'no',189 'override_global' => isset( $_POST['bizzswatches_override_global'] ) ? '1' : '0', 190 190 'shape_style' => isset( $_POST['bizzswatches_shape_style'] ) ? sanitize_text_field( wp_unslash( $_POST['bizzswatches_shape_style'] ) ) : '', 191 'enable_tooltip' => isset( $_POST['bizzswatches_enable_tooltip'] ) ? sanitize_text_field( wp_unslash( $_POST['bizzswatches_enable_tooltip'] ) ) : ' ',191 'enable_tooltip' => isset( $_POST['bizzswatches_enable_tooltip'] ) ? sanitize_text_field( wp_unslash( $_POST['bizzswatches_enable_tooltip'] ) ) : '0', 192 192 'attribute_behavior' => isset( $_POST['bizzswatches_attribute_behavior'] ) ? sanitize_text_field( wp_unslash( $_POST['bizzswatches_attribute_behavior'] ) ) : '', 193 193 ); -
bizzswatches/trunk/assets/css/admin.css
r3461356 r3466822 5 5 */ 6 6 7 /* Settings Page */ 8 .bizzswatches-settings-wrap { 9 max-width: 1200px; 10 } 11 12 .bizzswatches-settings-container { 13 background: #fff; 14 border: 1px solid #ccd0d4; 15 padding: 20px; 16 margin-top: 20px; 17 border-radius: 4px; 18 } 19 20 .bizzswatches-settings-tabs .nav-tab-wrapper { 21 margin-bottom: 20px; 22 border-bottom: 1px solid #ccd0d4; 23 padding-bottom: 0; 24 } 25 26 .bizzswatches-settings-tabs .nav-tab { 27 border-bottom: none; 28 margin-bottom: -1px; 29 } 30 31 .bizzswatches-settings-tabs .nav-tab-active { 32 background: #fff; 33 border-bottom-color: #fff; 34 } 35 36 .bizzswatches-settings-content .settings-panel { 37 display: none; 38 } 39 40 .bizzswatches-settings-content .settings-panel.active { 41 display: block; 42 } 43 44 .bizzswatches-settings-content .form-table { 45 margin: 0; 46 } 47 48 .bizzswatches-settings-content .form-table th { 49 width: 250px; 50 padding: 20px 10px 20px 0; 51 } 52 53 .bizzswatches-settings-content .form-table td { 54 padding: 15px 10px; 55 } 56 57 /* Getting Started Page */ 58 .bizzswatches-getting-started { 59 max-width: 1000px; 60 } 61 62 .bizzswatches-welcome-banner { 63 background: linear-gradient(135deg, #a36597 0%, #7c4db4 100%); 64 color: #fff; 65 padding: 40px; 66 margin: 20px 0; 67 border-radius: 8px; 68 } 69 70 .bizzswatches-welcome-banner h2 { 71 color: #fff; 72 margin-top: 0; 73 font-size: 24px; 74 } 75 76 .bizzswatches-welcome-banner p { 77 font-size: 16px; 78 margin-bottom: 0; 79 } 80 81 .bizzswatches-setup-steps { 82 background: #fff; 83 padding: 30px; 84 margin: 20px 0; 85 border: 1px solid #ccd0d4; 86 border-radius: 8px; 87 } 88 89 .bizzswatches-setup-steps h2 { 90 margin-top: 0; 91 padding-bottom: 15px; 92 border-bottom: 1px solid #eee; 93 } 94 95 .bizzswatches-step { 96 display: flex; 97 align-items: flex-start; 98 margin: 20px 0; 99 padding: 20px; 100 background: #f9f9f9; 101 border-radius: 6px; 102 } 103 104 .bizzswatches-step .step-number { 105 width: 40px; 106 height: 40px; 107 background: #a36597; 108 color: #fff; 109 border-radius: 50%; 110 display: flex; 111 align-items: center; 112 justify-content: center; 113 font-size: 18px; 114 font-weight: bold; 115 margin-right: 20px; 116 flex-shrink: 0; 117 } 118 119 .bizzswatches-step .step-content h3 { 120 margin-top: 0; 121 margin-bottom: 10px; 122 } 123 124 .bizzswatches-step .step-content p { 125 margin-bottom: 15px; 126 color: #555; 127 } 128 129 .bizzswatches-features-overview { 130 background: #fff; 131 padding: 30px; 132 margin: 20px 0; 133 border: 1px solid #ccd0d4; 134 border-radius: 8px; 135 } 136 137 .bizzswatches-features-overview h2 { 138 margin-top: 0; 139 padding-bottom: 15px; 140 border-bottom: 1px solid #eee; 141 } 142 143 .bizzswatches-features-grid { 144 display: grid; 145 grid-template-columns: repeat(3, 1fr); 146 gap: 20px; 147 margin-top: 20px; 148 } 149 150 .bizzswatches-features-grid .feature-box { 151 padding: 20px; 152 background: #f9f9f9; 153 border-radius: 6px; 154 text-align: center; 155 } 156 157 .bizzswatches-features-grid .feature-box .dashicons { 158 font-size: 36px; 159 width: 36px; 160 height: 36px; 161 color: #a36597; 162 margin-bottom: 10px; 163 } 164 165 .bizzswatches-features-grid .feature-box h4 { 166 margin: 10px 0; 167 } 168 169 .bizzswatches-features-grid .feature-box p { 170 margin: 0; 171 color: #666; 172 font-size: 13px; 173 } 174 175 .bizzswatches-help-section { 176 background: #fff; 177 padding: 30px; 178 margin: 20px 0; 179 border: 1px solid #ccd0d4; 180 border-radius: 8px; 181 } 182 183 .bizzswatches-help-section h2 { 184 margin-top: 0; 185 } 186 187 .bizzswatches-help-links { 188 margin-top: 20px; 189 } 190 191 .bizzswatches-help-links .button { 192 margin-right: 10px; 193 } 194 195 .bizzswatches-help-links .dashicons { 196 margin-right: 5px; 197 vertical-align: middle; 7 /*new by saiful*/ 8 div.bizzplugin-sidebar p.bizzplugin-plugin-description { 9 display: none !important; 198 10 } 199 11 -
bizzswatches/trunk/assets/css/frontend.css
r3461356 r3466822 121 121 } 122 122 123 .bizzswatches-behavior-cross .bizzswatches-item.out-of-stock::before { 123 .bizzswatches-item-cross { 124 display: none; 125 position: absolute; 126 top: 0; 127 left: 0; 128 width: 100%; 129 height: 100%; 130 pointer-events: none; 131 z-index: 10; 132 } 133 134 .bizzswatches-behavior-cross .bizzswatches-item.out-of-stock .bizzswatches-item-cross { 135 display: block; 136 } 137 138 .bizzswatches-behavior-cross .bizzswatches-item.out-of-stock .bizzswatches-item-cross::before { 124 139 content: ''; 125 140 position: absolute; … … 128 143 right: 0; 129 144 height: 2px; 130 background: red;145 background: #ff0000; 131 146 transform: rotate(-45deg); 132 147 } -
bizzswatches/trunk/bizzswatches.php
r3461356 r3466822 10 10 * 11 11 * 12 * Version: 1.0. 012 * Version: 1.0.1 13 13 * Requires at least: 6.2 14 14 * Tested up to: 6.9 … … 16 16 * 17 17 * WC requires at least: 5.0 18 * WC tested up to: 10. 4.218 * WC tested up to: 10.5.2 19 19 * 20 20 * Text Domain: bizzswatches … … 128 128 // Set default options on activation. 129 129 $default_options = array( 130 'enable_swatches' => ' yes',130 'enable_swatches' => '1', 131 131 'shape_style' => 'rounded', 132 'enable_tooltip' => ' yes',133 'show_variation_label' => ' yes',132 'enable_tooltip' => '1', 133 'show_variation_label' => '1', 134 134 'attribute_behavior' => 'blur', 135 'default_to_button' => 'yes', 135 'default_to_button' => '1', 136 'swatch_width' => '30', 137 'swatch_height' => '30', 136 138 ); 137 139 … … 141 143 142 144 // Set activation transient for welcome page redirect. 143 set_transient( 'bizzswatches_activation_redirect', true, 30 ); 145 // set_transient( 'bizzswatches_activation_redirect', true, 30 ); 146 147 flush_rewrite_rules(); 148 add_option( BIZZSWATCHES_PLUGIN_BASENAME, true ); 144 149 } 145 150 register_activation_hook( __FILE__, 'bizzswatches_activate' ); … … 152 157 function bizzswatches_deactivate() { 153 158 // Clean up transients if needed. 154 delete_transient( 'bizzswatches_activation_redirect' );159 // delete_transient( 'bizzswatches_activation_redirect' ); 155 160 } 156 161 register_deactivation_hook( __FILE__, 'bizzswatches_deactivate' ); -
bizzswatches/trunk/includes/class-bizzswatches.php
r3461356 r3466822 76 76 // Admin includes. 77 77 require_once BIZZSWATCHES_PLUGIN_PATH . 'admin/class-bizzswatches-admin.php'; 78 require_once BIZZSWATCHES_PLUGIN_PATH . 'admin/class-bizzswatches-settings.php';79 require_once BIZZSWATCHES_PLUGIN_PATH . 'admin/class-bizzswatches-getting-started.php';78 // require_once BIZZSWATCHES_PLUGIN_PATH . 'admin/class-bizzswatches-settings.php'; 79 // require_once BIZZSWATCHES_PLUGIN_PATH . 'admin/class-bizzswatches-getting-started.php'; 80 80 require_once BIZZSWATCHES_PLUGIN_PATH . 'admin/class-bizzswatches-product-panel.php'; 81 81 require_once BIZZSWATCHES_PLUGIN_PATH . 'admin/class-bizzswatches-attribute-meta.php'; 82 83 // Options Framework - New settings page. 84 require_once BIZZSWATCHES_PLUGIN_PATH . 'admin/framework-loader.php'; 85 require_once BIZZSWATCHES_PLUGIN_PATH . 'admin/admin-loader.php'; 82 86 83 87 // Public/Frontend includes. … … 103 107 $this->admin = \Bizzswatches\Admin\Admin::instance(); 104 108 $this->frontend = \Bizzswatches\Public_View\Frontend::instance(); 109 110 // Initialize new admin loader for framework-based settings. 111 \Bizzswatches_Admin_Loader::instance(); 112 //\Bizzswatches\Admin\Loader::instance(); 105 113 } 106 114 -
bizzswatches/trunk/public/class-bizzswatches-frontend.php
r3461356 r3466822 92 92 ); 93 93 94 // Add dynamic CSS for swatch size. 95 $width = bizzswatches()->get_option( 'swatch_width', 30 ); 96 $height = bizzswatches()->get_option( 'swatch_height', 30 ); 97 98 $dynamic_css = " 99 .bizzswatches-wrapper .bizzswatches-item { 100 width: {$width}px; 101 height: {$height}px; 102 min-width: {$width}px; 103 min-height: {$height}px; 104 } 105 .bizzswatches-wrapper.bizzswatches-button .bizzswatches-item, 106 .bizzswatches-wrapper.bizzswatches-radio .bizzswatches-item { 107 width: auto; 108 height: auto; 109 min-width: {$width}px; 110 min-height: {$height}px; 111 } 112 "; 113 wp_add_inline_style( self::PREFIX . '-frontend', $dynamic_css ); 114 94 115 wp_enqueue_script( 95 116 self::PREFIX . '-frontend', … … 105 126 array( 106 127 'ajax_url' => admin_url( 'admin-ajax.php' ), 107 'enable_tooltip' => bizzswatches()->get_option( 'enable_tooltip', ' yes' ),128 'enable_tooltip' => bizzswatches()->get_option( 'enable_tooltip', '1' ), 108 129 'attribute_behavior' => bizzswatches()->get_option( 'attribute_behavior', 'blur' ), 109 130 ) … … 119 140 */ 120 141 public function body_class( $classes ) { 121 $behavior = bizzswatches()->get_option( 'attribute_behavior', 'blur' );122 123 142 $classes[] = 'bizzswatches'; 124 $classes[] = 'bizzswatches-behavior-' . sanitize_html_class( $behavior );125 143 $classes[] = 'bizzswatches-theme-' . strtolower( sanitize_html_class( basename( get_stylesheet_directory() ) ) ); 126 144 127 if ( wc_string_to_bool( bizzswatches()->get_option( 'show_variation_label', ' yes' ) ) ) {145 if ( wc_string_to_bool( bizzswatches()->get_option( 'show_variation_label', '1' ) ) ) { 128 146 $classes[] = 'bizzswatches-show-label'; 129 }130 131 if ( wc_string_to_bool( bizzswatches()->get_option( 'enable_tooltip', 'yes' ) ) ) {132 $classes[] = 'bizzswatches-tooltip';133 147 } 134 148 -
bizzswatches/trunk/public/class-bizzswatches-swatches-display.php
r3461356 r3466822 66 66 public function render_swatches( $html, $args ) { 67 67 // Check if swatches are enabled. 68 if ( ' yes' !== bizzswatches()->get_option( 'enable_swatches', 'yes' ) ) {68 if ( '1' !== bizzswatches()->get_option( 'enable_swatches', '1' ) ) { 69 69 return $html; 70 70 } … … 80 80 if ( ! $taxonomy ) { 81 81 // Check if we should convert to button. 82 if ( ' yes' === bizzswatches()->get_option( 'default_to_button', 'yes' ) ) {82 if ( '1' === bizzswatches()->get_option( 'default_to_button', '1' ) ) { 83 83 return $html . $this->render_button_swatches( $args ); 84 84 } … … 108 108 default: 109 109 // Convert dropdown to button if enabled. 110 if ( ' yes' === bizzswatches()->get_option( 'default_to_button', 'yes' ) ) {110 if ( '1' === bizzswatches()->get_option( 'default_to_button', '1' ) ) { 111 111 $swatches_html = $this->render_button_swatches( $args ); 112 112 } else { … … 123 123 * 124 124 * @param string $type Swatch type. 125 * @return string 126 */ 127 protected function get_wrapper_classes( $type ) { 128 $shape = bizzswatches()->get_option( 'shape_style', 'rounded' ); 125 * @param \WC_Product|null $product Product object. 126 * @return string 127 */ 128 protected function get_wrapper_classes( $type, $product = null ) { 129 $shape = bizzswatches()->get_option( 'shape_style', 'rounded' ); 130 $tooltip = bizzswatches()->get_option( 'enable_tooltip', '1' ); 131 $behavior = bizzswatches()->get_option( 'attribute_behavior', 'blur' ); 132 133 if ( $product ) { 134 $product_id = $product->get_id(); 135 $swatch_meta = get_post_meta( $product_id, '_bizzswatches_settings', true ); 136 137 if ( is_array( $swatch_meta ) && isset( $swatch_meta['override_global'] ) && '1' === $swatch_meta['override_global'] ) { 138 if ( ! empty( $swatch_meta['shape_style'] ) ) { 139 $shape = $swatch_meta['shape_style']; 140 } 141 if ( isset( $swatch_meta['enable_tooltip'] ) && '' !== $swatch_meta['enable_tooltip'] ) { 142 $tooltip = $swatch_meta['enable_tooltip']; 143 } 144 if ( ! empty( $swatch_meta['attribute_behavior'] ) ) { 145 $behavior = $swatch_meta['attribute_behavior']; 146 } 147 } 148 } 149 129 150 $classes = array( 130 151 'bizzswatches-wrapper', 131 152 'bizzswatches-' . $type, 132 153 'bizzswatches-shape-' . $shape, 133 ); 154 'bizzswatches-behavior-' . $behavior, 155 ); 156 157 if ( wc_string_to_bool( $tooltip ) ) { 158 $classes[] = 'bizzswatches-tooltip'; 159 } 134 160 135 161 return implode( ' ', $classes ); … … 151 177 $output = sprintf( 152 178 '<div class="%s" data-attribute="%s">', 153 esc_attr( $this->get_wrapper_classes( 'color' ) ),179 esc_attr( $this->get_wrapper_classes( 'color', $args['product'] ) ), 154 180 esc_attr( $attribute ) 155 181 ); … … 168 194 169 195 $output .= sprintf( 170 '<span class="bizzswatches-item bizzswatches-color-item" data-value="%s" data-tooltip="%s" style="background-color:%s;" title="%s">< /span>',196 '<span class="bizzswatches-item bizzswatches-color-item" data-value="%s" data-tooltip="%s" style="background-color:%s;" title="%s"><span class="bizzswatches-item-cross"></span></span>', 171 197 esc_attr( $term->slug ), 172 198 esc_attr( $term->name ), … … 197 223 $output = sprintf( 198 224 '<div class="%s" data-attribute="%s">', 199 esc_attr( $this->get_wrapper_classes( 'image' ) ),225 esc_attr( $this->get_wrapper_classes( 'image', $args['product'] ) ), 200 226 esc_attr( $attribute ) 201 227 ); … … 216 242 if ( $image_url ) { 217 243 $output .= sprintf( 218 '<span class="bizzswatches-item bizzswatches-image-item" data-value="%s" data-tooltip="%s" title="%s"><img src="%s" alt="%s" />< /span>',244 '<span class="bizzswatches-item bizzswatches-image-item" data-value="%s" data-tooltip="%s" title="%s"><img src="%s" alt="%s" /><span class="bizzswatches-item-cross"></span></span>', 219 245 esc_attr( $term->slug ), 220 246 esc_attr( $term->name ), … … 226 252 // Fallback to button if no image. 227 253 $output .= sprintf( 228 '<span class="bizzswatches-item bizzswatches-button-item" data-value="%s" data-tooltip="%s" title="%s">%s< /span>',254 '<span class="bizzswatches-item bizzswatches-button-item" data-value="%s" data-tooltip="%s" title="%s">%s<span class="bizzswatches-item-cross"></span></span>', 229 255 esc_attr( $term->slug ), 230 256 esc_attr( $term->name ), … … 255 281 $output = sprintf( 256 282 '<div class="%s" data-attribute="%s">', 257 esc_attr( $this->get_wrapper_classes( 'button' ) ),283 esc_attr( $this->get_wrapper_classes( 'button', $args['product'] ) ), 258 284 esc_attr( $attribute ) 259 285 ); … … 270 296 if ( in_array( $term->slug, $options, true ) ) { 271 297 $output .= sprintf( 272 '<span class="bizzswatches-item bizzswatches-button-item" data-value="%s" data-tooltip="%s" title="%s">%s< /span>',298 '<span class="bizzswatches-item bizzswatches-button-item" data-value="%s" data-tooltip="%s" title="%s">%s<span class="bizzswatches-item-cross"></span></span>', 273 299 esc_attr( $term->slug ), 274 300 esc_attr( $term->name ), … … 282 308 foreach ( $options as $option ) { 283 309 $output .= sprintf( 284 '<span class="bizzswatches-item bizzswatches-button-item" data-value="%s" data-tooltip="%s" title="%s">%s< /span>',310 '<span class="bizzswatches-item bizzswatches-button-item" data-value="%s" data-tooltip="%s" title="%s">%s<span class="bizzswatches-item-cross"></span></span>', 285 311 esc_attr( $option ), 286 312 esc_attr( $option ), … … 310 336 $output = sprintf( 311 337 '<div class="%s" data-attribute="%s">', 312 esc_attr( $this->get_wrapper_classes( 'radio' ) ),338 esc_attr( $this->get_wrapper_classes( 'radio', $args['product'] ) ), 313 339 esc_attr( $attribute ) 314 340 ); -
bizzswatches/trunk/readme.txt
r3461356 r3466822 7 7 Tested up to: 6.9 8 8 Requires PHP: 8.0 9 Stable tag: 1.0. 09 Stable tag: 1.0.1 10 10 License: GPLv2 or later 11 11 License URI: https://www.gnu.org/licenses/gpl-2.0.html
Note: See TracChangeset
for help on using the changeset viewer.