PluginProbe
Orderable – Restaurant & Food Ordering System / 1.10.0
Orderable – Restaurant & Food Ordering System v1.10.0
0.1.4 0.1.5 0.2.0 1.0.0 1.1.0 1.1.1 1.10.0 1.10.1 1.11.0 1.12.0 1.12.1 1.12.2 1.13.0 1.14.0 1.15.0 1.16.0 1.17.0 1.17.1 1.18.0 1.19.0 1.19.1 1.19.2 1.2.0 1.20.0 1.20.1 All 44 releases
orderable / inc / modules / layouts / templates / main.php

main.php in Orderable – Restaurant & Food Ordering System 1.10.0, at inc/modules/layouts/templates/main.php

68 lines 2.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Layout: Main layout.
4 *
5 * This template can be overridden by copying it to yourtheme/orderable/layouts/main.php
6 *
7 * HOWEVER, on occasion Orderable will need to update template files and you
8 * (the theme developer) will need to copy the new files to your theme to
9 * maintain compatibility. We try to do this as little as possible, but it does
10 * happen. When this occurs the version of the template file will be bumped and
11 * the readme will list any important changes.
12 *
13 * @package Orderable/Templates
14 *
15 * @var array $products Array of products, sorted by category.
16 * @var array $args Array of shortcode args.
17 */
18
19 defined( 'ABSPATH' ) || exit;
20
21 $original_products = $products;
22 ?>
23
24 <div class="orderable-main <?php echo esc_attr( apply_filters( 'orderable_main_class', '', $args ) ); ?>">
25 <?php do_action( 'orderable_main_before_sections', $args, $original_products ); ?>
26
27 <div class="orderable-main__sections">
28 <?php foreach ( $products as $product_group ) { ?>
29 <?php
30 $category = $product_group['category'];
31 $products = $product_group['products'];
32 $has_child_categories = ! empty( $category['children'] );
33 ?>
34
35 <?php if ( empty( $product_group['products'] ) && ! $has_child_categories ) {
36 continue;
37 } ?>
38
39 <div id="category-<?php echo esc_attr( ! empty( $category['slug'] ) ? urldecode( $category['slug'] ) : 'uncategorized' ); ?>" class="orderable-main__group">
40 <?php do_action( 'orderable_main_before_products', $args, $product_group['category'], $product_group['products'] ); ?>
41
42 <?php if ( $has_child_categories ) {
43 foreach ( $product_group['category']['children'] as $child_category_group ) {
44 $category = $child_category_group['category'];
45 $products = $child_category_group['products'];
46
47 if ( empty( $products ) ) {
48 continue;
49 }
50
51 do_action( 'orderable_main_before_products_category_children', $args, $category, $products );
52
53 include Orderable_Helpers::get_template_path( 'products-list.php', 'layouts' );
54
55 do_action( 'orderable_main_after_products_category_children', $args, $category, $products );
56 }
57 } else {
58 include Orderable_Helpers::get_template_path( 'products-list.php', 'layouts' );
59 } ?>
60
61 <?php do_action( 'orderable_main_after_products', $args, $product_group['category'], $product_group['products'] ); ?>
62 </div>
63 <?php } ?>
64 </div>
65
66 <?php do_action( 'orderable_main_after_sections', $args, $original_products ); ?>
67 </div>
68