{{-- The Template for displaying product archives, including the main shop page which is a post type archive This template can be overridden by copying it to yourtheme/woocommerce/archive-product.php. HOWEVER, on occasion WooCommerce will need to update template files and you (the theme developer) will need to copy the new files to your theme to maintain compatibility. We try to do this as little as possible, but it does happen. When this occurs the version of the template file will be bumped and the readme will list any important changes. @see https://docs.woocommerce.com/document/template-structure/ @package WooCommerce/Templates @version 3.4.0 --}} @extends('layouts.app') @section('content') @php /* WP Queries */ // Get Issues by Number (post meta) $issues_args = array( 'post_type' => 'product', 'post_status' => 'publish', 'meta_key' => 'issue_number', 'orderby' => 'meta_value', 'order' => 'DESC', 'fields' => 'ids', ); $issues_results = new WP_Query($issues_args); $issues_ids = $issues_results->posts; $issues_wc_args = array( 'category' => ['issues'], 'include' => $issues_ids, 'orderby' => 'none', 'order' => 'DESC', ); $issues = wc_get_products( $issues_wc_args ); // Get Subscriptions by Price $subscriptions_args = array( 'posts_per_page' => -1, 'product_cat' => 'subscriptions', 'post_type' => 'product', 'orderby' => 'meta_value_num', 'meta_key' => '_price', 'order' => 'ASC', 'fields' => 'ids', ); $subscriptions_results = new WP_Query($subscriptions_args); $subscriptions_ids = $subscriptions_results->posts; $subscriptions_wc_args = array( 'category' => ['subscriptions'], 'include' => $subscriptions_ids, 'orderby' => 'none', 'order' => 'ASC', ); $subscriptions = wc_get_products( $subscriptions_wc_args ); wp_reset_postdata(); @endphp
@foreach ($issues as $issue) @php $terms = wp_get_post_terms( $issue->get_id(), 'product_cat' ); foreach ( $terms as $term ) $product_cats[] = $term->slug; $isReleased = in_array('not-released', $product_cats); @endphp
{!! get_the_title($issue->get_id()) !!}
@if ($isReleased)
{!! get_the_title($issue->get_id()) !!}
@else
{!! $issue->get_image() !!}
@endif
{!! __('Sold out', 'icarus') !!}
@if ($issue->is_type('variable'))
@foreach (App::get_variations($issue) as $variation) @endforeach
@else @endif
@endforeach @php wp_reset_postdata(); @endphp

{!! __('Subscriptions', 'icarus') !!}

Icarus is a Biannual magazine.

By subscribing you will be supporting future issues and get it automatically at home as soon as it is off the press.

@if ($subscriptions)
    @foreach ($subscriptions as $sub)
  • @include('svg.plus')
    {!! get_the_title($sub->get_id()) !!} {!! wc_price($sub->get_price()) !!}
  • @endforeach
@endif

{!! __('Bundles', 'icarus') !!} {!! __('available soon', 'icarus') !!}

{!! __('You can choose a specific set of issues') !!}

  • @include('svg.plus')
    2 issues 18
@endsection