<?php
Module::onView('title', function ($data) {
    return $data['page'] . ': This is title from Cart Module';
}, 10);
Module::onView('header', function ($data) {
    return view('cart::includes.header', [
        'moduleHeader' => getModuleOption('option.header'),
    ]);
}, 10);
Module::onView('cart.mini-cart-header', function ($data) {
    if (shouldUseNewInterface() && isset($data['isMobile']) && $data['isMobile'] && false) {
        return view('cart::new-theme.includes.mini-cart-header');
    }
    return view('cart::includes.mini-cart-header');
});
Module::onView('cart.mini-cart-sidebar', function ($data) {
    
    return view('cart::includes.mini-cart-sidebar');
});
Module::onView('cart.mini-cart', function ($data) {
    return view('cart::includes.mini-cart');
});
Module::onView('cart.add-to-cart-script', function ($data) {
    return view('cart::includes.add-to-cart-script', $data);
});
Module::onView('cart.add-to-cart-button', function ($data) {
    return view('cart::includes.add-to-cart-button');
});
Module::onView('cart.btn-add-to-cart', function ($data) {
    return view('inc.cart.btn-add-to-cart', $data);
});
Module::onView('cart.shipping-detail-product', function ($data) {
    if (function_exists('shouldUseNewInterface') && shouldUseNewInterface() && false) {
        return view('cart::includes.shipping-detail-product-v2', $data);
    }
    return view('cart::includes.shipping-detail-product', $data);
});

Module::onView('cart.mini-cart-mobile', function ($data) {
    return view('inc.cart.mini-cart-mobile', $data);
});

//Checkout
Module::onView('checkout.index', function ($data) {
    return view('cart::checkout.index', $data);
});
Module::onView('checkout.content', function ($data) {
    if (shouldUseNewInterface() && isset($data['isMobile']) && $data['isMobile'] && false) {
        return view('cart::new-theme.checkout.content');
    }
    return view('cart::checkout.content');
});
Module::onView('checkout.exchange', function ($data) {
    return view('cart::checkout.exchange');
});
Module::onView('checkout.exchange-shipping', function ($data) {
    return view('cart::checkout.exchange-shipping');
});
Module::onView('checkout.checkout-script', function ($data) {
    if (shouldUseNewInterface() && isset($data['isMobile']) && $data['isMobile'] && false) {
        return view('cart::new-theme.checkout.checkout-script');
    }
    return view('cart::checkout.checkout-script');
});
Module::onView('checkout.checkout-css', function ($data) {
    if (shouldUseNewInterface() && isset($data['isMobile']) && $data['isMobile'] && false) {
        return view('cart::new-theme.checkout.checkout-css', $data);
    }
    return view('cart::checkout.checkout-css');
});
Module::onView('checkout.cancel', function ($data) {
    return view('cart::checkout.cancel');
});

//Finish
Module::onView('checkout.finish', function ($data) {
    return view('cart::checkout.finish');
});

//Cart
Module::onView('cart.index', function ($data) {
    return view('cart::cart.index', $data);
});
Module::onView('cart.content', function ($data) {
    if (shouldUseNewInterface() && isset($data['isMobile']) && $data['isMobile'] && false) {
        return view('cart::new-theme.cart.content', $data);
    }
    return view('cart::cart.content', $data);
});
Module::onView('cart.script', function ($data) {
    if (shouldUseNewInterface() && isset($data['isMobile']) && $data['isMobile'] && false) {
        return view('cart::new-theme.cart.script');
    }
    return view('cart::cart.script');
});
Module::onView('cart.css', function ($data) {
    if (shouldUseNewInterface() && isset($data['isMobile']) && $data['isMobile'] && false) {
        return view('cart::new-theme.cart.css');
    }
    return view('cart::cart.css');
});
Module::onView('cart.tenancy-index', function ($data) {
    return view('cart::cart.tenancy-index', $data);
});

//Track order
Module::onView('cart.track-order', function ($data) {
    return view('cart::checkout.track-order', $data);
});
Module::onView('cart.make-change', function ($data) {
    return view('cart::includes.make-change', $data);
});
