157 lines
4.1 KiB
PHP
157 lines
4.1 KiB
PHP
<?php
|
|
|
|
return [
|
|
"debug" => true,
|
|
"flex-file-prefix" => "flex",
|
|
|
|
"options-pages" => [
|
|
"Site Options",
|
|
],
|
|
|
|
/**
|
|
* excerpt-length
|
|
*
|
|
* how many words should the wordpress excerpt be
|
|
*/
|
|
"excerpt-length" => 100,
|
|
|
|
|
|
/**
|
|
* guest-class
|
|
*
|
|
* if you want wordpress to automatically append a class to the body_class
|
|
* list when users are not authenticated, put that class name here. it
|
|
* defaults to "guest"
|
|
*/
|
|
"guest-class" => "guest",
|
|
|
|
|
|
/**
|
|
* menu-locations
|
|
*
|
|
* register your individual menu locations here
|
|
*/
|
|
"menu-locations" => [
|
|
"main-nav" => "Main Navigation",
|
|
"footer-nav" => "Footer Customer Support Navigation",
|
|
],
|
|
|
|
|
|
/**
|
|
* custom-post-types
|
|
*
|
|
* here is where you can define your custom post types easily
|
|
*/
|
|
"custom-post-types" => [
|
|
[
|
|
"slug" => "location",
|
|
"archive" => true,
|
|
"options-pages" => "Locations Landing Page",
|
|
"options" => [
|
|
"supports" => ["title", "thumbnail"],
|
|
]
|
|
],
|
|
[
|
|
"slug" => "testimonial",
|
|
"options" => [
|
|
"supports" => ["title", "thumbnail"],
|
|
]
|
|
],
|
|
],
|
|
|
|
|
|
/**
|
|
* handlebars
|
|
*
|
|
* We use handlebars templating extensivly in this theme and code pattern.
|
|
* You can adjust the defaults for many attributes here.
|
|
*
|
|
* Set this to `false` to disable handlebars functionality completely
|
|
*/
|
|
"handlebars" => [
|
|
"additional-helpers" => [
|
|
"testimonial" => \Helpers\McCansHelpers::testimonial(),
|
|
"locationTile" => \Helpers\McCansHelpers::locationTile(),
|
|
"productTile" => \Helpers\McCansHelpers::productTile(),
|
|
],
|
|
],
|
|
|
|
|
|
/**
|
|
* enable
|
|
*
|
|
* enable individual wordpress features here
|
|
*/
|
|
"enable" => [
|
|
"post-thumbnails",
|
|
"menus",
|
|
"woocommerce",
|
|
],
|
|
|
|
|
|
/**
|
|
* disable
|
|
*
|
|
* disable individual wordpress features here
|
|
*/
|
|
"disable" => [
|
|
"editor",
|
|
"customizer",
|
|
"gutenberg",
|
|
"patterns",
|
|
"emojis",
|
|
"meta-generator",
|
|
"woocommerce.breadcrumb",
|
|
"woocommerce.sidebar",
|
|
"woocommerce.result_count",
|
|
"woocommerce.page_title",
|
|
],
|
|
|
|
"hooks" => [
|
|
"woocommerce_before_main_content" => function () {
|
|
// shop page
|
|
if (is_shop()) {
|
|
echo site()->render("shop-top", site()->getPost(wc_get_page_id('shop'), ["headline", "intro_text", 'thumbnail']));
|
|
echo site()->render('woocommerce-before-content');
|
|
return;
|
|
}
|
|
|
|
echo site()->render('woocommerce-before-content');
|
|
},
|
|
"woocommerce_after_main_content" => function () {
|
|
echo site()->render('woocommerce-after-content');
|
|
},
|
|
"init" => function() {
|
|
remove_all_actions( 'woocommerce_before_shop_loop_item' );
|
|
remove_all_actions( 'woocommerce_before_shop_loop_item_title' );
|
|
remove_all_actions( 'woocommerce_shop_loop_item_title' );
|
|
remove_all_actions( 'woocommerce_after_shop_loop_item_title' );
|
|
remove_all_actions( 'woocommerce_after_shop_loop_item' );
|
|
add_action( 'woocommerce_shop_loop_item_title', function() {
|
|
global $product;
|
|
|
|
$data = site()->getPost($product->id, [
|
|
"url",
|
|
"id",
|
|
"title",
|
|
"thumbnail",
|
|
"woocommerce.price",
|
|
"woocommerce.attribute.msrp",
|
|
"woocommerce.cartUrl",
|
|
"woocommerce.sku",
|
|
]);
|
|
|
|
if ($data["price"] && $data["msrp"]) {
|
|
$difference = $data["msrp"] - $data["price"];
|
|
|
|
if ($difference > 0) {
|
|
$data["savings"] = round(($difference / $data["msrp"]) * 100);
|
|
}
|
|
}
|
|
|
|
echo site()->render("product-tile", $data);
|
|
});
|
|
}
|
|
],
|
|
];
|