/*
Theme Name: Alukas
Theme URI: https://alukas.presslayouts.com
Author: PressLayouts team
Author URI: https://presslayouts.com
Description: Alukas is ThemeForest WordPress Premium Theme.
Requires at least: 6.2
Tested up to: 6.2
Requires PHP: 7.2
Version: 2.0.17
License: Themeforest Commercial Licence
License URI: https://themeforest.net/licenses/standard
Text Domain: pls-theme
Tags: one-column, two-columns, right-sidebar, custom-colors, custom-header, custom-menu, custom-logo, editor-style, featured-images, footer-widgets, post-formats, rtl-language-support, theme-options, threaded-comments, translation-ready
Alukas WordPress Theme, (C) 2023 PressLayouts.com
Alukas is distributed under the terms of the Envato.

 DO NOT ADD YOUR CSS TO THIS FILE - IT WILL BE LOST
 To add your own CSS, use a child theme alukas-child
 
 CSS file is in "assets/css"
*/
/* -----------------------------
REMOVE PRICE EVERYWHERE
----------------------------- */
add_filter('woocommerce_get_price_html', '__return_empty_string');


/* -----------------------------
REMOVE ADD TO CART BUTTONS
----------------------------- */
remove_action('woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart', 10);
remove_action('woocommerce_single_product_summary', 'woocommerce_template_single_add_to_cart', 30);


/* -----------------------------
DISABLE CART FUNCTIONALITY
----------------------------- */

// Disable purchasing
add_filter('woocommerce_is_purchasable', '__return_false');

// Remove cart page access
add_action('template_redirect', function () {
    if (is_cart() || is_checkout()) {
        wp_redirect(home_url());
        exit;
    }
});

// Hide cart menu if theme shows it
add_filter('woocommerce_widget_cart_is_hidden', '__return_true');


/* -----------------------------
ADD REQUEST QUOTE BUTTON
----------------------------- */

function jnc_request_quote_button() {

    $link = "https://fortityhosting.com/jncjewellers/#quote";

    echo '<a class="button request-quote-btn" href="'.$link.'">Request a Quote</a>';

}

add_action('woocommerce_after_shop_loop_item', 'jnc_request_quote_button', 15);
add_action('woocommerce_single_product_summary', 'jnc_request_quote_button', 35);