admin
6 years ago
add-to-wishlist-added.php
5 years ago
add-to-wishlist-browse.php
5 years ago
add-to-wishlist-button.php
5 years ago
add-to-wishlist-remove.php
5 years ago
add-to-wishlist.php
5 years ago
share.php
5 years ago
wishlist-view-footer-mobile.php
6 years ago
wishlist-view-footer.php
6 years ago
wishlist-view-header.php
5 years ago
wishlist-view-mobile.php
6 years ago
wishlist-view.php
6 years ago
wishlist.php
6 years ago
wishlist-view-footer.php
125 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Wishlist footer |
| 4 | * |
| 5 | * @author Your Inspiration Themes |
| 6 | * @package YITH WooCommerce Wishlist |
| 7 | * @version 3.0.0 |
| 8 | */ |
| 9 | |
| 10 | /** |
| 11 | * Template variables: |
| 12 | * |
| 13 | * @var $wishlist \YITH_WCWL_Wishlist |
| 14 | * @var $wishlist_token string Current wishlist token |
| 15 | * @var $show_cb bool Whether to show checkbox column |
| 16 | * @var $show_update bool Whether to show update button or not |
| 17 | * @var $is_user_owner bool Whether current user is wishlist owner |
| 18 | * @var $is_private bool Whether current wishlist is private |
| 19 | * @var $share_enabled bool Whether share buttons should appear |
| 20 | * @var $share_atts array Array of options; shows which share links should be shown |
| 21 | * @var $show_ask_estimate_button bool Whether to show Ask an Estimate form |
| 22 | * @var $ask_estimate_url string Ask an estimate destination url |
| 23 | * @var $ask_an_estimate_icon string Ask an estimate button icon |
| 24 | * @var $ask_an_estimate_text string Ask an estimate button text |
| 25 | * @var $ask_an_estimate_classes string Classes to use for Ask for an estimate button |
| 26 | * @var $additional_info bool Whether to show Additional info textarea in Ask an estimate form |
| 27 | * @var $enable_add_all_to_cart bool Whether to show "Add all to Cart" button |
| 28 | * @var $move_to_another_wishlist bool Whether to show Move to another wishlist select |
| 29 | * @var $move_to_another_wishlist_type string Whether to show a select or a popup for wishlist change |
| 30 | * @var $available_multi_wishlist bool Whether multi wishlist is enabled and available |
| 31 | * @var $users_wishlists array Array of current user wishlists |
| 32 | */ |
| 33 | |
| 34 | if ( ! defined( 'YITH_WCWL' ) ) { |
| 35 | exit; |
| 36 | } // Exit if accessed directly |
| 37 | ?> |
| 38 | <div class="yith_wcwl_wishlist_footer"> |
| 39 | <?php if ( $count && $show_cb ) : ?> |
| 40 | <!-- Bulk actions form --> |
| 41 | <div class="yith_wcwl_wishlist_bulk_action"> |
| 42 | <label for="bulk_actions"><?php echo esc_html( apply_filters( 'yith_wcwl_wishlist_bulk_actions_label', __( 'Apply this action to all the selected items:', 'yith-woocommerce-wishlist' ) ) ); ?></label> |
| 43 | <select name="bulk_actions" id="bulk_actions"> |
| 44 | <option value="add_to_cart"><?php esc_html_e( 'Add to cart', 'yith-woocommerce-wishlist' ); ?></option> |
| 45 | |
| 46 | <?php if ( $wishlist->current_user_can( 'remove_from_wishlist' ) ) : ?> |
| 47 | <option value="delete"><?php esc_html_e( 'Remove from wishlist', 'yith-woocommerce-wishlist' ); ?></option> |
| 48 | <?php endif; ?> |
| 49 | |
| 50 | <?php if ( $available_multi_wishlist && count( $users_wishlists ) > 1 && $is_user_owner ) : ?> |
| 51 | <?php |
| 52 | foreach ( $users_wishlists as $wl ) : |
| 53 | /** |
| 54 | * @var $wl \YITH_WCWL_Wishlist |
| 55 | */ |
| 56 | if ( $wl->get_token() == $wishlist_token ) { |
| 57 | continue; |
| 58 | } |
| 59 | ?> |
| 60 | <option value="<?php echo esc_attr( $wl->get_token() ); ?>"> |
| 61 | <?php |
| 62 | // translators: 1. Wishlist formatted name. |
| 63 | echo esc_html( sprintf( __( 'Move to %s', 'yith-woocommerce-wishlist' ), $wl->get_formatted_name() ) ); |
| 64 | ?> |
| 65 | </option> |
| 66 | <?php endforeach; ?> |
| 67 | <?php endif; ?> |
| 68 | </select> |
| 69 | <input type="submit" name="apply_bulk_actions" value="<?php esc_html_e( 'Apply', 'yith-woocommerce-wishlist' ); ?>"/> |
| 70 | </div> |
| 71 | <?php endif; ?> |
| 72 | |
| 73 | |
| 74 | <?php if ( $count && $show_update ) : ?> |
| 75 | <!-- Update wishlist button --> |
| 76 | <div class="yith_wcwl_wishlist_update"> |
| 77 | <input type="submit" name="update_wishlist" value="<?php esc_html_e( 'Update', 'yith-woocommerce-wishlist' ); ?>"/> |
| 78 | </div> |
| 79 | <?php endif; ?> |
| 80 | |
| 81 | |
| 82 | <?php if ( $count && $share_enabled ) : ?> |
| 83 | <!-- Sharing section --> |
| 84 | <?php yith_wcwl_get_template( 'share.php', array_merge( $share_atts, array( 'wishlist' => $wishlist ) ) ); ?> |
| 85 | <?php endif; ?> |
| 86 | |
| 87 | <?php if ( $count && ( $show_ask_estimate_button || $enable_add_all_to_cart ) ) : ?> |
| 88 | <div class="yith_wcwl_footer_additional_action"> |
| 89 | <?php if ( $count && $show_ask_estimate_button ) : ?> |
| 90 | <!-- Ask an estimate button --> |
| 91 | <a href="<?php echo ( $additional_info || ! is_user_logged_in() ) ? '#ask_an_estimate_popup' : esc_url( $ask_estimate_url ); ?>" class="<?php echo esc_attr( $ask_an_estimate_classes ); ?> ask-an-estimate-button" <?php echo ( $additional_info || ! is_user_logged_in() ) ? 'data-rel="prettyPhoto[ask_an_estimate]"' : ''; ?> > |
| 92 | <?php echo apply_filters( 'yith_wcwl_ask_an_estimate_icon', $ask_an_estimate_icon ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?> |
| 93 | <?php echo esc_html( apply_filters( 'yith_wcwl_ask_an_estimate_text', $ask_an_estimate_text ) ); ?> |
| 94 | </a> |
| 95 | <?php endif; ?> |
| 96 | |
| 97 | <?php if ( $count && $enable_add_all_to_cart ) : ?> |
| 98 | <!-- Add all to cart button --> |
| 99 | <input type="submit" name="add_all_to_cart" value="<?php esc_html_e( 'Add all to cart', 'yith-woocommerce-wishlist' ); ?>"/> |
| 100 | <?php endif; ?> |
| 101 | </div> |
| 102 | <?php endif; ?> |
| 103 | </div> |
| 104 | |
| 105 | <?php wp_nonce_field( 'yith_wcwl_edit_wishlist_action', 'yith_wcwl_edit_wishlist' ); ?> |
| 106 | <input type="hidden" value="<?php echo esc_attr( $wishlist_token ); ?>" name="wishlist_id" id="wishlist_id"> |
| 107 | |
| 108 | <?php do_action( 'yith_wcwl_after_wishlist', $wishlist ); ?> |
| 109 | |
| 110 | </form> |
| 111 | |
| 112 | <?php do_action( 'yith_wcwl_after_wishlist_form', $wishlist ); ?> |
| 113 | |
| 114 | <?php |
| 115 | if ( apply_filters( 'yith_wcwl_ask_an_estimate_conditions', $wishlist && $show_ask_estimate_button && ( ! is_user_logged_in() || $additional_info ) ) ) { |
| 116 | yith_wcwl_get_template( 'wishlist-popup-ask-an-estimate.php', $var ); |
| 117 | } |
| 118 | ?> |
| 119 | |
| 120 | <?php |
| 121 | if ( apply_filters( 'yith_wcwl_move_to_another_wishlist_popup_conditions', $wishlist && $move_to_another_wishlist && 'popup' == $move_to_another_wishlist_type && $available_multi_wishlist && count( $users_wishlists ) > 1, $wishlist ) ) { |
| 122 | yith_wcwl_get_template( 'wishlist-popup-move.php', $var ); |
| 123 | } |
| 124 | ?> |
| 125 |