add-to-wishlist-added.php
1 year ago
add-to-wishlist-browse.php
1 year ago
add-to-wishlist-button.php
1 year ago
add-to-wishlist-remove.php
1 year ago
add-to-wishlist.php
1 year ago
react-preview-toggle.php
1 year ago
share.php
1 year ago
wishlist-view-footer-mobile.php
1 year ago
wishlist-view-footer.php
1 year ago
wishlist-view-header.php
1 year ago
wishlist-view-mobile.php
2 years ago
wishlist-view.php
1 year ago
wishlist.php
2 years ago
wishlist-view-footer.php
213 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Wishlist footer |
| 4 | * |
| 5 | * @author YITH <plugins@yithemes.com> |
| 6 | * @package YITH\Wishlist\Templates\Wishlist\View |
| 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 | * @var $count int Count of items in wishlist |
| 33 | * @var $var array Array of variable passed to the template |
| 34 | */ |
| 35 | |
| 36 | if ( ! defined( 'YITH_WCWL' ) ) { |
| 37 | exit; |
| 38 | } // Exit if accessed directly |
| 39 | ?> |
| 40 | <div class="yith_wcwl_wishlist_footer"> |
| 41 | <?php if ( $count && $show_cb ) : ?> |
| 42 | <!-- Bulk actions form --> |
| 43 | <div class="yith_wcwl_wishlist_bulk_action"> |
| 44 | <label for="bulk_actions"> |
| 45 | <?php |
| 46 | /** |
| 47 | * APPLY_FILTERS: yith_wcwl_wishlist_bulk_actions_label |
| 48 | * |
| 49 | * Filter the label of the bulk action selector in the Wishlist page. |
| 50 | * |
| 51 | * @param string $label Label |
| 52 | * |
| 53 | * @return string |
| 54 | */ |
| 55 | echo esc_html( apply_filters( 'yith_wcwl_wishlist_bulk_actions_label', __( 'Apply this action to all the selected items:', 'yith-woocommerce-wishlist' ) ) ); |
| 56 | ?> |
| 57 | </label> |
| 58 | <select name="bulk_actions" id="bulk_actions"> |
| 59 | <option value="add_to_cart"><?php esc_html_e( 'Add to cart', 'yith-woocommerce-wishlist' ); ?></option> |
| 60 | |
| 61 | <?php if ( $wishlist->current_user_can( 'remove_from_wishlist' ) ) : ?> |
| 62 | <option value="delete"> |
| 63 | <?php |
| 64 | /** |
| 65 | * APPLY_FILTERS: yith_wcwl_wishlist_bulk_remove_label |
| 66 | * |
| 67 | * Filters the label for the buk action to remove the items from the wishlist. |
| 68 | * |
| 69 | * @param string $label Label. |
| 70 | * |
| 71 | * @return string |
| 72 | */ |
| 73 | echo esc_html( apply_filters( 'yith_wcwl_wishlist_bulk_remove_label', __( 'Remove from wishlist', 'yith-woocommerce-wishlist' ) ) ); |
| 74 | ?> |
| 75 | </option> |
| 76 | <?php endif; ?> |
| 77 | |
| 78 | <?php if ( $available_multi_wishlist && count( $users_wishlists ) > 1 && $is_user_owner ) : ?> |
| 79 | <?php |
| 80 | foreach ( $users_wishlists as $wl ) : |
| 81 | /** |
| 82 | * Each of the wishlists owned by current user. |
| 83 | * |
| 84 | * @var $wl \YITH_WCWL_Wishlist |
| 85 | */ |
| 86 | if ( $wl->get_token() === $wishlist_token ) { |
| 87 | continue; |
| 88 | } |
| 89 | ?> |
| 90 | <option value="<?php echo esc_attr( $wl->get_token() ); ?>"> |
| 91 | <?php |
| 92 | // translators: 1. Wishlist formatted name. |
| 93 | echo esc_html( sprintf( __( 'Move to %s', 'yith-woocommerce-wishlist' ), $wl->get_formatted_name() ) ); |
| 94 | ?> |
| 95 | </option> |
| 96 | <?php endforeach; ?> |
| 97 | <?php endif; ?> |
| 98 | </select> |
| 99 | <input type="submit" name="apply_bulk_actions" value="<?php esc_html_e( 'Apply', 'yith-woocommerce-wishlist' ); ?>"/> |
| 100 | </div> |
| 101 | <?php endif; ?> |
| 102 | |
| 103 | |
| 104 | <?php if ( $count && $show_update ) : ?> |
| 105 | <!-- Update wishlist button --> |
| 106 | <div class="yith_wcwl_wishlist_update"> |
| 107 | <input type="submit" name="update_wishlist" class="<?php echo esc_attr( wc_wp_theme_get_element_class_name( 'button' ) ); ?>" value="<?php esc_html_e( 'Update', 'yith-woocommerce-wishlist' ); ?>"/> |
| 108 | </div> |
| 109 | <?php endif; ?> |
| 110 | |
| 111 | |
| 112 | <?php if ( $count && $share_enabled ) : ?> |
| 113 | <!-- Sharing section --> |
| 114 | <?php yith_wcwl_get_template( 'share.php', array_merge( $share_atts, array( 'wishlist' => $wishlist ) ) ); ?> |
| 115 | <?php endif; ?> |
| 116 | |
| 117 | <?php if ( $count && ( $show_ask_estimate_button || $enable_add_all_to_cart ) ) : ?> |
| 118 | <div class="yith_wcwl_footer_additional_action"> |
| 119 | <?php if ( $count && $show_ask_estimate_button ) : ?> |
| 120 | <!-- Ask an estimate button --> |
| 121 | <a href="<?php echo esc_url( ( $additional_info || ! is_user_logged_in() ) ? '#ask_an_estimate_popup' : $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]"' : ''; ?> > |
| 122 | <?php |
| 123 | /** |
| 124 | * APPLY_FILTERS: yith_wcwl_ask_an_estimate_icon |
| 125 | * |
| 126 | * Filter the icon for the 'Ask for an estimate'. |
| 127 | * |
| 128 | * @param string $icon Icon |
| 129 | * |
| 130 | * @return string |
| 131 | */ |
| 132 | echo yith_wcwl_kses_icon( apply_filters( 'yith_wcwl_ask_an_estimate_icon', $ask_an_estimate_icon ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
| 133 | ?> |
| 134 | <?php |
| 135 | /** |
| 136 | * APPLY_FILTERS: yith_wcwl_ask_an_estimate_text |
| 137 | * |
| 138 | * Filter the text for the 'Ask for an estimate'. |
| 139 | * |
| 140 | * @param string $text Text |
| 141 | * |
| 142 | * @return string |
| 143 | */ |
| 144 | echo esc_html( apply_filters( 'yith_wcwl_ask_an_estimate_text', $ask_an_estimate_text ) ); |
| 145 | ?> |
| 146 | </a> |
| 147 | <?php endif; ?> |
| 148 | |
| 149 | <?php if ( $count && $enable_add_all_to_cart ) : ?> |
| 150 | <!-- Add all to cart button --> |
| 151 | <input type="submit" name="add_all_to_cart" value="<?php esc_html_e( 'Add all to cart', 'yith-woocommerce-wishlist' ); ?>"/> |
| 152 | <?php endif; ?> |
| 153 | </div> |
| 154 | <?php endif; ?> |
| 155 | </div> |
| 156 | |
| 157 | <?php wp_nonce_field( 'yith_wcwl_edit_wishlist_action', 'yith_wcwl_edit_wishlist' ); ?> |
| 158 | <input type="hidden" value="<?php echo esc_attr( $wishlist_token ); ?>" name="wishlist_id" id="wishlist_id"> |
| 159 | |
| 160 | <?php |
| 161 | /** |
| 162 | * DO_ACTION: yith_wcwl_after_wishlist |
| 163 | * |
| 164 | * Allows to render some content or fire some action after the wishlist. |
| 165 | * |
| 166 | * @param YITH_WCWL_Wishlist $wishlist Wishlist object |
| 167 | */ |
| 168 | do_action( 'yith_wcwl_after_wishlist', $wishlist ); |
| 169 | ?> |
| 170 | |
| 171 | </form> |
| 172 | |
| 173 | <?php |
| 174 | /** |
| 175 | * DO_ACTION: yith_wcwl_after_wishlist_form |
| 176 | * |
| 177 | * Allows to render some content or fire some action after the wishlist form. |
| 178 | * |
| 179 | * @param YITH_WCWL_Wishlist $wishlist Wishlist object |
| 180 | */ |
| 181 | do_action( 'yith_wcwl_after_wishlist_form', $wishlist ); |
| 182 | ?> |
| 183 | |
| 184 | <?php |
| 185 | /** |
| 186 | * APPLY_FILTERS: yith_wcwl_ask_an_estimate_conditions |
| 187 | * |
| 188 | * Filter the condition to load the 'Ask for an estimate' template. |
| 189 | * |
| 190 | * @param bool $condition Condition to load the template |
| 191 | * |
| 192 | * @return bool |
| 193 | */ |
| 194 | if ( apply_filters( 'yith_wcwl_ask_an_estimate_conditions', $wishlist && $show_ask_estimate_button && ( ! is_user_logged_in() || $additional_info ) ) ) { |
| 195 | yith_wcwl_get_template( 'wishlist-popup-ask-an-estimate.php', $var ); |
| 196 | } |
| 197 | ?> |
| 198 | |
| 199 | <?php |
| 200 | /** |
| 201 | * APPLY_FILTERS: yith_wcwl_move_to_another_wishlist_popup_conditions |
| 202 | * |
| 203 | * Filter the condition to load the template to move products to another wishlist. |
| 204 | * |
| 205 | * @param bool $condition Condition to load the template |
| 206 | * |
| 207 | * @return bool |
| 208 | */ |
| 209 | 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 ) ) { |
| 210 | yith_wcwl_get_template( 'wishlist-popup-move.php', $var ); |
| 211 | } |
| 212 | ?> |
| 213 |