Changeset 3466081
- Timestamp:
- 02/20/2026 08:39:56 PM (5 weeks ago)
- Location:
- customize-my-account-for-woocommerce
- Files:
-
- 10 edited
- 1 copied
-
tags/3.8.1 (copied) (copied from customize-my-account-for-woocommerce/trunk)
-
tags/3.8.1/customize-my-account-for-woocommerce.php (modified) (1 diff)
-
tags/3.8.1/include/admin/wrap/endpoints-content.php (modified) (1 diff)
-
tags/3.8.1/include/admin/wrap/subwrap/countof-settings.php (modified) (1 diff)
-
tags/3.8.1/include/wcmamtx_countof_functions.php (modified) (21 diffs)
-
tags/3.8.1/readme.txt (modified) (1 diff)
-
trunk/customize-my-account-for-woocommerce.php (modified) (1 diff)
-
trunk/include/admin/wrap/endpoints-content.php (modified) (1 diff)
-
trunk/include/admin/wrap/subwrap/countof-settings.php (modified) (1 diff)
-
trunk/include/wcmamtx_countof_functions.php (modified) (21 diffs)
-
trunk/readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
customize-my-account-for-woocommerce/tags/3.8.1/customize-my-account-for-woocommerce.php
r3465865 r3466081 4 4 Plugin URI: https://sysbasics.com 5 5 Description: Customize My account page. Add/Edit/Remove Endpoints. 6 Version: 3.8. 06 Version: 3.8.1 7 7 Author: SysBasics 8 8 Author URI: https://sysbasics.com -
customize-my-account-for-woocommerce/tags/3.8.1/include/admin/wrap/endpoints-content.php
r3464708 r3466081 145 145 146 146 </tr> 147 <?php if (isset($third_party)) { ?>148 <tr>149 <td>150 <label class=" wcmamtx_accordion_label">151 <?php echo esc_html__('Content Before','customize-my-account-for-woocommerce'); ?>152 <?php echo $key; ?>153 <?php echo esc_html__('Content','customize-my-account-for-woocommerce'); ?>154 </label>155 </td>156 <td>157 <?php wcmamtx_show_disabled_toggle_image(); ?>158 159 </td>160 </tr>161 <tr>162 <td>163 <label class=" wcmamtx_accordion_label">164 <?php echo esc_html__('Content After','customize-my-account-for-woocommerce'); ?>165 <?php echo $key; ?>166 <?php echo esc_html__('Content','customize-my-account-for-woocommerce'); ?>167 </label>168 </td>169 <td>170 <?php wcmamtx_show_disabled_toggle_image(); ?>171 172 </td>173 </tr>174 <?php } ?>175 176 177 178 179 180 147 <tr> 181 148 <td> -
customize-my-account-for-woocommerce/tags/3.8.1/include/admin/wrap/subwrap/countof-settings.php
r3465865 r3466081 74 74 $hide_sidebar = isset($value['hide_sidebar']) && ($value['hide_sidebar'] == "01") ? "yes" : "no"; 75 75 76 break; 77 78 case "wishlist": 79 $wishlist_mode = "none"; 80 81 $wishlist_mode = wcmamtx_detect_wishlist_mode(); 82 83 echo $wishlist_mode; 84 85 if ($wishlist_mode == "none") { 86 $count_bubble = isset($value['count_bubble']) && ($value['count_bubble'] == "01") ? "yes" : "no"; 87 } else { 88 89 if (is_array($value) ) { 90 91 if (!isset($value['count_bubble'])) { 92 $value['count_bubble'] = "01"; 93 } else { 94 $value['count_bubble'] = $value['count_bubble']; 95 } 96 97 } 98 99 $count_bubble = isset($value['count_bubble']) && ($value['count_bubble'] == "01") ? "yes" : "no"; 100 101 } 102 103 104 105 $hide_empty = isset($value['hide_empty']) && ($value['hide_empty'] == "01") ? "yes" : "no"; 106 107 $section_style = isset($value['count_bubble']) && ($value['count_bubble'] == "01") ? "display:block;" : "display:none;"; 108 109 110 111 $count_of = isset($value['count_of']) ? $value['count_of'] : $wishlist_mode; 112 113 114 115 116 117 $section_style_cpt = isset($count_of) && ($count_of == "cpt_count") ? "display:block;" : "display:none;"; 118 119 $section_style_usermeta = isset($count_of) && ($count_of == "usermeta_count") ? "display:block;" : "display:none;"; 120 121 122 $hide_sidebar = isset($value['hide_sidebar']) && ($value['hide_sidebar'] == "01") ? "yes" : "no"; 123 124 76 125 break; 77 126 -
customize-my-account-for-woocommerce/tags/3.8.1/include/wcmamtx_countof_functions.php
r3465865 r3466081 11 11 12 12 $count_of = 'none'; 13 14 13 15 14 16 switch($key) { … … 38 40 break; 39 41 42 case "wishlist": 43 44 45 46 $wishlist_mode = "none"; 47 48 $wishlist_mode = wcmamtx_detect_wishlist_mode(); 49 50 51 52 if ($wishlist_mode == "none") { 53 $count_bubble = isset($value['count_bubble']) && ($value['count_bubble'] == "01") ? "yes" : "no"; 54 } else { 55 56 if (is_array($value) ) { 57 58 if (!isset($value['count_bubble'])) { 59 $value['count_bubble'] = "01"; 60 } else { 61 $value['count_bubble'] = $value['count_bubble']; 62 } 63 64 } 65 66 $count_bubble = isset($value['count_bubble']) && ($value['count_bubble'] == "01") ? "yes" : "no"; 67 68 } 69 70 $hide_empty = isset($value['hide_empty']) && ($value['hide_empty'] == "01") ? "yes" : "no"; 71 72 73 $count_of = isset($value['count_of']) ? $value['count_of'] : $wishlist_mode; 74 75 76 wcmamtx_countof_conditional_switch($count_of,$value,$sidebar); 77 78 79 80 81 break; 82 40 83 case "woo-wallet": 41 84 if (is_array($value) ) { … … 115 158 if (isset($count_of) && ($count_of != null)) { 116 159 117 if (($key != "orders") || ($key != "downloads")) { 118 119 120 121 switch($count_of) { 122 123 case "order_count": 124 wcmamtx_render_order_count_bubble_html($count_bubble,$hide_empty,$sidebar); 125 break; 126 127 case "downloads_count": 128 wcmamtx_render_download_count_bubble_html($count_bubble,$hide_empty,$sidebar); 129 break; 130 131 case "cpt_count": 132 wcmamtx_render_cpt_count_bubble_html($count_bubble,$hide_empty,$value,$sidebar); 133 break; 134 135 case "yith_wishlist": 136 if (function_exists('wcmamtx_render_yith_wishlist_count_bubble_html')) { 137 if ( is_plugin_active( 'yith-woocommerce-wishlist/init.php' ) || is_plugin_active( 'yith-woocommerce-wishlist-premium/init.php' )) { 138 wcmamtx_render_yith_wishlist_count_bubble_html($count_bubble,$hide_empty,$sidebar); 139 } 140 141 } 142 break; 143 144 case "wpc_wishlist": 145 146 if ( is_plugin_active( 'woo-smart-wishlist/wpc-smart-wishlist.php' ) || is_plugin_active( 'woo-smart-wishlist-premium/wpc-smart-wishlist.php' )) { 147 148 if ( class_exists( 'WPCleverWoosw' ) ) { 149 wcmamtx_render_wpc_wishlist_count_bubble_html($count_bubble,$hide_empty,$sidebar); 150 } 151 } 152 break; 153 154 155 case "woodmart_wishlist": 156 157 if ( is_plugin_active( 'woodmart-core/woodmart-core.php' ) && function_exists('woodmart_get_wishlist_count')) { 158 159 $woodmart_wishlist_on = (array) get_option("xts-woodmart-options"); 160 161 $woodmart_wishlist_on = $woodmart_wishlist_on['wishlist']; 162 163 $woodmart_wishlist_on = isset($woodmart_wishlist_on) && ($woodmart_wishlist_on == 1) ? "yes" : "no"; 164 165 if ($woodmart_wishlist_on == "yes") { 166 wcmamtx_render_woodmart_wishlist_count_bubble_html($count_bubble,$hide_empty,$sidebar); 167 } 168 169 170 } 171 172 break; 173 174 175 case "none": 176 break; 177 178 } 160 if (($key != "orders") || ($key != "downloads") || ($key != "wishlist")) { 161 162 163 wcmamtx_countof_conditional_switch($count_of,$value,$sidebar); 164 179 165 180 166 } … … 191 177 } 192 178 179 } 180 181 182 if (!function_exists('wcmamtx_countof_conditional_switch')) { 183 184 function wcmamtx_countof_conditional_switch($count_of,$value,$sidebar = null) { 185 186 $count_bubble = isset($value['count_bubble']) && ($value['count_bubble'] == "01") ? "yes" : "no"; 187 188 189 $hide_empty = isset($value['hide_empty']) && ($value['hide_empty'] == "01") ? "yes" : "no"; 190 191 192 switch($count_of) { 193 194 case "order_count": 195 wcmamtx_render_order_count_bubble_html($count_bubble,$hide_empty,$sidebar); 196 break; 197 198 case "downloads_count": 199 wcmamtx_render_download_count_bubble_html($count_bubble,$hide_empty,$sidebar); 200 break; 201 202 case "cpt_count": 203 wcmamtx_render_cpt_count_bubble_html($count_bubble,$hide_empty,$value,$sidebar); 204 break; 205 206 case "yith_wishlist": 207 208 if (function_exists('wcmamtx_render_yith_wishlist_count_bubble_html')) { 209 if ( is_plugin_active( 'yith-woocommerce-wishlist/init.php' ) || is_plugin_active( 'yith-woocommerce-wishlist-premium/init.php' )) { 210 211 wcmamtx_render_yith_wishlist_count_bubble_html($count_bubble,$hide_empty,$sidebar); 212 } 213 214 } 215 break; 216 217 case "wpc_wishlist": 218 219 if ( is_plugin_active( 'woo-smart-wishlist/wpc-smart-wishlist.php' ) || is_plugin_active( 'woo-smart-wishlist-premium/wpc-smart-wishlist.php' )) { 220 221 if ( class_exists( 'WPCleverWoosw' ) ) { 222 wcmamtx_render_wpc_wishlist_count_bubble_html($count_bubble,$hide_empty,$sidebar); 223 } 224 } 225 break; 226 227 228 case "woodmart_wishlist": 229 230 if ( is_plugin_active( 'woodmart-core/woodmart-core.php' ) && function_exists('woodmart_get_wishlist_count')) { 231 232 $woodmart_wishlist_on = (array) get_option("xts-woodmart-options"); 233 234 $woodmart_wishlist_on = $woodmart_wishlist_on['wishlist']; 235 236 $woodmart_wishlist_on = isset($woodmart_wishlist_on) && ($woodmart_wishlist_on == 1) ? "yes" : "no"; 237 238 if ($woodmart_wishlist_on == "yes") { 239 wcmamtx_render_woodmart_wishlist_count_bubble_html($count_bubble,$hide_empty,$sidebar); 240 } 241 242 243 } 244 245 break; 246 247 248 case "none": 249 break; 250 251 } 252 253 do_action('wcmamtx_after_countof_wrapper'); 254 } 193 255 } 194 256 … … 228 290 229 291 292 if (!function_exists('wcmamtx_detect_wishlist_mode')) { 293 294 function wcmamtx_detect_wishlist_mode() { 295 296 $wishlist_mode = "none"; 297 298 299 if ( is_plugin_active( 'yith-woocommerce-wishlist/init.php' ) || is_plugin_active( 'yith-woocommerce-wishlist-premium/init.php' )) { 300 $wishlist_mode = "yith_wishlist"; 301 302 return $wishlist_mode; 303 } 304 305 306 if ( is_plugin_active( 'woo-smart-wishlist/wpc-smart-wishlist.php' ) || is_plugin_active( 'woo-smart-wishlist-premium/wpc-smart-wishlist.php' )) { 307 $wishlist_mode = "wpc_wishlist"; 308 309 return $wishlist_mode; 310 } 311 312 if ( is_plugin_active( 'woodmart-core/woodmart-core.php' ) && function_exists('woodmart_get_wishlist_count')) { 313 314 $woodmart_wishlist_on = (array) get_option("xts-woodmart-options"); 315 316 $woodmart_wishlist_on = $woodmart_wishlist_on['wishlist']; 317 318 $woodmart_wishlist_on = isset($woodmart_wishlist_on) && ($woodmart_wishlist_on == 1) ? "yes" : "no"; 319 320 if ($woodmart_wishlist_on == "yes") { 321 $wishlist_mode = "woodmart_wishlist"; 322 323 return $wishlist_mode; 324 } 325 326 327 } 328 329 return $wishlist_mode; 330 331 332 } 333 334 } 335 336 230 337 if (!function_exists('wcmamtx_get_total_wpswings_points_count')) { 231 338 … … 264 371 } 265 372 return $wallet_balance; 373 374 375 } 376 377 } 378 379 380 381 382 383 384 385 386 if (!function_exists('wcmamtx_get_user_post_type_count')) { 387 388 function wcmamtx_get_user_post_type_count($post_type,$status) { 389 390 $user_id = get_current_user_id(); 391 $args['author'] = $user_id; 392 $args['post_type'] = $post_type; 393 $args['post_status'] = $status; 394 $ps = get_posts($args); 395 return count($ps); 266 396 267 397 … … 279 409 */ 280 410 281 if (!function_exists('wcmamtx_ get_total_downloads_count')) {282 283 function wcmamtx_ get_total_downloads_count() {411 if (!function_exists('wcmamtx_render_cpt_count_bubble_html')) { 412 413 function wcmamtx_render_cpt_count_bubble_html($count_bubble,$hide_empty,$value,$sidebar = null) { 284 414 285 415 286 // Check if a user is logged in and WooCommerce is active 287 if ( ! is_user_logged_in() || ! function_exists( 'wc_get_customer_available_downloads' ) ) { 288 return 0; 289 } 290 291 $current_user_id = get_current_user_id(); 292 $available_downloads = wc_get_customer_available_downloads( $current_user_id ); 293 294 // Return the total count of unique downloadable files available 295 return count( $available_downloads ); 296 297 } 298 416 417 418 419 $custom_post_type = isset($value['count_post_type']) ? isset($value['count_post_type']) : ""; 420 421 $cpt_status = isset($value['cpt_status']) ? isset($value['cpt_status']) : "publish"; 422 423 424 425 $empty_goahead = 'yes'; 426 427 $get_count = wcmamtx_get_user_post_type_count($custom_post_type,$cpt_status); 428 429 if ($hide_empty == "yes") { 430 431 432 if ($get_count == 0) { 433 $empty_goahead = 'no'; 434 } else { 435 $empty_goahead = 'yes'; 436 } 437 438 } 439 440 if (($count_bubble == "yes") && ($custom_post_type != "") && ($empty_goahead == 'yes') && ($count_of == "post_type") && (is_numeric($get_count))) { 441 ?> 442 <span class="<?php if (isset($sidebar)) { echo 'wcmamtx-banner-counter-sidebar'; } else { echo 'wcmamtx-banner-counter';} ?> <?php if ($get_count == 0) { echo 'empty'; } ?>"> 443 <?php echo wcmamtx_get_user_post_type_count($custom_post_type,$cpt_status); ?> 444 </span> 445 <?php 446 } 447 448 449 } 450 451 } 452 453 454 455 456 457 if (!function_exists('wcmamtx_render_wpswings_points_count_bubble_html')) { 458 459 function wcmamtx_render_wpswings_points_count_bubble_html($count_bubble,$hide_empty,$sidebar = null) { 460 461 $empty_goahead = 'yes'; 462 463 $get_count = wcmamtx_get_total_wpswings_points_count(); 464 465 if ($hide_empty == "yes") { 466 467 468 if ($get_count == 0) { 469 $empty_goahead = 'no'; 470 } else { 471 $empty_goahead = 'yes'; 472 } 473 474 } 475 476 if (($count_bubble == "yes") && ($empty_goahead == 'yes')) { 477 ?> 478 <span class="<?php if (isset($sidebar)) { echo 'wcmamtx-banner-counter-sidebar'; } else { echo 'wcmamtx-banner-counter';} ?> <?php if ($get_count == 0) { echo 'empty'; } ?>"> 479 <?php echo wcmamtx_get_total_wpswings_points_count(); ?> 480 481 </span> 482 <?php 483 } 484 485 486 } 299 487 300 488 } … … 308 496 */ 309 497 310 if (!function_exists('wcmamtx_get_user_post_type_count')) { 311 312 function wcmamtx_get_user_post_type_count($post_type,$status) { 313 314 $user_id = get_current_user_id(); 315 $args['author'] = $user_id; 316 $args['post_type'] = $post_type; 317 $args['post_status'] = $status; 318 $ps = get_posts($args); 319 return count($ps); 320 321 322 } 323 324 } 325 326 327 /** 328 * Get account li html. 329 * 330 * @since 1.0.0 331 * @param string $endpoint Endpoint. 332 * @return string 333 */ 334 335 if (!function_exists('wcmamtx_render_cpt_count_bubble_html')) { 336 337 function wcmamtx_render_cpt_count_bubble_html($count_bubble,$hide_empty,$value,$sidebar = null) { 338 339 340 341 342 343 $custom_post_type = isset($value['count_post_type']) ? isset($value['count_post_type']) : ""; 344 345 $cpt_status = isset($value['cpt_status']) ? isset($value['cpt_status']) : "publish"; 346 347 498 if (!function_exists('wcmamtx_render_woo_wallet_count_bubble_html')) { 499 500 function wcmamtx_render_woo_wallet_count_bubble_html($count_bubble,$hide_empty,$sidebar = null) { 348 501 349 502 $empty_goahead = 'yes'; 350 503 351 $get_count = wcmamtx_get_ user_post_type_count($custom_post_type,$cpt_status);504 $get_count = wcmamtx_get_total_woowallet_count(); 352 505 353 506 if ($hide_empty == "yes") { 354 507 355 508 356 509 if ($get_count == 0) { … … 362 515 } 363 516 364 if (($count_bubble == "yes") && ($custom_post_type != "") && ($empty_goahead == 'yes') && ($count_of == "post_type") && (is_numeric($get_count))) {517 if (($count_bubble == "yes") && ($empty_goahead == 'yes')) { 365 518 ?> 366 <span class="<?php if (isset($sidebar)) { echo 'wcmamtx-banner-counter-sidebar'; } else { echo 'wcmamtx-banner-counter';} ?>"> 367 <?php echo wcmamtx_get_user_post_type_count($custom_post_type,$cpt_status); ?> 519 <span class="<?php if (isset($sidebar)) { echo 'wcmamtx-banner-counter-sidebar'; } else { echo 'wcmamtx-banner-counter';} ?> amount <?php if ($get_count == 0) { echo 'empty'; } ?>"> 520 <?php echo wc_price(wcmamtx_get_total_woowallet_count()); ?> 521 368 522 </span> 369 523 <?php … … 379 533 380 534 381 if (!function_exists('wcmamtx_render_wpswings_points_count_bubble_html')) { 382 383 function wcmamtx_render_wpswings_points_count_bubble_html($count_bubble,$hide_empty,$sidebar = null) { 535 536 537 if (!function_exists('wcmamtx_render_order_count_bubble_html')) { 538 539 function wcmamtx_render_order_count_bubble_html($count_bubble,$hide_empty,$sidebar = null) { 384 540 385 541 $empty_goahead = 'yes'; 386 542 543 $get_count = wcmamtx_get_total_orderid_count(); 544 387 545 if ($hide_empty == "yes") { 388 $get_count = wcmamtx_get_total_wpswings_points_count();546 389 547 390 548 if ($get_count == 0) { … … 398 556 if (($count_bubble == "yes") && ($empty_goahead == 'yes')) { 399 557 ?> 400 <span class="<?php if (isset($sidebar)) { echo 'wcmamtx-banner-counter-sidebar'; } else { echo 'wcmamtx-banner-counter';} ?> ">401 <?php echo wcmamtx_get_total_ wpswings_points_count(); ?>558 <span class="<?php if (isset($sidebar)) { echo 'wcmamtx-banner-counter-sidebar'; } else { echo 'wcmamtx-banner-counter';} ?> <?php if ($get_count == 0) { echo 'empty'; } ?>"> 559 <?php echo wcmamtx_get_total_orderid_count(); ?> 402 560 403 561 </span> … … 410 568 } 411 569 412 /** 413 * Get account li html. 414 * 415 * @since 1.0.0 416 * @param string $endpoint Endpoint. 417 * @return string 418 */ 419 420 if (!function_exists('wcmamtx_render_woo_wallet_count_bubble_html')) { 421 422 function wcmamtx_render_woo_wallet_count_bubble_html($count_bubble,$hide_empty,$sidebar = null) { 570 571 572 573 if (!function_exists('wcmamtx_render_download_count_bubble_html')) { 574 575 function wcmamtx_render_download_count_bubble_html($count_bubble,$hide_empty,$sidebar = null) { 423 576 424 577 $empty_goahead = 'yes'; 425 578 579 $get_count = wcmamtx_get_total_downloads_count(); 580 426 581 if ($hide_empty == "yes") { 427 $get_count = wcmamtx_get_total_woowallet_count();582 428 583 429 584 if ($get_count == 0) { … … 435 590 } 436 591 437 if (($count_bubble == "yes") && ($empty_goahead == 'yes')) {592 if (($count_bubble == "yes") && ($empty_goahead == 'yes')) { 438 593 ?> 439 <span class="<?php if (isset($sidebar)) { echo 'wcmamtx-banner-counter-sidebar'; } else { echo 'wcmamtx-banner-counter';} ?> amount">440 <?php echo wc _price(wcmamtx_get_total_woowallet_count()); ?>594 <span class="<?php if (isset($sidebar)) { echo 'wcmamtx-banner-counter-sidebar'; } else { echo 'wcmamtx-banner-counter';} ?> <?php if ($get_count == 0) { echo 'empty'; } ?>"> 595 <?php echo wcmamtx_get_total_downloads_count(); ?> 441 596 442 597 </span> … … 449 604 } 450 605 451 452 453 454 455 /** 456 * Get account li html. 457 * 458 * @since 1.0.0 459 * @param string $endpoint Endpoint. 460 * @return string 461 */ 462 463 if (!function_exists('wcmamtx_render_order_count_bubble_html')) { 464 465 function wcmamtx_render_order_count_bubble_html($count_bubble,$hide_empty,$sidebar = null) { 606 if (!function_exists('wcmamtx_get_total_downloads_count')) { 607 608 function wcmamtx_get_total_downloads_count() { 609 610 611 // Check if a user is logged in and WooCommerce is active 612 if ( ! is_user_logged_in() || ! function_exists( 'wc_get_customer_available_downloads' ) ) { 613 return 0; 614 } 615 616 $current_user_id = get_current_user_id(); 617 $available_downloads = wc_get_customer_available_downloads( $current_user_id ); 618 619 // Return the total count of unique downloadable files available 620 return count( $available_downloads ); 621 622 623 } 624 625 626 } 627 628 629 630 631 632 if (!function_exists('wcmamtx_render_yith_wishlist_count_bubble_html')) { 633 634 function wcmamtx_render_yith_wishlist_count_bubble_html($count_bubble,$hide_empty,$sidebar = null) { 466 635 467 636 $empty_goahead = 'yes'; 468 637 638 $get_count = wcmamtx_get_total_yith_wishlist_count(); 639 469 640 if ($hide_empty == "yes") { 470 $get_count = wcmamtx_get_total_orderid_count();641 471 642 472 643 if ($get_count == 0) { … … 478 649 } 479 650 651 652 480 653 if (($count_bubble == "yes") && ($empty_goahead == 'yes')) { 481 654 ?> 482 <span class="<?php if (isset($sidebar)) { echo 'wcmamtx-banner-counter-sidebar'; } else { echo 'wcmamtx-banner-counter';} ?> ">483 <?php echo wcmamtx_get_total_ orderid_count(); ?>655 <span class="<?php if (isset($sidebar)) { echo 'wcmamtx-banner-counter-sidebar'; } else { echo 'wcmamtx-banner-counter';} ?> wcmamtx_wishlist yith_wishlist <?php if ($get_count == 0) { echo 'empty'; } ?>"> 656 <?php echo wcmamtx_get_total_yith_wishlist_count(); ?> 484 657 485 658 </span> … … 492 665 } 493 666 494 495 /** 496 * Get account li html. 497 * 498 * @since 1.0.0 499 * @param string $endpoint Endpoint. 500 * @return string 501 */ 502 503 if (!function_exists('wcmamtx_render_download_count_bubble_html')) { 504 505 function wcmamtx_render_download_count_bubble_html($count_bubble,$hide_empty,$sidebar = null) { 667 if (!function_exists('wcmamtx_get_total_yith_wishlist_count')) { 668 669 function wcmamtx_get_total_yith_wishlist_count() { 670 671 $user_id = get_current_user_id(); 672 673 if ( is_plugin_active( 'yith-woocommerce-wishlist/init.php' ) || is_plugin_active( 'yith-woocommerce-wishlist-premium/init.php' )) { 674 675 $wishlist_count = YITH_WCWL_Wishlists()->count_items_in_wishlist( $user_id ); 676 677 678 return $wishlist_count; 679 } 680 681 682 683 } 684 685 } 686 687 688 if (!function_exists('wcmamtx_render_woodmart_wishlist_count_bubble_html')) { 689 690 function wcmamtx_render_woodmart_wishlist_count_bubble_html($count_bubble,$hide_empty,$sidebar = null) { 506 691 507 692 $empty_goahead = 'yes'; 508 693 694 $get_count = wcmamtx_get_total_woodmart_wishlist_count(); 695 509 696 if ($hide_empty == "yes") { 510 $get_count = wcmamtx_get_total_downloads_count();697 511 698 512 699 if ($get_count == 0) { … … 518 705 } 519 706 520 if (($count_bubble == "yes") && ($empty_goahead == 'yes')) {707 if (($count_bubble == "yes") && ($empty_goahead == 'yes')) { 521 708 ?> 522 <span class="<?php if (isset($sidebar)) { echo 'wcmamtx-banner-counter-sidebar'; } else { echo 'wcmamtx-banner-counter';} ?> ">523 <?php echo wcmamtx_get_total_ downloads_count(); ?>709 <span class="<?php if (isset($sidebar)) { echo 'wcmamtx-banner-counter-sidebar'; } else { echo 'wcmamtx-banner-counter';} ?> wcmamtx_wishlist woodmart_wishlist <?php if ($get_count == 0) { echo 'empty'; } ?>"> 710 <?php echo wcmamtx_get_total_woodmart_wishlist_count(); ?> 524 711 525 712 </span> … … 532 719 } 533 720 534 535 536 537 538 if (!function_exists('wcmamtx_render_yith_wishlist_count_bubble_html')) { 539 540 function wcmamtx_render_yith_wishlist_count_bubble_html($count_bubble,$hide_empty,$sidebar = null) { 721 if (!function_exists('wcmamtx_get_total_woodmart_wishlist_count')) { 722 723 function wcmamtx_get_total_woodmart_wishlist_count() { 724 725 $user_id = get_current_user_id(); 726 727 728 $woodmart_wishlist_on = (array) get_option("xts-woodmart-options"); 729 730 $woodmart_wishlist_on = $woodmart_wishlist_on['wishlist']; 731 732 $woodmart_wishlist_on = isset($woodmart_wishlist_on) && ($woodmart_wishlist_on == 1) ? "yes" : "no"; 733 734 if (($woodmart_wishlist_on == "yes") && function_exists('woodmart_get_wishlist_count')) { 735 736 737 $wishlist_count = woodmart_get_wishlist_count(); 738 739 return $wishlist_count; 740 } 741 742 743 744 } 745 746 } 747 748 if (!function_exists('wcmamtx_render_wpc_wishlist_count_bubble_html')) { 749 750 function wcmamtx_render_wpc_wishlist_count_bubble_html($count_bubble,$hide_empty,$sidebar = null) { 541 751 542 752 $empty_goahead = 'yes'; 543 753 754 $get_count = wcmamtx_get_total_wpc_wishlist_count(); 755 544 756 if ($hide_empty == "yes") { 545 $get_count = wcmamtx_get_total_yith_wishlist_count();757 546 758 547 759 if ($get_count == 0) { … … 555 767 if (($count_bubble == "yes") && ($empty_goahead == 'yes')) { 556 768 ?> 557 <span class="<?php if (isset($sidebar)) { echo 'wcmamtx-banner-counter-sidebar'; } else { echo 'wcmamtx-banner-counter';} ?> wcmamtx_wishlist ">558 <?php echo wcmamtx_get_total_ yith_wishlist_count(); ?>769 <span class="<?php if (isset($sidebar)) { echo 'wcmamtx-banner-counter-sidebar'; } else { echo 'wcmamtx-banner-counter';} ?> wcmamtx_wishlist wpc_wishlist <?php if ($get_count == 0) { echo 'empty'; } ?>"> 770 <?php echo wcmamtx_get_total_wpc_wishlist_count(); ?> 559 771 560 772 </span> … … 567 779 } 568 780 569 if (!function_exists('wcmamtx_get_total_ yith_wishlist_count')) {570 571 function wcmamtx_get_total_ yith_wishlist_count() {781 if (!function_exists('wcmamtx_get_total_wpc_wishlist_count')) { 782 783 function wcmamtx_get_total_wpc_wishlist_count() { 572 784 573 785 $user_id = get_current_user_id(); 574 786 575 if ( is_plugin_active( 'yith-woocommerce-wishlist/init.php' ) || is_plugin_active( 'yith-woocommerce-wishlist-premium/init.php' )) { 576 577 $wishlist_count = YITH_WCWL()->count_products( $user_id ); 578 579 return $wishlist_count; 787 788 $wishlist_count = 0; 789 790 if ( class_exists( 'WPCleverWoosw' ) ) { 791 792 $wishlist_count = esc_html( WPCleverWoosw::get_count() ); 793 580 794 } 581 795 796 797 return $wishlist_count; 798 799 582 800 583 801 … … 585 803 586 804 } 587 588 589 if (!function_exists('wcmamtx_render_woodmart_wishlist_count_bubble_html')) {590 591 function wcmamtx_render_woodmart_wishlist_count_bubble_html($count_bubble,$hide_empty,$sidebar = null) {592 593 $empty_goahead = 'yes';594 595 if ($hide_empty == "yes") {596 $get_count = wcmamtx_get_total_woodmart_wishlist_count();597 598 if ($get_count == 0) {599 $empty_goahead = 'no';600 } else {601 $empty_goahead = 'yes';602 }603 604 }605 606 if (($count_bubble == "yes") && ($empty_goahead == 'yes')) {607 ?>608 <span class="<?php if (isset($sidebar)) { echo 'wcmamtx-banner-counter-sidebar'; } else { echo 'wcmamtx-banner-counter';} ?> wcmamtx_wishlist">609 <?php echo wcmamtx_get_total_woodmart_wishlist_count(); ?>610 611 </span>612 <?php613 }614 615 616 }617 618 }619 620 if (!function_exists('wcmamtx_get_total_woodmart_wishlist_count')) {621 622 function wcmamtx_get_total_woodmart_wishlist_count() {623 624 $user_id = get_current_user_id();625 626 627 $woodmart_wishlist_on = (array) get_option("xts-woodmart-options");628 629 $woodmart_wishlist_on = $woodmart_wishlist_on['wishlist'];630 631 $woodmart_wishlist_on = isset($woodmart_wishlist_on) && ($woodmart_wishlist_on == 1) ? "yes" : "no";632 633 if (($woodmart_wishlist_on == "yes") && function_exists('woodmart_get_wishlist_count')) {634 635 636 $wishlist_count = woodmart_get_wishlist_count();637 638 return $wishlist_count;639 }640 641 642 643 }644 645 }646 647 if (!function_exists('wcmamtx_render_wpc_wishlist_count_bubble_html')) {648 649 function wcmamtx_render_wpc_wishlist_count_bubble_html($count_bubble,$hide_empty,$sidebar = null) {650 651 $empty_goahead = 'yes';652 653 if ($hide_empty == "yes") {654 $get_count = wcmamtx_get_total_wpc_wishlist_count();655 656 if ($get_count == 0) {657 $empty_goahead = 'no';658 } else {659 $empty_goahead = 'yes';660 }661 662 }663 664 if (($count_bubble == "yes") && ($empty_goahead == 'yes')) {665 ?>666 <span class="<?php if (isset($sidebar)) { echo 'wcmamtx-banner-counter-sidebar'; } else { echo 'wcmamtx-banner-counter';} ?> wcmamtx_wishlist">667 <?php echo wcmamtx_get_total_wpc_wishlist_count(); ?>668 669 </span>670 <?php671 }672 673 674 }675 676 }677 678 if (!function_exists('wcmamtx_get_total_wpc_wishlist_count')) {679 680 function wcmamtx_get_total_wpc_wishlist_count() {681 682 $user_id = get_current_user_id();683 684 685 $wishlist_count = 0;686 687 if ( class_exists( 'WPCleverWoosw' ) ) {688 689 $wishlist_count = esc_html( WPCleverWoosw::get_count() );690 691 }692 693 694 return $wishlist_count;695 696 697 698 699 }700 701 } -
customize-my-account-for-woocommerce/tags/3.8.1/readme.txt
r3465865 r3466081 7 7 WC Requires at least: 4.0 8 8 Requires PHP: 5.2 9 Stable tag: 3.8. 09 Stable tag: 3.8.1 10 10 Requires Plugins: woocommerce 11 11 License: GPLv2 or later -
customize-my-account-for-woocommerce/trunk/customize-my-account-for-woocommerce.php
r3465865 r3466081 4 4 Plugin URI: https://sysbasics.com 5 5 Description: Customize My account page. Add/Edit/Remove Endpoints. 6 Version: 3.8. 06 Version: 3.8.1 7 7 Author: SysBasics 8 8 Author URI: https://sysbasics.com -
customize-my-account-for-woocommerce/trunk/include/admin/wrap/endpoints-content.php
r3464708 r3466081 145 145 146 146 </tr> 147 <?php if (isset($third_party)) { ?>148 <tr>149 <td>150 <label class=" wcmamtx_accordion_label">151 <?php echo esc_html__('Content Before','customize-my-account-for-woocommerce'); ?>152 <?php echo $key; ?>153 <?php echo esc_html__('Content','customize-my-account-for-woocommerce'); ?>154 </label>155 </td>156 <td>157 <?php wcmamtx_show_disabled_toggle_image(); ?>158 159 </td>160 </tr>161 <tr>162 <td>163 <label class=" wcmamtx_accordion_label">164 <?php echo esc_html__('Content After','customize-my-account-for-woocommerce'); ?>165 <?php echo $key; ?>166 <?php echo esc_html__('Content','customize-my-account-for-woocommerce'); ?>167 </label>168 </td>169 <td>170 <?php wcmamtx_show_disabled_toggle_image(); ?>171 172 </td>173 </tr>174 <?php } ?>175 176 177 178 179 180 147 <tr> 181 148 <td> -
customize-my-account-for-woocommerce/trunk/include/admin/wrap/subwrap/countof-settings.php
r3465865 r3466081 74 74 $hide_sidebar = isset($value['hide_sidebar']) && ($value['hide_sidebar'] == "01") ? "yes" : "no"; 75 75 76 break; 77 78 case "wishlist": 79 $wishlist_mode = "none"; 80 81 $wishlist_mode = wcmamtx_detect_wishlist_mode(); 82 83 echo $wishlist_mode; 84 85 if ($wishlist_mode == "none") { 86 $count_bubble = isset($value['count_bubble']) && ($value['count_bubble'] == "01") ? "yes" : "no"; 87 } else { 88 89 if (is_array($value) ) { 90 91 if (!isset($value['count_bubble'])) { 92 $value['count_bubble'] = "01"; 93 } else { 94 $value['count_bubble'] = $value['count_bubble']; 95 } 96 97 } 98 99 $count_bubble = isset($value['count_bubble']) && ($value['count_bubble'] == "01") ? "yes" : "no"; 100 101 } 102 103 104 105 $hide_empty = isset($value['hide_empty']) && ($value['hide_empty'] == "01") ? "yes" : "no"; 106 107 $section_style = isset($value['count_bubble']) && ($value['count_bubble'] == "01") ? "display:block;" : "display:none;"; 108 109 110 111 $count_of = isset($value['count_of']) ? $value['count_of'] : $wishlist_mode; 112 113 114 115 116 117 $section_style_cpt = isset($count_of) && ($count_of == "cpt_count") ? "display:block;" : "display:none;"; 118 119 $section_style_usermeta = isset($count_of) && ($count_of == "usermeta_count") ? "display:block;" : "display:none;"; 120 121 122 $hide_sidebar = isset($value['hide_sidebar']) && ($value['hide_sidebar'] == "01") ? "yes" : "no"; 123 124 76 125 break; 77 126 -
customize-my-account-for-woocommerce/trunk/include/wcmamtx_countof_functions.php
r3465865 r3466081 11 11 12 12 $count_of = 'none'; 13 14 13 15 14 16 switch($key) { … … 38 40 break; 39 41 42 case "wishlist": 43 44 45 46 $wishlist_mode = "none"; 47 48 $wishlist_mode = wcmamtx_detect_wishlist_mode(); 49 50 51 52 if ($wishlist_mode == "none") { 53 $count_bubble = isset($value['count_bubble']) && ($value['count_bubble'] == "01") ? "yes" : "no"; 54 } else { 55 56 if (is_array($value) ) { 57 58 if (!isset($value['count_bubble'])) { 59 $value['count_bubble'] = "01"; 60 } else { 61 $value['count_bubble'] = $value['count_bubble']; 62 } 63 64 } 65 66 $count_bubble = isset($value['count_bubble']) && ($value['count_bubble'] == "01") ? "yes" : "no"; 67 68 } 69 70 $hide_empty = isset($value['hide_empty']) && ($value['hide_empty'] == "01") ? "yes" : "no"; 71 72 73 $count_of = isset($value['count_of']) ? $value['count_of'] : $wishlist_mode; 74 75 76 wcmamtx_countof_conditional_switch($count_of,$value,$sidebar); 77 78 79 80 81 break; 82 40 83 case "woo-wallet": 41 84 if (is_array($value) ) { … … 115 158 if (isset($count_of) && ($count_of != null)) { 116 159 117 if (($key != "orders") || ($key != "downloads")) { 118 119 120 121 switch($count_of) { 122 123 case "order_count": 124 wcmamtx_render_order_count_bubble_html($count_bubble,$hide_empty,$sidebar); 125 break; 126 127 case "downloads_count": 128 wcmamtx_render_download_count_bubble_html($count_bubble,$hide_empty,$sidebar); 129 break; 130 131 case "cpt_count": 132 wcmamtx_render_cpt_count_bubble_html($count_bubble,$hide_empty,$value,$sidebar); 133 break; 134 135 case "yith_wishlist": 136 if (function_exists('wcmamtx_render_yith_wishlist_count_bubble_html')) { 137 if ( is_plugin_active( 'yith-woocommerce-wishlist/init.php' ) || is_plugin_active( 'yith-woocommerce-wishlist-premium/init.php' )) { 138 wcmamtx_render_yith_wishlist_count_bubble_html($count_bubble,$hide_empty,$sidebar); 139 } 140 141 } 142 break; 143 144 case "wpc_wishlist": 145 146 if ( is_plugin_active( 'woo-smart-wishlist/wpc-smart-wishlist.php' ) || is_plugin_active( 'woo-smart-wishlist-premium/wpc-smart-wishlist.php' )) { 147 148 if ( class_exists( 'WPCleverWoosw' ) ) { 149 wcmamtx_render_wpc_wishlist_count_bubble_html($count_bubble,$hide_empty,$sidebar); 150 } 151 } 152 break; 153 154 155 case "woodmart_wishlist": 156 157 if ( is_plugin_active( 'woodmart-core/woodmart-core.php' ) && function_exists('woodmart_get_wishlist_count')) { 158 159 $woodmart_wishlist_on = (array) get_option("xts-woodmart-options"); 160 161 $woodmart_wishlist_on = $woodmart_wishlist_on['wishlist']; 162 163 $woodmart_wishlist_on = isset($woodmart_wishlist_on) && ($woodmart_wishlist_on == 1) ? "yes" : "no"; 164 165 if ($woodmart_wishlist_on == "yes") { 166 wcmamtx_render_woodmart_wishlist_count_bubble_html($count_bubble,$hide_empty,$sidebar); 167 } 168 169 170 } 171 172 break; 173 174 175 case "none": 176 break; 177 178 } 160 if (($key != "orders") || ($key != "downloads") || ($key != "wishlist")) { 161 162 163 wcmamtx_countof_conditional_switch($count_of,$value,$sidebar); 164 179 165 180 166 } … … 191 177 } 192 178 179 } 180 181 182 if (!function_exists('wcmamtx_countof_conditional_switch')) { 183 184 function wcmamtx_countof_conditional_switch($count_of,$value,$sidebar = null) { 185 186 $count_bubble = isset($value['count_bubble']) && ($value['count_bubble'] == "01") ? "yes" : "no"; 187 188 189 $hide_empty = isset($value['hide_empty']) && ($value['hide_empty'] == "01") ? "yes" : "no"; 190 191 192 switch($count_of) { 193 194 case "order_count": 195 wcmamtx_render_order_count_bubble_html($count_bubble,$hide_empty,$sidebar); 196 break; 197 198 case "downloads_count": 199 wcmamtx_render_download_count_bubble_html($count_bubble,$hide_empty,$sidebar); 200 break; 201 202 case "cpt_count": 203 wcmamtx_render_cpt_count_bubble_html($count_bubble,$hide_empty,$value,$sidebar); 204 break; 205 206 case "yith_wishlist": 207 208 if (function_exists('wcmamtx_render_yith_wishlist_count_bubble_html')) { 209 if ( is_plugin_active( 'yith-woocommerce-wishlist/init.php' ) || is_plugin_active( 'yith-woocommerce-wishlist-premium/init.php' )) { 210 211 wcmamtx_render_yith_wishlist_count_bubble_html($count_bubble,$hide_empty,$sidebar); 212 } 213 214 } 215 break; 216 217 case "wpc_wishlist": 218 219 if ( is_plugin_active( 'woo-smart-wishlist/wpc-smart-wishlist.php' ) || is_plugin_active( 'woo-smart-wishlist-premium/wpc-smart-wishlist.php' )) { 220 221 if ( class_exists( 'WPCleverWoosw' ) ) { 222 wcmamtx_render_wpc_wishlist_count_bubble_html($count_bubble,$hide_empty,$sidebar); 223 } 224 } 225 break; 226 227 228 case "woodmart_wishlist": 229 230 if ( is_plugin_active( 'woodmart-core/woodmart-core.php' ) && function_exists('woodmart_get_wishlist_count')) { 231 232 $woodmart_wishlist_on = (array) get_option("xts-woodmart-options"); 233 234 $woodmart_wishlist_on = $woodmart_wishlist_on['wishlist']; 235 236 $woodmart_wishlist_on = isset($woodmart_wishlist_on) && ($woodmart_wishlist_on == 1) ? "yes" : "no"; 237 238 if ($woodmart_wishlist_on == "yes") { 239 wcmamtx_render_woodmart_wishlist_count_bubble_html($count_bubble,$hide_empty,$sidebar); 240 } 241 242 243 } 244 245 break; 246 247 248 case "none": 249 break; 250 251 } 252 253 do_action('wcmamtx_after_countof_wrapper'); 254 } 193 255 } 194 256 … … 228 290 229 291 292 if (!function_exists('wcmamtx_detect_wishlist_mode')) { 293 294 function wcmamtx_detect_wishlist_mode() { 295 296 $wishlist_mode = "none"; 297 298 299 if ( is_plugin_active( 'yith-woocommerce-wishlist/init.php' ) || is_plugin_active( 'yith-woocommerce-wishlist-premium/init.php' )) { 300 $wishlist_mode = "yith_wishlist"; 301 302 return $wishlist_mode; 303 } 304 305 306 if ( is_plugin_active( 'woo-smart-wishlist/wpc-smart-wishlist.php' ) || is_plugin_active( 'woo-smart-wishlist-premium/wpc-smart-wishlist.php' )) { 307 $wishlist_mode = "wpc_wishlist"; 308 309 return $wishlist_mode; 310 } 311 312 if ( is_plugin_active( 'woodmart-core/woodmart-core.php' ) && function_exists('woodmart_get_wishlist_count')) { 313 314 $woodmart_wishlist_on = (array) get_option("xts-woodmart-options"); 315 316 $woodmart_wishlist_on = $woodmart_wishlist_on['wishlist']; 317 318 $woodmart_wishlist_on = isset($woodmart_wishlist_on) && ($woodmart_wishlist_on == 1) ? "yes" : "no"; 319 320 if ($woodmart_wishlist_on == "yes") { 321 $wishlist_mode = "woodmart_wishlist"; 322 323 return $wishlist_mode; 324 } 325 326 327 } 328 329 return $wishlist_mode; 330 331 332 } 333 334 } 335 336 230 337 if (!function_exists('wcmamtx_get_total_wpswings_points_count')) { 231 338 … … 264 371 } 265 372 return $wallet_balance; 373 374 375 } 376 377 } 378 379 380 381 382 383 384 385 386 if (!function_exists('wcmamtx_get_user_post_type_count')) { 387 388 function wcmamtx_get_user_post_type_count($post_type,$status) { 389 390 $user_id = get_current_user_id(); 391 $args['author'] = $user_id; 392 $args['post_type'] = $post_type; 393 $args['post_status'] = $status; 394 $ps = get_posts($args); 395 return count($ps); 266 396 267 397 … … 279 409 */ 280 410 281 if (!function_exists('wcmamtx_ get_total_downloads_count')) {282 283 function wcmamtx_ get_total_downloads_count() {411 if (!function_exists('wcmamtx_render_cpt_count_bubble_html')) { 412 413 function wcmamtx_render_cpt_count_bubble_html($count_bubble,$hide_empty,$value,$sidebar = null) { 284 414 285 415 286 // Check if a user is logged in and WooCommerce is active 287 if ( ! is_user_logged_in() || ! function_exists( 'wc_get_customer_available_downloads' ) ) { 288 return 0; 289 } 290 291 $current_user_id = get_current_user_id(); 292 $available_downloads = wc_get_customer_available_downloads( $current_user_id ); 293 294 // Return the total count of unique downloadable files available 295 return count( $available_downloads ); 296 297 } 298 416 417 418 419 $custom_post_type = isset($value['count_post_type']) ? isset($value['count_post_type']) : ""; 420 421 $cpt_status = isset($value['cpt_status']) ? isset($value['cpt_status']) : "publish"; 422 423 424 425 $empty_goahead = 'yes'; 426 427 $get_count = wcmamtx_get_user_post_type_count($custom_post_type,$cpt_status); 428 429 if ($hide_empty == "yes") { 430 431 432 if ($get_count == 0) { 433 $empty_goahead = 'no'; 434 } else { 435 $empty_goahead = 'yes'; 436 } 437 438 } 439 440 if (($count_bubble == "yes") && ($custom_post_type != "") && ($empty_goahead == 'yes') && ($count_of == "post_type") && (is_numeric($get_count))) { 441 ?> 442 <span class="<?php if (isset($sidebar)) { echo 'wcmamtx-banner-counter-sidebar'; } else { echo 'wcmamtx-banner-counter';} ?> <?php if ($get_count == 0) { echo 'empty'; } ?>"> 443 <?php echo wcmamtx_get_user_post_type_count($custom_post_type,$cpt_status); ?> 444 </span> 445 <?php 446 } 447 448 449 } 450 451 } 452 453 454 455 456 457 if (!function_exists('wcmamtx_render_wpswings_points_count_bubble_html')) { 458 459 function wcmamtx_render_wpswings_points_count_bubble_html($count_bubble,$hide_empty,$sidebar = null) { 460 461 $empty_goahead = 'yes'; 462 463 $get_count = wcmamtx_get_total_wpswings_points_count(); 464 465 if ($hide_empty == "yes") { 466 467 468 if ($get_count == 0) { 469 $empty_goahead = 'no'; 470 } else { 471 $empty_goahead = 'yes'; 472 } 473 474 } 475 476 if (($count_bubble == "yes") && ($empty_goahead == 'yes')) { 477 ?> 478 <span class="<?php if (isset($sidebar)) { echo 'wcmamtx-banner-counter-sidebar'; } else { echo 'wcmamtx-banner-counter';} ?> <?php if ($get_count == 0) { echo 'empty'; } ?>"> 479 <?php echo wcmamtx_get_total_wpswings_points_count(); ?> 480 481 </span> 482 <?php 483 } 484 485 486 } 299 487 300 488 } … … 308 496 */ 309 497 310 if (!function_exists('wcmamtx_get_user_post_type_count')) { 311 312 function wcmamtx_get_user_post_type_count($post_type,$status) { 313 314 $user_id = get_current_user_id(); 315 $args['author'] = $user_id; 316 $args['post_type'] = $post_type; 317 $args['post_status'] = $status; 318 $ps = get_posts($args); 319 return count($ps); 320 321 322 } 323 324 } 325 326 327 /** 328 * Get account li html. 329 * 330 * @since 1.0.0 331 * @param string $endpoint Endpoint. 332 * @return string 333 */ 334 335 if (!function_exists('wcmamtx_render_cpt_count_bubble_html')) { 336 337 function wcmamtx_render_cpt_count_bubble_html($count_bubble,$hide_empty,$value,$sidebar = null) { 338 339 340 341 342 343 $custom_post_type = isset($value['count_post_type']) ? isset($value['count_post_type']) : ""; 344 345 $cpt_status = isset($value['cpt_status']) ? isset($value['cpt_status']) : "publish"; 346 347 498 if (!function_exists('wcmamtx_render_woo_wallet_count_bubble_html')) { 499 500 function wcmamtx_render_woo_wallet_count_bubble_html($count_bubble,$hide_empty,$sidebar = null) { 348 501 349 502 $empty_goahead = 'yes'; 350 503 351 $get_count = wcmamtx_get_ user_post_type_count($custom_post_type,$cpt_status);504 $get_count = wcmamtx_get_total_woowallet_count(); 352 505 353 506 if ($hide_empty == "yes") { 354 507 355 508 356 509 if ($get_count == 0) { … … 362 515 } 363 516 364 if (($count_bubble == "yes") && ($custom_post_type != "") && ($empty_goahead == 'yes') && ($count_of == "post_type") && (is_numeric($get_count))) {517 if (($count_bubble == "yes") && ($empty_goahead == 'yes')) { 365 518 ?> 366 <span class="<?php if (isset($sidebar)) { echo 'wcmamtx-banner-counter-sidebar'; } else { echo 'wcmamtx-banner-counter';} ?>"> 367 <?php echo wcmamtx_get_user_post_type_count($custom_post_type,$cpt_status); ?> 519 <span class="<?php if (isset($sidebar)) { echo 'wcmamtx-banner-counter-sidebar'; } else { echo 'wcmamtx-banner-counter';} ?> amount <?php if ($get_count == 0) { echo 'empty'; } ?>"> 520 <?php echo wc_price(wcmamtx_get_total_woowallet_count()); ?> 521 368 522 </span> 369 523 <?php … … 379 533 380 534 381 if (!function_exists('wcmamtx_render_wpswings_points_count_bubble_html')) { 382 383 function wcmamtx_render_wpswings_points_count_bubble_html($count_bubble,$hide_empty,$sidebar = null) { 535 536 537 if (!function_exists('wcmamtx_render_order_count_bubble_html')) { 538 539 function wcmamtx_render_order_count_bubble_html($count_bubble,$hide_empty,$sidebar = null) { 384 540 385 541 $empty_goahead = 'yes'; 386 542 543 $get_count = wcmamtx_get_total_orderid_count(); 544 387 545 if ($hide_empty == "yes") { 388 $get_count = wcmamtx_get_total_wpswings_points_count();546 389 547 390 548 if ($get_count == 0) { … … 398 556 if (($count_bubble == "yes") && ($empty_goahead == 'yes')) { 399 557 ?> 400 <span class="<?php if (isset($sidebar)) { echo 'wcmamtx-banner-counter-sidebar'; } else { echo 'wcmamtx-banner-counter';} ?> ">401 <?php echo wcmamtx_get_total_ wpswings_points_count(); ?>558 <span class="<?php if (isset($sidebar)) { echo 'wcmamtx-banner-counter-sidebar'; } else { echo 'wcmamtx-banner-counter';} ?> <?php if ($get_count == 0) { echo 'empty'; } ?>"> 559 <?php echo wcmamtx_get_total_orderid_count(); ?> 402 560 403 561 </span> … … 410 568 } 411 569 412 /** 413 * Get account li html. 414 * 415 * @since 1.0.0 416 * @param string $endpoint Endpoint. 417 * @return string 418 */ 419 420 if (!function_exists('wcmamtx_render_woo_wallet_count_bubble_html')) { 421 422 function wcmamtx_render_woo_wallet_count_bubble_html($count_bubble,$hide_empty,$sidebar = null) { 570 571 572 573 if (!function_exists('wcmamtx_render_download_count_bubble_html')) { 574 575 function wcmamtx_render_download_count_bubble_html($count_bubble,$hide_empty,$sidebar = null) { 423 576 424 577 $empty_goahead = 'yes'; 425 578 579 $get_count = wcmamtx_get_total_downloads_count(); 580 426 581 if ($hide_empty == "yes") { 427 $get_count = wcmamtx_get_total_woowallet_count();582 428 583 429 584 if ($get_count == 0) { … … 435 590 } 436 591 437 if (($count_bubble == "yes") && ($empty_goahead == 'yes')) {592 if (($count_bubble == "yes") && ($empty_goahead == 'yes')) { 438 593 ?> 439 <span class="<?php if (isset($sidebar)) { echo 'wcmamtx-banner-counter-sidebar'; } else { echo 'wcmamtx-banner-counter';} ?> amount">440 <?php echo wc _price(wcmamtx_get_total_woowallet_count()); ?>594 <span class="<?php if (isset($sidebar)) { echo 'wcmamtx-banner-counter-sidebar'; } else { echo 'wcmamtx-banner-counter';} ?> <?php if ($get_count == 0) { echo 'empty'; } ?>"> 595 <?php echo wcmamtx_get_total_downloads_count(); ?> 441 596 442 597 </span> … … 449 604 } 450 605 451 452 453 454 455 /** 456 * Get account li html. 457 * 458 * @since 1.0.0 459 * @param string $endpoint Endpoint. 460 * @return string 461 */ 462 463 if (!function_exists('wcmamtx_render_order_count_bubble_html')) { 464 465 function wcmamtx_render_order_count_bubble_html($count_bubble,$hide_empty,$sidebar = null) { 606 if (!function_exists('wcmamtx_get_total_downloads_count')) { 607 608 function wcmamtx_get_total_downloads_count() { 609 610 611 // Check if a user is logged in and WooCommerce is active 612 if ( ! is_user_logged_in() || ! function_exists( 'wc_get_customer_available_downloads' ) ) { 613 return 0; 614 } 615 616 $current_user_id = get_current_user_id(); 617 $available_downloads = wc_get_customer_available_downloads( $current_user_id ); 618 619 // Return the total count of unique downloadable files available 620 return count( $available_downloads ); 621 622 623 } 624 625 626 } 627 628 629 630 631 632 if (!function_exists('wcmamtx_render_yith_wishlist_count_bubble_html')) { 633 634 function wcmamtx_render_yith_wishlist_count_bubble_html($count_bubble,$hide_empty,$sidebar = null) { 466 635 467 636 $empty_goahead = 'yes'; 468 637 638 $get_count = wcmamtx_get_total_yith_wishlist_count(); 639 469 640 if ($hide_empty == "yes") { 470 $get_count = wcmamtx_get_total_orderid_count();641 471 642 472 643 if ($get_count == 0) { … … 478 649 } 479 650 651 652 480 653 if (($count_bubble == "yes") && ($empty_goahead == 'yes')) { 481 654 ?> 482 <span class="<?php if (isset($sidebar)) { echo 'wcmamtx-banner-counter-sidebar'; } else { echo 'wcmamtx-banner-counter';} ?> ">483 <?php echo wcmamtx_get_total_ orderid_count(); ?>655 <span class="<?php if (isset($sidebar)) { echo 'wcmamtx-banner-counter-sidebar'; } else { echo 'wcmamtx-banner-counter';} ?> wcmamtx_wishlist yith_wishlist <?php if ($get_count == 0) { echo 'empty'; } ?>"> 656 <?php echo wcmamtx_get_total_yith_wishlist_count(); ?> 484 657 485 658 </span> … … 492 665 } 493 666 494 495 /** 496 * Get account li html. 497 * 498 * @since 1.0.0 499 * @param string $endpoint Endpoint. 500 * @return string 501 */ 502 503 if (!function_exists('wcmamtx_render_download_count_bubble_html')) { 504 505 function wcmamtx_render_download_count_bubble_html($count_bubble,$hide_empty,$sidebar = null) { 667 if (!function_exists('wcmamtx_get_total_yith_wishlist_count')) { 668 669 function wcmamtx_get_total_yith_wishlist_count() { 670 671 $user_id = get_current_user_id(); 672 673 if ( is_plugin_active( 'yith-woocommerce-wishlist/init.php' ) || is_plugin_active( 'yith-woocommerce-wishlist-premium/init.php' )) { 674 675 $wishlist_count = YITH_WCWL_Wishlists()->count_items_in_wishlist( $user_id ); 676 677 678 return $wishlist_count; 679 } 680 681 682 683 } 684 685 } 686 687 688 if (!function_exists('wcmamtx_render_woodmart_wishlist_count_bubble_html')) { 689 690 function wcmamtx_render_woodmart_wishlist_count_bubble_html($count_bubble,$hide_empty,$sidebar = null) { 506 691 507 692 $empty_goahead = 'yes'; 508 693 694 $get_count = wcmamtx_get_total_woodmart_wishlist_count(); 695 509 696 if ($hide_empty == "yes") { 510 $get_count = wcmamtx_get_total_downloads_count();697 511 698 512 699 if ($get_count == 0) { … … 518 705 } 519 706 520 if (($count_bubble == "yes") && ($empty_goahead == 'yes')) {707 if (($count_bubble == "yes") && ($empty_goahead == 'yes')) { 521 708 ?> 522 <span class="<?php if (isset($sidebar)) { echo 'wcmamtx-banner-counter-sidebar'; } else { echo 'wcmamtx-banner-counter';} ?> ">523 <?php echo wcmamtx_get_total_ downloads_count(); ?>709 <span class="<?php if (isset($sidebar)) { echo 'wcmamtx-banner-counter-sidebar'; } else { echo 'wcmamtx-banner-counter';} ?> wcmamtx_wishlist woodmart_wishlist <?php if ($get_count == 0) { echo 'empty'; } ?>"> 710 <?php echo wcmamtx_get_total_woodmart_wishlist_count(); ?> 524 711 525 712 </span> … … 532 719 } 533 720 534 535 536 537 538 if (!function_exists('wcmamtx_render_yith_wishlist_count_bubble_html')) { 539 540 function wcmamtx_render_yith_wishlist_count_bubble_html($count_bubble,$hide_empty,$sidebar = null) { 721 if (!function_exists('wcmamtx_get_total_woodmart_wishlist_count')) { 722 723 function wcmamtx_get_total_woodmart_wishlist_count() { 724 725 $user_id = get_current_user_id(); 726 727 728 $woodmart_wishlist_on = (array) get_option("xts-woodmart-options"); 729 730 $woodmart_wishlist_on = $woodmart_wishlist_on['wishlist']; 731 732 $woodmart_wishlist_on = isset($woodmart_wishlist_on) && ($woodmart_wishlist_on == 1) ? "yes" : "no"; 733 734 if (($woodmart_wishlist_on == "yes") && function_exists('woodmart_get_wishlist_count')) { 735 736 737 $wishlist_count = woodmart_get_wishlist_count(); 738 739 return $wishlist_count; 740 } 741 742 743 744 } 745 746 } 747 748 if (!function_exists('wcmamtx_render_wpc_wishlist_count_bubble_html')) { 749 750 function wcmamtx_render_wpc_wishlist_count_bubble_html($count_bubble,$hide_empty,$sidebar = null) { 541 751 542 752 $empty_goahead = 'yes'; 543 753 754 $get_count = wcmamtx_get_total_wpc_wishlist_count(); 755 544 756 if ($hide_empty == "yes") { 545 $get_count = wcmamtx_get_total_yith_wishlist_count();757 546 758 547 759 if ($get_count == 0) { … … 555 767 if (($count_bubble == "yes") && ($empty_goahead == 'yes')) { 556 768 ?> 557 <span class="<?php if (isset($sidebar)) { echo 'wcmamtx-banner-counter-sidebar'; } else { echo 'wcmamtx-banner-counter';} ?> wcmamtx_wishlist ">558 <?php echo wcmamtx_get_total_ yith_wishlist_count(); ?>769 <span class="<?php if (isset($sidebar)) { echo 'wcmamtx-banner-counter-sidebar'; } else { echo 'wcmamtx-banner-counter';} ?> wcmamtx_wishlist wpc_wishlist <?php if ($get_count == 0) { echo 'empty'; } ?>"> 770 <?php echo wcmamtx_get_total_wpc_wishlist_count(); ?> 559 771 560 772 </span> … … 567 779 } 568 780 569 if (!function_exists('wcmamtx_get_total_ yith_wishlist_count')) {570 571 function wcmamtx_get_total_ yith_wishlist_count() {781 if (!function_exists('wcmamtx_get_total_wpc_wishlist_count')) { 782 783 function wcmamtx_get_total_wpc_wishlist_count() { 572 784 573 785 $user_id = get_current_user_id(); 574 786 575 if ( is_plugin_active( 'yith-woocommerce-wishlist/init.php' ) || is_plugin_active( 'yith-woocommerce-wishlist-premium/init.php' )) { 576 577 $wishlist_count = YITH_WCWL()->count_products( $user_id ); 578 579 return $wishlist_count; 787 788 $wishlist_count = 0; 789 790 if ( class_exists( 'WPCleverWoosw' ) ) { 791 792 $wishlist_count = esc_html( WPCleverWoosw::get_count() ); 793 580 794 } 581 795 796 797 return $wishlist_count; 798 799 582 800 583 801 … … 585 803 586 804 } 587 588 589 if (!function_exists('wcmamtx_render_woodmart_wishlist_count_bubble_html')) {590 591 function wcmamtx_render_woodmart_wishlist_count_bubble_html($count_bubble,$hide_empty,$sidebar = null) {592 593 $empty_goahead = 'yes';594 595 if ($hide_empty == "yes") {596 $get_count = wcmamtx_get_total_woodmart_wishlist_count();597 598 if ($get_count == 0) {599 $empty_goahead = 'no';600 } else {601 $empty_goahead = 'yes';602 }603 604 }605 606 if (($count_bubble == "yes") && ($empty_goahead == 'yes')) {607 ?>608 <span class="<?php if (isset($sidebar)) { echo 'wcmamtx-banner-counter-sidebar'; } else { echo 'wcmamtx-banner-counter';} ?> wcmamtx_wishlist">609 <?php echo wcmamtx_get_total_woodmart_wishlist_count(); ?>610 611 </span>612 <?php613 }614 615 616 }617 618 }619 620 if (!function_exists('wcmamtx_get_total_woodmart_wishlist_count')) {621 622 function wcmamtx_get_total_woodmart_wishlist_count() {623 624 $user_id = get_current_user_id();625 626 627 $woodmart_wishlist_on = (array) get_option("xts-woodmart-options");628 629 $woodmart_wishlist_on = $woodmart_wishlist_on['wishlist'];630 631 $woodmart_wishlist_on = isset($woodmart_wishlist_on) && ($woodmart_wishlist_on == 1) ? "yes" : "no";632 633 if (($woodmart_wishlist_on == "yes") && function_exists('woodmart_get_wishlist_count')) {634 635 636 $wishlist_count = woodmart_get_wishlist_count();637 638 return $wishlist_count;639 }640 641 642 643 }644 645 }646 647 if (!function_exists('wcmamtx_render_wpc_wishlist_count_bubble_html')) {648 649 function wcmamtx_render_wpc_wishlist_count_bubble_html($count_bubble,$hide_empty,$sidebar = null) {650 651 $empty_goahead = 'yes';652 653 if ($hide_empty == "yes") {654 $get_count = wcmamtx_get_total_wpc_wishlist_count();655 656 if ($get_count == 0) {657 $empty_goahead = 'no';658 } else {659 $empty_goahead = 'yes';660 }661 662 }663 664 if (($count_bubble == "yes") && ($empty_goahead == 'yes')) {665 ?>666 <span class="<?php if (isset($sidebar)) { echo 'wcmamtx-banner-counter-sidebar'; } else { echo 'wcmamtx-banner-counter';} ?> wcmamtx_wishlist">667 <?php echo wcmamtx_get_total_wpc_wishlist_count(); ?>668 669 </span>670 <?php671 }672 673 674 }675 676 }677 678 if (!function_exists('wcmamtx_get_total_wpc_wishlist_count')) {679 680 function wcmamtx_get_total_wpc_wishlist_count() {681 682 $user_id = get_current_user_id();683 684 685 $wishlist_count = 0;686 687 if ( class_exists( 'WPCleverWoosw' ) ) {688 689 $wishlist_count = esc_html( WPCleverWoosw::get_count() );690 691 }692 693 694 return $wishlist_count;695 696 697 698 699 }700 701 } -
customize-my-account-for-woocommerce/trunk/readme.txt
r3465865 r3466081 7 7 WC Requires at least: 4.0 8 8 Requires PHP: 5.2 9 Stable tag: 3.8. 09 Stable tag: 3.8.1 10 10 Requires Plugins: woocommerce 11 11 License: GPLv2 or later
Note: See TracChangeset
for help on using the changeset viewer.