%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /var/www/cwg/wp-content/themes/cwg/woocommerce/
Upload File :
Create Path :
Current File : //var/www/cwg/wp-content/themes/cwg/woocommerce/wishlist-view.php

<?php
/**
 * Wishlist page template - Standard Layout
 *
 * @author  Your Inspiration Themes
 * @package YITH WooCommerce Wishlist
 * @version 3.0.11
 */

/**
 * Template variables:
 *
 * @var $wishlist                      \YITH_WCWL_Wishlist Current wishlist
 * @var $wishlist_items                array Array of items to show for current page
 * @var $wishlist_token                string Current wishlist token
 * @var $wishlist_id                   int Current wishlist id
 * @var $users_wishlists               array Array of current user wishlists
 * @var $pagination                    string yes/no
 * @var $per_page                      int Items per page
 * @var $current_page                  int Current page
 * @var $page_links                    array Array of page links
 * @var $is_user_owner                 bool Whether current user is wishlist owner
 * @var $show_price                    bool Whether to show price column
 * @var $show_dateadded                bool Whether to show item date of addition
 * @var $show_stock_status             bool Whether to show product stock status
 * @var $show_add_to_cart              bool Whether to show Add to Cart button
 * @var $show_remove_product           bool Whether to show Remove button
 * @var $show_price_variations         bool Whether to show price variation over time
 * @var $show_variation                bool Whether to show variation attributes when possible
 * @var $show_cb                       bool Whether to show checkbox column
 * @var $show_quantity                 bool Whether to show input quantity or not
 * @var $show_ask_estimate_button      bool Whether to show Ask an Estimate form
 * @var $show_last_column              bool Whether to show last column (calculated basing on previous flags)
 * @var $move_to_another_wishlist      bool Whether to show Move to another wishlist select
 * @var $move_to_another_wishlist_type string Whether to show a select or a popup for wishlist change
 * @var $additional_info               bool Whether to show Additional info textarea in Ask an estimate form
 * @var $price_excl_tax                bool Whether to show price excluding taxes
 * @var $enable_drag_n_drop            bool Whether to enable drag n drop feature
 * @var $repeat_remove_button          bool Whether to repeat remove button in last column
 * @var $available_multi_wishlist      bool Whether multi wishlist is enabled and available
 * @var $no_interactions               bool
 */

