config.php
516 lines
| 1 | <?php |
| 2 | namespace ShopPress\Elementor\Widgets; |
| 3 | |
| 4 | use Elementor\Controls_Manager; |
| 5 | use ShopPress\Elementor\ShopPressWidgets; |
| 6 | |
| 7 | defined( 'ABSPATH' ) || exit; |
| 8 | |
| 9 | class Tabs extends ShopPressWidgets { |
| 10 | |
| 11 | public function get_name() { |
| 12 | return 'sp-tabs'; |
| 13 | } |
| 14 | |
| 15 | public function get_title() { |
| 16 | return __( 'Product Tabs', 'shop-press' ); |
| 17 | } |
| 18 | |
| 19 | public function get_icon() { |
| 20 | return 'sp-widget sp-eicon-product-tabs'; |
| 21 | } |
| 22 | |
| 23 | public function get_categories() { |
| 24 | return array( 'sp_woo_single' ); |
| 25 | } |
| 26 | |
| 27 | public function setup_styling_options() { |
| 28 | |
| 29 | $this->register_group_styler( |
| 30 | 'wrapper', |
| 31 | __( 'Wrapper', 'shop-press' ), |
| 32 | array( |
| 33 | 'wrapper' => array( |
| 34 | 'label' => esc_html__( 'Wrapper', 'shop-press' ), |
| 35 | 'type' => 'styler', |
| 36 | 'selector' => '.sp-tabs', |
| 37 | 'wrapper' => '{{WRAPPER}}', |
| 38 | ), |
| 39 | ) |
| 40 | ); |
| 41 | $this->register_group_styler( |
| 42 | 'tabs_title', |
| 43 | __( 'Tabs', 'shop-press' ), |
| 44 | array( |
| 45 | 'tabs' => array( |
| 46 | 'label' => esc_html__( 'Tabs Wrapper', 'shop-press' ), |
| 47 | 'type' => 'styler', |
| 48 | 'selector' => 'ul.tabs.wc-tabs', |
| 49 | 'wrapper' => '{{WRAPPER}} .sp-tabs.woocommerce-tabs.wc-tabs-wrapper', |
| 50 | ), |
| 51 | 'tab_item' => array( |
| 52 | 'label' => esc_html__( 'Tabs Item', 'shop-press' ), |
| 53 | 'type' => 'styler', |
| 54 | 'selector' => 'li', |
| 55 | 'wrapper' => '{{WRAPPER}} .sp-tabs.woocommerce-tabs.wc-tabs-wrapper ul.tabs.wc-tabs', |
| 56 | ), |
| 57 | 'tab_title' => array( |
| 58 | 'label' => esc_html__( 'Tabs Title', 'shop-press' ), |
| 59 | 'type' => 'styler', |
| 60 | 'selector' => 'a', |
| 61 | 'wrapper' => '{{WRAPPER}} .sp-tabs.woocommerce-tabs.wc-tabs-wrapper ul.tabs.wc-tabs li', |
| 62 | ), |
| 63 | 'tab_item_active' => array( |
| 64 | 'label' => esc_html__( 'Active Tab Item', 'shop-press' ), |
| 65 | 'type' => 'styler', |
| 66 | 'selector' => 'li.active', |
| 67 | 'wrapper' => '{{WRAPPER}} .sp-tabs.woocommerce-tabs.wc-tabs-wrapper ul.tabs.wc-tabs', |
| 68 | ), |
| 69 | 'tab_item_a_active' => array( |
| 70 | 'label' => esc_html__( 'Active Tab Item link', 'shop-press' ), |
| 71 | 'type' => 'styler', |
| 72 | 'selector' => 'a', |
| 73 | 'wrapper' => '{{WRAPPER}} .sp-tabs.woocommerce-tabs.wc-tabs-wrapper ul.tabs.wc-tabs li.active', |
| 74 | ), |
| 75 | ), |
| 76 | array( |
| 77 | 'style' => 'normal', |
| 78 | ) |
| 79 | ); |
| 80 | |
| 81 | $this->register_group_styler( |
| 82 | 'accordion', |
| 83 | __( 'Accordion', 'shop-press' ), |
| 84 | array( |
| 85 | 'accordions' => array( |
| 86 | 'label' => esc_html__( 'Wrapper', 'shop-press' ), |
| 87 | 'type' => 'styler', |
| 88 | 'selector' => '.sp-accordions-container', |
| 89 | 'wrapper' => '{{WRAPPER}}', |
| 90 | ), |
| 91 | 'accordion_item' => array( |
| 92 | 'label' => esc_html__( 'Item', 'shop-press' ), |
| 93 | 'type' => 'styler', |
| 94 | 'selector' => '.sp-accordion-item', |
| 95 | 'wrapper' => '{{WRAPPER}} .sp-accordions-container', |
| 96 | ), |
| 97 | 'accordion_title' => array( |
| 98 | 'label' => esc_html__( 'Item Title', 'shop-press' ), |
| 99 | 'type' => 'styler', |
| 100 | 'selector' => '.sp-accordion-item-header', |
| 101 | 'wrapper' => '{{WRAPPER}} .sp-accordions-container .sp-accordion-item', |
| 102 | ), |
| 103 | 'accordion_title_icon' => array( |
| 104 | 'label' => esc_html__( 'Item Title Icon', 'shop-press' ), |
| 105 | 'type' => 'styler', |
| 106 | 'selector' => 'img', |
| 107 | 'wrapper' => '{{WRAPPER}} .sp-accordions-container .sp-accordion-item .sp-accordion-item-header', |
| 108 | ), |
| 109 | 'accordion_title_toggle_icon' => array( |
| 110 | 'label' => esc_html__( 'Item Title Toggle Icon', 'shop-press' ), |
| 111 | 'type' => 'styler', |
| 112 | 'selector' => '.sp-accordion-item-header-icon svg', |
| 113 | 'wrapper' => '{{WRAPPER}} .sp-accordions-container .sp-accordion-item .sp-accordion-item-header ', |
| 114 | ), |
| 115 | 'accordion_item_active' => array( |
| 116 | 'label' => esc_html__( 'Active Item', 'shop-press' ), |
| 117 | 'type' => 'styler', |
| 118 | 'selector' => '.sp-accordion-item.open', |
| 119 | 'wrapper' => '{{WRAPPER}} .sp-accordions-container', |
| 120 | ), |
| 121 | 'accordion_item_a_active' => array( |
| 122 | 'label' => esc_html__( 'Active Item Title', 'shop-press' ), |
| 123 | 'type' => 'styler', |
| 124 | 'selector' => '.sp-accordion-item-header', |
| 125 | 'wrapper' => '{{WRAPPER}} .sp-accordions-container .sp-accordion-item.open', |
| 126 | ), |
| 127 | 'accordion_item_content' => array( |
| 128 | 'label' => esc_html__( 'Item Content Wrapper', 'shop-press' ), |
| 129 | 'type' => 'styler', |
| 130 | 'selector' => '.sp-accordion-item-content', |
| 131 | 'wrapper' => '{{WRAPPER}} .sp-accordions-container .sp-accordion-item', |
| 132 | ), |
| 133 | 'accordion_item_content_p' => array( |
| 134 | 'label' => esc_html__( 'Item Content', 'shop-press' ), |
| 135 | 'type' => 'styler', |
| 136 | 'selector' => 'p', |
| 137 | 'wrapper' => '{{WRAPPER}} .sp-accordions-container .sp-accordion-item .sp-accordion-item-content ', |
| 138 | ), |
| 139 | ), |
| 140 | array( |
| 141 | 'style' => 'accordion', |
| 142 | ) |
| 143 | ); |
| 144 | |
| 145 | $this->register_group_styler( |
| 146 | 'desc_tab', |
| 147 | __( 'Description', 'shop-press' ), |
| 148 | array( |
| 149 | 'tab_item_panel' => array( |
| 150 | 'label' => esc_html__( 'Tabs Panel', 'shop-press' ), |
| 151 | 'type' => 'styler', |
| 152 | 'selector' => '.woocommerce-Tabs-panel', |
| 153 | 'wrapper' => '{{WRAPPER}} .sp-tabs.woocommerce-tabs.wc-tabs-wrapper', |
| 154 | ), |
| 155 | 'tab_desc_content' => array( |
| 156 | 'label' => esc_html__( 'Description Content', 'shop-press' ), |
| 157 | 'type' => 'styler', |
| 158 | 'selector' => 'p', |
| 159 | 'wrapper' => '{{WRAPPER}} .woocommerce-tabs .woocommerce-Tabs-panel.woocommerce-Tabs-panel--description', |
| 160 | ), |
| 161 | ) |
| 162 | ); |
| 163 | $this->register_group_styler( |
| 164 | 'attributes', |
| 165 | __( 'Attributes', 'shop-press' ), |
| 166 | array( |
| 167 | 'table' => array( |
| 168 | 'label' => esc_html__( 'Attributes Container', 'shop-press' ), |
| 169 | 'type' => 'styler', |
| 170 | 'selector' => '.woocommerce-product-attributes', |
| 171 | 'wrapper' => '{{WRAPPER}} .woocommerce-Tabs-panel.woocommerce-Tabs-panel--additional_information', |
| 172 | ), |
| 173 | 'tbody' => array( |
| 174 | 'label' => esc_html__( 'Table Body', 'shop-press' ), |
| 175 | 'type' => 'styler', |
| 176 | 'selector' => 'tbody', |
| 177 | 'wrapper' => '{{WRAPPER}} .woocommerce-product-attributes', |
| 178 | ), |
| 179 | 'tr' => array( |
| 180 | 'label' => esc_html__( 'Table Row', 'shop-press' ), |
| 181 | 'type' => 'styler', |
| 182 | 'selector' => 'tr.woocommerce-product-attributes-item', |
| 183 | 'wrapper' => '{{WRAPPER}} .woocommerce-product-attributes tbody', |
| 184 | ), |
| 185 | 'th' => array( |
| 186 | 'label' => esc_html__( 'Table Header', 'shop-press' ), |
| 187 | 'type' => 'styler', |
| 188 | 'selector' => 'th.woocommerce-product-attributes-item__label', |
| 189 | 'wrapper' => '{{WRAPPER}} tr.woocommerce-product-attributes-item', |
| 190 | ), |
| 191 | 'td' => array( |
| 192 | 'label' => esc_html__( 'Value Cell', 'shop-press' ), |
| 193 | 'type' => 'styler', |
| 194 | 'selector' => 'td.woocommerce-product-attributes-item__value', |
| 195 | 'wrapper' => '{{WRAPPER}} tr.woocommerce-product-attributes-item', |
| 196 | ), |
| 197 | 'td_content' => array( |
| 198 | 'label' => esc_html__( 'Value Content', 'shop-press' ), |
| 199 | 'type' => 'styler', |
| 200 | 'selector' => 'p', |
| 201 | 'wrapper' => '{{WRAPPER}} td.woocommerce-product-attributes-item__value', |
| 202 | ), |
| 203 | 'td_link' => array( |
| 204 | 'label' => esc_html__( 'Link', 'shop-press' ), |
| 205 | 'type' => 'styler', |
| 206 | 'selector' => 'a', |
| 207 | 'wrapper' => '{{WRAPPER}} td.woocommerce-product-attributes-item__value p', |
| 208 | ), |
| 209 | ) |
| 210 | ); |
| 211 | $this->register_group_styler( |
| 212 | 'reviews', |
| 213 | __( 'Review', 'shop-press' ), |
| 214 | array( |
| 215 | 'reviews_wrapper' => array( |
| 216 | 'label' => esc_html__( 'Reviews Wrapper', 'shop-press' ), |
| 217 | 'type' => 'styler', |
| 218 | 'selector' => '#reviews.woocommerce-Reviews', |
| 219 | 'wrapper' => '{{WRAPPER}} .woocommerce-Tabs-panel.woocommerce-Tabs-panel--reviews', |
| 220 | ), |
| 221 | // 'review_summary' => array( |
| 222 | // 'label' => esc_html__( 'Comments Summary Wrapper', 'shop-press' ), |
| 223 | // 'type' => 'styler', |
| 224 | // 'selector' => '.kata-review-summery', |
| 225 | // 'wrapper' => '{{WRAPPER}} #reviews.woocommerce-Reviews', |
| 226 | // ), |
| 227 | // 'overall_rating_wrap' => array( |
| 228 | // 'label' => esc_html__( 'Overall Rating Wrapper', 'shop-press' ), |
| 229 | // 'type' => 'styler', |
| 230 | // 'selector' => '.overall-rating-wrap', |
| 231 | // 'wrapper' => '{{WRAPPER}} #reviews.woocommerce-Reviews .kata-review-summery', |
| 232 | // ), |
| 233 | // 'average_rating' => array( |
| 234 | // 'label' => esc_html__( 'Average Rating', 'shop-press' ), |
| 235 | // 'type' => 'styler', |
| 236 | // 'selector' => 'div.average-rating', |
| 237 | // 'wrapper' => '{{WRAPPER}} #reviews.woocommerce-Reviews .kata-review-summery .overall-rating-wrap', |
| 238 | // ), |
| 239 | // 'avg_stars_wrap' => array( |
| 240 | // 'label' => esc_html__( 'Average Stars Wrapper', 'shop-press' ), |
| 241 | // 'type' => 'styler', |
| 242 | // 'selector' => '.star-rating', |
| 243 | // 'wrapper' => '{{WRAPPER}} #reviews.woocommerce-Reviews .kata-review-summery .overall-rating-wrap .average-rating-stars', |
| 244 | // ), |
| 245 | // 'avg_star' => array( |
| 246 | // 'label' => esc_html__( 'Average Star', 'shop-press' ), |
| 247 | // 'type' => 'styler', |
| 248 | // 'selector' => 'span', |
| 249 | // 'wrapper' => '{{WRAPPER}} #reviews.woocommerce-Reviews .kata-review-summery .overall-rating-wrap .average-rating-stars .star-rating', |
| 250 | // ), |
| 251 | // 'reviews_count' => array( |
| 252 | // 'label' => esc_html__( 'Reviews Count', 'shop-press' ), |
| 253 | // 'type' => 'styler', |
| 254 | // 'selector' => '.reviews-count', |
| 255 | // 'wrapper' => '{{WRAPPER}} #reviews.woocommerce-Reviews .kata-review-summery .overall-rating-wrap', |
| 256 | // ), |
| 257 | // 'comment_write_wrap' => array( |
| 258 | // 'label' => esc_html__( 'Review Button Wrapper', 'shop-press' ), |
| 259 | // 'type' => 'styler', |
| 260 | // 'selector' => '.write-a-review', |
| 261 | // 'wrapper' => '{{WRAPPER}} #reviews.woocommerce-Reviews .kata-review-summery .overall-rating-wrap', |
| 262 | // ), |
| 263 | // 'comment_write' => array( |
| 264 | // 'label' => esc_html__( 'Review Button', 'shop-press' ), |
| 265 | // 'type' => 'styler', |
| 266 | // 'selector' => '.button', |
| 267 | // 'wrapper' => '{{WRAPPER}} #reviews.woocommerce-Reviews .kata-review-summery .overall-rating-wrap .write-a-review', |
| 268 | // ), |
| 269 | // 'rating-summary-wrap' => array( |
| 270 | // 'label' => esc_html__( 'Rating Summary Wrapper', 'shop-press' ), |
| 271 | // 'type' => 'styler', |
| 272 | // 'selector' => '.rating-summary-wrap', |
| 273 | // 'wrapper' => '{{WRAPPER}} #reviews.woocommerce-Reviews .kata-review-summery', |
| 274 | // ), |
| 275 | // 'rating-summary-item' => array( |
| 276 | // 'label' => esc_html__( 'Rating Summary Item', 'shop-press' ), |
| 277 | // 'type' => 'styler', |
| 278 | // 'selector' => 'div.item', |
| 279 | // 'wrapper' => '{{WRAPPER}} #reviews.woocommerce-Reviews .kata-review-summery .rating-summary-wrap', |
| 280 | // ), |
| 281 | // 'item_rate_count' => array( |
| 282 | // 'label' => esc_html__( 'Item Rate Count', 'shop-press' ), |
| 283 | // 'type' => 'styler', |
| 284 | // 'selector' => '.rate-count', |
| 285 | // 'wrapper' => '{{WRAPPER}} #reviews.woocommerce-Reviews .kata-review-summery .rating-summary-wrap div.item', |
| 286 | // ), |
| 287 | 'comments_container' => array( |
| 288 | 'label' => esc_html__( 'Comments Container', 'shop-press' ), |
| 289 | 'type' => 'styler', |
| 290 | 'selector' => '#comments', |
| 291 | 'wrapper' => '{{WRAPPER}} #reviews', |
| 292 | ), |
| 293 | 'review_title' => array( |
| 294 | 'label' => esc_html__( 'Review Title', 'shop-press' ), |
| 295 | 'type' => 'styler', |
| 296 | 'selector' => 'h2.woocommerce-Reviews-title', |
| 297 | 'wrapper' => '{{WRAPPER}} #comments', |
| 298 | 'separator' => 'before', |
| 299 | ), |
| 300 | 'product_review_title' => array( |
| 301 | 'label' => esc_html__( 'Product Title', 'shop-press' ), |
| 302 | 'type' => 'styler', |
| 303 | 'selector' => 'span', |
| 304 | 'wrapper' => '{{WRAPPER}} h2.woocommerce-Reviews-title', |
| 305 | ), |
| 306 | 'comments_list_wrapper' => array( |
| 307 | 'label' => esc_html__( 'Comments List Wrapper', 'shop-press' ), |
| 308 | 'type' => 'styler', |
| 309 | 'selector' => 'ol.commentlist', |
| 310 | 'wrapper' => '{{WRAPPER}} #reviews #comments', |
| 311 | 'separator' => 'before', |
| 312 | ), |
| 313 | 'comment_item' => array( |
| 314 | 'label' => esc_html__( 'Comment', 'shop-press' ), |
| 315 | 'type' => 'styler', |
| 316 | 'selector' => 'li', |
| 317 | 'wrapper' => '{{WRAPPER}} #reviews #comments ol.commentlist', |
| 318 | ), |
| 319 | 'comment_item_container' => array( |
| 320 | 'label' => esc_html__( 'Comment Item Container', 'shop-press' ), |
| 321 | 'type' => 'styler', |
| 322 | 'selector' => '.comment_container', |
| 323 | 'wrapper' => '{{WRAPPER}} #reviews #comments ol.commentlist li', |
| 324 | ), |
| 325 | 'comment_item_img' => array( |
| 326 | 'label' => esc_html__( 'Comment Item Image', 'shop-press' ), |
| 327 | 'type' => 'styler', |
| 328 | 'selector' => 'img.avatar', |
| 329 | 'wrapper' => '{{WRAPPER}} #reviews #comments ol.commentlist .comment_container', |
| 330 | ), |
| 331 | 'comment_item_text' => array( |
| 332 | 'label' => esc_html__( 'Comment Item Text', 'shop-press' ), |
| 333 | 'type' => 'styler', |
| 334 | 'selector' => '.comment-text', |
| 335 | 'wrapper' => '{{WRAPPER}} #reviews #comments ol.commentlist .comment_container', |
| 336 | ), |
| 337 | 'comment_item_meta_wrapper' => array( |
| 338 | 'label' => esc_html__( 'Comment Item Meta Wrapper', 'shop-press' ), |
| 339 | 'type' => 'styler', |
| 340 | 'selector' => '.meta', |
| 341 | 'wrapper' => '{{WRAPPER}} #reviews #comments ol.commentlist .comment_container .comment-text', |
| 342 | ), |
| 343 | 'comment_item_author' => array( |
| 344 | 'label' => esc_html__( 'Comment Item Author', 'shop-press' ), |
| 345 | 'type' => 'styler', |
| 346 | 'selector' => 'strong.woocommerce-review__author', |
| 347 | 'wrapper' => '{{WRAPPER}} #reviews #comments ol.commentlist .comment_container .comment-text .meta', |
| 348 | ), |
| 349 | 'comment_item_date' => array( |
| 350 | 'label' => esc_html__( 'Comment Item Date', 'shop-press' ), |
| 351 | 'type' => 'styler', |
| 352 | 'selector' => 'time.woocommerce-review__published-date', |
| 353 | 'wrapper' => '{{WRAPPER}} #reviews #comments ol.commentlist .comment_container .comment-text .meta', |
| 354 | ), |
| 355 | 'comment_item_star_rating_wrapper' => array( |
| 356 | 'label' => esc_html__( 'Comment Item Stars Wrapper', 'shop-press' ), |
| 357 | 'type' => 'styler', |
| 358 | 'selector' => '.star-rating', |
| 359 | 'wrapper' => '{{WRAPPER}} #reviews #comments ol.commentlist .comment_container .comment-text', |
| 360 | ), |
| 361 | 'comment_item_empty_stars' => array( |
| 362 | 'label' => esc_html__( 'Comment Item Empty Stars', 'shop-press' ), |
| 363 | 'type' => 'styler', |
| 364 | 'selector' => '.star-rating:before', |
| 365 | 'wrapper' => '{{WRAPPER}} #reviews #comments ol.commentlist .comment_container .comment-text', |
| 366 | ), |
| 367 | 'comment_item_full_stars' => array( |
| 368 | 'label' => esc_html__( 'Comment Item Full Stars', 'shop-press' ), |
| 369 | 'type' => 'styler', |
| 370 | 'selector' => '.star-rating span:before', |
| 371 | 'wrapper' => '{{WRAPPER}} #reviews #comments ol.commentlist .comment_container .comment-text', |
| 372 | ), |
| 373 | 'comment_item_desc' => array( |
| 374 | 'label' => esc_html__( 'Comment Item Description', 'shop-press' ), |
| 375 | 'type' => 'styler', |
| 376 | 'selector' => 'p', |
| 377 | 'wrapper' => '{{WRAPPER}} #reviews #comments ol.commentlist .comment_container .comment-text .description', |
| 378 | ), |
| 379 | 'form_wrapper' => array( |
| 380 | 'label' => esc_html__( 'Form Wrapper', 'shop-press' ), |
| 381 | 'type' => 'styler', |
| 382 | 'selector' => '#review_form_wrapper', |
| 383 | 'wrapper' => '{{WRAPPER}} #reviews.woocommerce-Reviews', |
| 384 | 'separator' => 'before', |
| 385 | ), |
| 386 | 'form_container' => array( |
| 387 | 'label' => esc_html__( 'Reviews Container', 'shop-press' ), |
| 388 | 'type' => 'styler', |
| 389 | 'selector' => '#review_form', |
| 390 | 'wrapper' => '{{WRAPPER}} #reviews.woocommerce-Reviews #review_form_wrapper', |
| 391 | ), |
| 392 | 'form_respond' => array( |
| 393 | 'label' => esc_html__( 'Form', 'shop-press' ), |
| 394 | 'type' => 'styler', |
| 395 | 'selector' => '#respond.comment-respond', |
| 396 | 'wrapper' => '{{WRAPPER}} #reviews.woocommerce-Reviews #review_form_wrapper #review_form', |
| 397 | ), |
| 398 | 'reply_title' => array( |
| 399 | 'label' => esc_html__( 'Reply Title', 'shop-press' ), |
| 400 | 'type' => 'styler', |
| 401 | 'selector' => 'span.comment-reply-title', |
| 402 | 'wrapper' => '{{WRAPPER}} #reviews.woocommerce-Reviews #review_form_wrapper #review_form #respond.comment-respond', |
| 403 | ), |
| 404 | 'comment_form' => array( |
| 405 | 'label' => esc_html__( 'Comment Form', 'shop-press' ), |
| 406 | 'type' => 'styler', |
| 407 | 'selector' => 'form.comment-form', |
| 408 | 'wrapper' => '{{WRAPPER}} #reviews.woocommerce-Reviews #review_form_wrapper #review_form #respond.comment-respond', |
| 409 | 'separator' => 'before', |
| 410 | ), |
| 411 | 'comment_form_rating' => array( |
| 412 | 'label' => esc_html__( 'Comment Form Rating', 'shop-press' ), |
| 413 | 'type' => 'styler', |
| 414 | 'selector' => '.rating', |
| 415 | 'wrapper' => '{{WRAPPER}} #reviews.woocommerce-Reviews #review_form_wrapper #review_form #respond.comment-respond form.comment-form .comment-form-rating', |
| 416 | ), |
| 417 | 'comment_form_rating_label' => array( |
| 418 | 'label' => esc_html__( 'Comment Form Rating Label', 'shop-press' ), |
| 419 | 'type' => 'styler', |
| 420 | 'selector' => 'label', |
| 421 | 'wrapper' => '{{WRAPPER}} #reviews.woocommerce-Reviews #review_form_wrapper #review_form #respond.comment-respond form.comment-form .comment-form-rating', |
| 422 | ), |
| 423 | 'comment_text_wrap' => array( |
| 424 | 'label' => esc_html__( 'Form Text Area Wrapper', 'shop-press' ), |
| 425 | 'type' => 'styler', |
| 426 | 'selector' => 'p.comment-form-comment', |
| 427 | 'wrapper' => '{{WRAPPER}} #reviews.woocommerce-Reviews #review_form_wrapper #review_form #respond.comment-respond form.comment-form', |
| 428 | ), |
| 429 | 'comment_text_label' => array( |
| 430 | 'label' => esc_html__( 'Comment Form Label', 'shop-press' ), |
| 431 | 'type' => 'styler', |
| 432 | 'selector' => 'label', |
| 433 | 'wrapper' => '{{WRAPPER}} #reviews.woocommerce-Reviews #review_form_wrapper #review_form #respond.comment-respond form.comment-form p.comment-form-comment', |
| 434 | ), |
| 435 | 'comment_text' => array( |
| 436 | 'label' => esc_html__( 'Comment Textarea', 'shop-press' ), |
| 437 | 'type' => 'styler', |
| 438 | 'selector' => 'textarea', |
| 439 | 'wrapper' => '{{WRAPPER}} #reviews.woocommerce-Reviews #review_form_wrapper #review_form #respond.comment-respond form.comment-form p.comment-form-comment', |
| 440 | ), |
| 441 | 'form_submit' => array( |
| 442 | 'label' => esc_html__( 'Submit Button Wrapper', 'shop-press' ), |
| 443 | 'type' => 'styler', |
| 444 | 'selector' => 'p.form-submit', |
| 445 | 'wrapper' => '{{WRAPPER}} #reviews.woocommerce-Reviews #review_form_wrapper #review_form #respond.comment-respond form.comment-form', |
| 446 | 'separator' => 'before', |
| 447 | ), |
| 448 | 'submit_button' => array( |
| 449 | 'label' => esc_html__( 'Submit Button', 'shop-press' ), |
| 450 | 'type' => 'styler', |
| 451 | 'selector' => 'input[type="submit"]', |
| 452 | 'wrapper' => '{{WRAPPER}} #reviews.woocommerce-Reviews #review_form_wrapper #review_form #respond.comment-respond form.comment-form p.form-submit', |
| 453 | ), |
| 454 | ) |
| 455 | ); |
| 456 | } |
| 457 | |
| 458 | protected function register_controls() { |
| 459 | |
| 460 | $this->start_controls_section( |
| 461 | 'section_content', |
| 462 | array( |
| 463 | 'label' => __( 'General', 'shop-press' ), |
| 464 | ) |
| 465 | ); |
| 466 | |
| 467 | $this->add_control( |
| 468 | 'style', |
| 469 | array( |
| 470 | 'label' => __( 'Style', 'shop-press' ), |
| 471 | 'type' => Controls_Manager::SELECT, |
| 472 | 'default' => 'normal', |
| 473 | 'options' => array( |
| 474 | 'normal' => __( 'Normal', 'shop-press' ), |
| 475 | 'accordion' => __( 'Accordion', 'shop-press' ), |
| 476 | ), |
| 477 | ) |
| 478 | ); |
| 479 | |
| 480 | $this->add_control( |
| 481 | 'open_first_tab', |
| 482 | array( |
| 483 | 'label' => __( 'Open First Tab', 'shop-press' ), |
| 484 | 'type' => Controls_Manager::SWITCHER, |
| 485 | 'default' => 'yes', |
| 486 | 'return_value' => 'yes', |
| 487 | 'condition' => array( |
| 488 | 'style' => 'accordion', |
| 489 | ), |
| 490 | ) |
| 491 | ); |
| 492 | |
| 493 | $this->end_controls_section(); |
| 494 | $this->setup_styling_options(); |
| 495 | |
| 496 | do_action( 'shoppress/elementor/widget/register_controls_init', $this ); |
| 497 | } |
| 498 | |
| 499 | protected function render() { |
| 500 | $settings = $this->get_settings_for_display(); |
| 501 | do_action( 'shoppress/widget/before_render', $settings ); |
| 502 | |
| 503 | $args = array(); |
| 504 | if ( $this->editor_preview() ) { |
| 505 | if ( 'accordion' == $settings['style'] ) { |
| 506 | |
| 507 | $args['open_first_tab'] = 'yes' === ( $settings['open_first_tab'] ?? '' ); |
| 508 | sp_load_builder_template( 'single-product/product-tabs-accordions', $args ); |
| 509 | } else { |
| 510 | |
| 511 | sp_load_builder_template( 'single-product/product-tabs', $args ); |
| 512 | } |
| 513 | } |
| 514 | } |
| 515 | } |
| 516 |