if ( ! defined( 'YITH_WCWL' ) ) {
	exit;
} // Exit if accessed directly
?>
<!-- WISHLIST DESKTOP -->
<div
	class="shop_table px-10 grid grid-rows-1 gap-10 grid-cols-6 cart wishlist_table wishlist_view responsive mobile <?php echo $show_cb ? 'with-checkbox' : ''; ?> <?php echo $no_interactions ? 'no-interactions' : ''; ?>"
	data-pagination="<?php echo esc_attr( $pagination ); ?>" data-per-page="<?php echo esc_attr( $per_page ); ?>" data-page="<?php echo esc_attr( $current_page ); ?>"
	data-id="<?php echo esc_attr( $wishlist_id ); ?>" data-token="<?php echo esc_attr( $wishlist_token ); ?>">

	<?php if ( $wishlist && $wishlist->has_items() ) :
		foreach ( $wishlist_items as $item ) :
			/**
			 * Each of wishlist items
			 *
			 * @var $item \YITH_WCWL_Wishlist_Item
			 */
			global $product;
			$product      = $item->get_product();
			$productId = $product->get_id();
			$productLink = esc_url( get_permalink( apply_filters( 'woocommerce_in_cart_product', $item->get_product_id() )));
			$availability = $product->get_availability();
			$stock_status = isset( $availability['class'] ) ? $availability['class'] : false;
			$cat = get_the_terms($item->get_product_id(), 'product_cat');
			$catName = $cat[0]->name;
			$parentCat = $cat[0]->parent !== 0 ? get_the_category_by_ID($cat[0]->parent) : $catName;
			$user = wp_get_current_user();
			$idSale = $user->client_sale;
			$productName = $product->get_title();
			$subject = $productName;
			$userName = $user->user_firstname . ' ' . $user->user_lastname;
			$userMail = $user->user_email;			

			if($idSale) {
				$sale = get_user_by('id', $idSale);
				$sale_mail = $sale->user_email;	
				$cc = [];			
				$to = $sale_mail;				
	
				if( have_rows('alias', 'user_' . $user->ID) ) {
					while( have_rows('alias', 'user_' . $user->ID) ): the_row();      
						$cc[] = get_sub_field('email');
					endwhile; 
				}

				if (!empty($cc)) {
					$to = implode (';', $cc);
				}				
			}
			else {				
				$to = 'enquirydispatchteam@carpentersworkshopgallery.com';
			}

			if ( $product && $product->exists() ) :
				?>
				<div class="mb-6" id="yith-wcwl-row-<?php echo esc_attr( $item->get_product_id() ); ?>" data-row-id="<?php echo esc_attr( $item->get_product_id() ); ?>">
					<?php if ( $show_cb ) : ?>
						<div class="product-checkbox">
							<input type="checkbox" value="yes" name="items[<?php echo esc_attr( $item->get_product_id() ); ?>][cb]"/>
						</div>
					<?php endif ?>

					<div class="flex flex-col">
						<div class="product-thumbnail">
							<a href="<?php echo esc_url( get_permalink( apply_filters( 'woocommerce_in_cart_product', $item->get_product_id() ) ) ); ?>">
								<?php echo $product->get_image(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
							</a>
						</div>

						<div class="item-details max-w-[180px]">
							<p class="text-[11px] mt-3 font-medium uppercase whitespace-nowrap overflow-ellipsis overflow-hidden">
								<?php $artist = get_field('artist_label', $item["product_id"]);?>
								<?= empty($artist) ? "Not specified" : $artist ?>
							</p>
							<div class="product-name font-light text-[11px] max-w-[180px] text-grey-textLight uppercase">
								<h3 class="whitespace-nowrap overflow-ellipsis overflow-hidden">
									<a href="<?php echo esc_url( get_permalink( apply_filters( 'woocommerce_in_cart_product', $item->get_product_id() ) ) ); ?>" class="whitespace-nowrap overflow-ellipsis overflow-hidden">
										<?php echo wp_kses_post( apply_filters( 'woocommerce_in_cartproduct_obj_title', $product->get_title(), $product ) ); ?>
									</a>
								</h3>
								<?php do_action( 'yith_wcwl_table_after_product_name', $item ); ?>
							</div>

							<?php if ( $show_variation || $show_dateadded || $show_price ) : ?>
								<table class="item-details-table">
									<?php if ( $show_price || $show_price_variations ) : ?>
										<div>
											<p class="value text-[11px] font-light">
												<?php include(locate_template('/woocommerce/wishlist-price-conditions.php')); ?>
											</p>
										</div>
									<?php endif ?>
								</table>
							<?php endif; ?>
						</div>
					</div>
					<?php if($parentCat === "Work"): ?>
						<label class="js-btnToChange" for="<?=$productId ?>">
							<input type="checkbox" class="js-enquireCheck hidden" data-product="<?=$productLink;?>" id="<?= $product->get_id();?>"/>
							<span class="w-full font-thin btn-stroked hidden mt-3 js-enquire-btn-modal btn-selectable-enquire" value="<?=$productId?>">ENQUIRE</span>
						</label>
						<div class="product-remove js-btnDelete hidden">
							<a href="<?php echo esc_url( add_query_arg( 'remove_from_wishlist', $item->get_product_id() ) ); ?>" class="remove_from_wishlist" title="<?php echo esc_html( apply_filters( 'yith_wcwl_remove_product_wishlist_message_title', __( 'Remove this product', 'yith-woocommerce-wishlist' ) ) ); ?>">
								<div class="btn-stroked mt-3 w-full font-thin">
									DELETE
								</div>
							</a>
						</div>
                    <?php endif; ?>
                    <?php if($parentCat === "Shop" || $parentCat === "Jewellery" || $catName ==="Jewellery"):?>
						<a href="?add-to-cart=<?= $product->get_id(); ?>" class="btn-stroked hidden mt-3 w-full font-thin  flex-row items-center js-btnToChangeCart">
							<span class=" w-3 h-3 mb-[3px] mr-2"><?php include(locate_template('/assets/img/icon-black-action-shopping-basket-14-px.svg')); ?></span>
							ADD TO CART
						</a>
						<div class="product-remove js-btnDelete hidden">
							<a href="<?php echo esc_url( add_query_arg( 'remove_from_wishlist', $item->get_product_id() ) ); ?>" class="remove_from_wishlist" title="<?php echo esc_html( apply_filters( 'yith_wcwl_remove_product_wishlist_message_title', __( 'Remove this product', 'yith-woocommerce-wishlist' ) ) ); ?>">
								<div class="btn-stroked mt-3 w-full font-thin">
									DELETE
								</div>
							</a>
						</div>
                    <?php endif; ?>
					<div class="additional-info-wrapper">
						<?php if ( $show_quantity || $show_stock_status ) : ?>
							<table class="additional-info">
								<?php if ( $show_quantity ) : ?>
									<tr>
										<td class="label">
											<?php esc_html_e( 'Quantity:', 'yith-woocommerce-wishlist' ); ?>
										</td>
										<td class="value">
											<?php if ( ! $no_interactions && $wishlist->current_user_can( 'update_quantity' ) ) : ?>
												<input type="number" min="1" step="1" name="items[<?php echo esc_attr( $item->get_product_id() ); ?>][quantity]" value="<?php echo esc_attr( $item->get_quantity() ); ?>"/>
											<?php else : ?>
												<?php echo esc_html( $item->get_quantity() ); ?>
											<?php endif; ?>
										</td>
									</tr>
								<?php endif; ?>

								<?php if ( $show_stock_status ) : ?>
									<tr>
										<td class="label">
											<?php esc_html_e( 'Stock:', 'yith-woocommerce-wishlist' ); ?>
										</td>
										<td class="value">
											<?php echo 'out-of-stock' === $stock_status ? '<span class="wishlist-out-of-stock">' . esc_html__( 'Out of stock', 'yith-woocommerce-wishlist' ) . '</span>' : '<span class="wishlist-in-stock">' . esc_html__( 'In Stock', 'yith-woocommerce-wishlist' ) . '</span>'; ?>
										</td>
									</tr>
								<?php endif ?>
							</table>
						<?php endif; ?>


						<!-- Change wishlist -->
						<?php if ( $move_to_another_wishlist && $available_multi_wishlist && count( $users_wishlists ) > 1 ) : ?>
							<div class="move-to-another-wishlist">
								<?php if ( 'select' == $move_to_another_wishlist_type ) : ?>
									<select class="change-wishlist selectBox">
										<option value=""><?php esc_html_e( 'Move', 'yith-woocommerce-wishlist' ); ?></option>
										<?php
										foreach ( $users_wishlists as $wl ) :
											/**
											 * Each of customer wishlists
											 *
											 * @var $wl \YITH_WCWL_Wishlist
											 */
											if ( $wl->get_token() === $wishlist_token ) {
												continue;
											}
											?>
											<option value="<?php echo esc_attr( $wl->get_token() ); ?>">
												<?php echo esc_html( sprintf( '%s - %s', $wl->get_formatted_name(), $wl->get_formatted_privacy() ) ); ?>
											</option>
											<?php
										endforeach;
										?>
									</select>
								<?php else : ?>
									<a href="#move_to_another_wishlist" class="move-to-another-wishlist-button" data-rel="prettyPhoto[move_to_another_wishlist]">
										<?php echo esc_html( apply_filters( 'yith_wcwl_move_to_another_list_label', __( 'Move to another list &rsaquo;', 'yith-woocommerce-wishlist' ) ) ); ?>
									</a>
								<?php endif; ?>
							</div>
						<?php endif; ?>

					</div>
				</div>
				<?php
			endif;
			?>

			<?php include(locate_template('template-parts/popups/enquire-modal-wishlist.php')); ?>

			<?php
		endforeach;?>
		<?php include(locate_template('template-parts/popups/enquire-modal-wishlist-multiple.php')); ?>
	<?php else :?>
		<div class="w-[850px]">
			<p class="font-light text-[15px] ">
				Treat this space to build your very own projects by selecting works that appeal to you or that you may wish to use for inspiration.
			</p>
			<div class="mt-7 mb-[100px] flex flex-row">
				<a href="<?= get_permalink(257580); ?>" class="btn-stroked-dark hidden mt-3 w-[200px] font-thin mr-5">
					ADD PIECES
				</a>
				<a class="btn-stroked hidden mt-3 w-[200px] font-thin"
				onclick="return confirm('<?php esc_html_e( 'Are you sure you want to delete this wishlist?', 'yith-woocommerce-wishlist' ); ?>');" href="<?php echo esc_url( $wishlist->get_delete_url() ); ?>">
					DELETE THIS PROJECT
				</a>
			</div>
		</div>
		<?php
	endif; ?>

    <?php

	if ( ! empty( $page_links ) ) :
		?>
		<p class="pagination-row">
			<?php echo $page_links; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
		</p>
	<?php endif; ?>
</div>
<?php if($wishlist && $wishlist->has_items()): ?>
	<div class="btn-stroked-grey hidden text-white bg-grey-medium mt-3 mb-5 w-[28%] m-auto font-thin" id="js-enquireProject">
		ENQUIRE ABOUT THIS PROJECT
	</div>
	<a onclick="return confirm('<?php esc_html_e( 'Are you sure you want to delete this project?', 'yith-woocommerce-wishlist' ); ?>');" href="<?php echo esc_url( $wishlist->get_delete_url() ); ?>" class="hidden text-white bg-grey-medium mt-3 mb-5 w-[28%] m-auto font-thin" id="js-deleteProject">
		DELETE THIS PROJECT
	</a>

    <!-- RECOS SALES -->
    <?php
    $user = wp_get_current_user();
    $current_user_ID = $user->ID;
    $idSale = get_field('client_sale', 'user_' . $current_user_ID);
    if($idSale) {
        $sale = get_user_by('id', $idSale['ID']);
        $saleName = $sale->user_firstname;
    };

    $recos_sales = get_field('field_611672f1328cc', 'user_' . $current_user_ID);
    if ($recos_sales) {
        foreach ($recos_sales as $reco) {
            // Bail early if not for the current wishlist
            if ($wishlist_id !== (int) $reco['whishlist_id']) {
                continue;
            }

            $products = $reco['product_reco_sales'];
            if (!empty($products)) {
                if ($idSale) { ?>
                    <h2 class="px-10 mt-14 uppercase text-[15px]" id="recos-title"><?php printf('%s recommends:', $saleName); ?></h2>
                <?php } ?>
                <div class="px-10 pb-5 mt-5 mb-10 grid grid-rows-1 gap-10 grid-cols-3" id="sales-recos">
                <?php foreach ($products as $product_reco) {
                    if (empty($product_reco['product_reco'])) {
                        continue;
                    }

                    $product = wc_get_product($product_reco['product_reco'][0]->ID);
                    $product_id = $product->get_id();
                    if ((new YITH_WCWL)->is_product_in_wishlist($product_id, $wishlist_id)) {
                        remove_item_from_recos($product_id, $wishlist_id, $current_user_ID);
                    } elseif ($product && $product->exists()) { ?>
                        <div data-id="<?= $product_id; ?>" class="grid grid-cols-2 gap-4">
                            <div class="product-thumbnail">
                                <a href="<?php echo esc_url( get_permalink( apply_filters( 'woocommerce_in_cart_product',$product_id))); ?>">
                                    <?php echo $product->get_image(); ?>
                                </a>
                            </div>
                            <div class="flex flex-col">
                                <p class="text-[11px] mt-3 font-medium uppercase whitespace-nowrap overflow-ellipsis overflow-hidden">
                                    <?php $artist = get_field('artist_label', $product_id);  ?>
                                    <?= empty($artist) ? "Not specified" : $artist ?>
								</p>
                                <div class="product-name font-light text-[11px] max-w-[180px] text-grey-textLight uppercase">
                                    <h3 class="whitespace-nowrap overflow-ellipsis overflow-hidden">
                                        <a href="<?php echo esc_url( get_permalink( apply_filters( 'woocommerce_in_cart_product',$product_id))); ?>"
                                           class="whitespace-nowrap overflow-ellipsis overflow-hidden">
                                            <?php echo $product->get_title(); ?>
                                        </a>
                                    </h3>
                                </div>
                                <?php if ( $show_price || $show_price_variations ) { 
									$currency = $parentCat === "Work" && get_field('currency') !== '' ? get_field('currency') : '€';?>
                                    <p class="value text-[11px] font-light uppercase">
                                        <?php include(locate_template('/woocommerce/wishlist-price-conditions.php')); ?>
                                    </p>
                                <?php }

                                if (!empty($product_reco['comment'])) { ?>
                                    <p class="mt-3 pt-2 text-[12px] font-light border-t">
                                        <?php echo $product_reco['comment']; ?>
                                    </p>
                                <?php } ?>
                            </div>
                            <div>
                                <button type="button" class="js-removeFromRecos btn-stroked w-full font-thin"
                                        data-product-id="<?= $product_id; ?>" data-wishlist-id="<?= $wishlist_id; ?>" data-user-id="<?= $current_user_ID; ?>">
                                    No thanks
                                </button>
                            </div>
                            <div><?= do_shortcode('[yith_wcwl_add_to_wishlist]'); ?></div>
                        </div>
                    <?php }
                    } ?>
                </div>
            <?php }
            // Prevent loop to keep going when we met the current wishlist
            break;
        }
    }
    ?>


	<div id="js-wishlistEnquireSticky" class="h-[100px] hidden sticky bottom-0 px-5 mt-[15px] bg-grey-light flex flex-row justify-center items-center">
		<div class="flex flex-row items-center justify-between mt-7 lg:mt-0">
			<div>ENQUIRE FOR </div>
			<div id="js-enquireCount" class="md:pl-1"> 0 PIECE</div>
		</div>
		<div class="btn-stroked  mt-3 ml-[22px] w-[200px] font-thin lg:mt-0" id="js-enquireAllPieces">
			ALL PIECES
		</div>
		<div class="btn-stroked  mt-3 ml-[22px]  w-[200px] font-thin lg:mt-0" id="js-clearAllPieces">
			CLEAR
		</div>
		<div class="btn-stroked-dark hidden ml-[22px] mt-3 w-[200px] font-thin lg:mt-0" id="js-exitEnquireBtn">
			QUIT
		</div>
		<div class="hidden ml-[22px] mt-3 w-[200px] font-thin lg:mt-0" id="js-validateEnquireAll">
			Validate
		</div>
	</div>

	<?php if ( ! empty( $page_links ) ) : ?>
		<nav class="wishlist-pagination">
			<?php echo $page_links; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
		</nav>
	<?php endif; ?>
<?php endif; ?>

<script>
if (typeof getProductToEnquire === "function") {
    getProductToEnquire();
}
</script>

Zerion Mini Shell 1.0