<?php
/**
* WooCommerce Skip Cart Page
*
* @package Bootscore
* @version 6.0.1
*/
// Exit if accessed directly
defined('ABSPATH') || exit;
/**
* Mini cart widget buttons
*/
remove_action('woocommerce_widget_shopping_cart_buttons', 'woocommerce_widget_shopping_cart_proceed_to_checkout', 20);
add_action('woocommerce_widget_shopping_cart_buttons', 'bootscore_widget_shopping_cart_proceed_to_checkout', 20);
function bootscore_widget_shopping_cart_proceed_to_checkout() {
echo '<a href="' . esc_url(wc_get_checkout_url()) . '" class="btn btn-primary btn-lg d-block">' . esc_html__('Checkout', 'woocommerce') . '</a>';
}
/**
* Hide WooCommerce Mini-Cart "View Cart" Button
*/
remove_action('woocommerce_widget_shopping_cart_buttons', 'woocommerce_widget_shopping_cart_button_view_cart', 10);
/**
* Skip cart page and redirect to checkout only if the cart has items.
*/
function bootscore_skip_cart_page_redirection_to_checkout() {
// Check if it's the cart page and if the cart has items.
if ( is_cart() && WC()->cart->get_cart_contents_count() > 0 ) {
wp_redirect( wc_get_checkout_url() );
exit; // Ensure that the script stops executing after redirect.
}
}
add_action('template_redirect', 'bootscore_skip_cart_page_redirection_to_checkout');
| nama | waktu | ukuran | owner | perm | aksi |
|---|---|---|---|---|---|
| .. | |||||
| blocks/ | 2026-11-26 08:19 | 6.91 KB | 76129f60960:kunden | dxwrx-rx-r | |
| ajax-cart.php | 2026-11-26 08:19 | 19.38 KB | 76129f60960:kunden | -xw-x--x-- | |
| wc-ajax-login.php | 2026-11-26 08:19 | 4.68 KB | 76129f60960:kunden | -xw-x--x-- | |
| wc-breadcrumb.php | 2026-11-26 08:19 | 6.83 KB | 76129f60960:kunden | -xw-x--x-- | |
| wc-cart.php | 2026-11-26 08:19 | 1.35 KB | 76129f60960:kunden | -xw-x--x-- | |
| wc-deprecated.php | 2026-11-26 08:19 | 1.47 KB | 76129f60960:kunden | -xw-x--x-- | |
| wc-enqueue.php | 2026-11-26 08:19 | 2.17 KB | 76129f60960:kunden | -xw-x--x-- | |
| wc-forms.php | 2026-11-26 08:19 | 1.5 KB | 76129f60960:kunden | -xw-x--x-- | |
| wc-loop.php | 2026-11-26 08:19 | 3.82 KB | 76129f60960:kunden | -xw-x--x-- | |
| wc-mini-cart.php | 2026-11-26 08:19 | 1.35 KB | 76129f60960:kunden | -xw-x--x-- | |
| wc-pagination.php | 2026-11-26 08:19 | 2.05 KB | 76129f60960:kunden | -xw-x--x-- | |
| wc-qty-btn.php | 2026-11-26 08:19 | 3.43 KB | 76129f60960:kunden | -xw-x--x-- | |
| wc-redirects.php | 2026-11-26 08:19 | 1.59 KB | 76129f60960:kunden | -xw-x--x-- | |
| wc-result-count.php | 2026-11-26 08:19 | 1.21 KB | 76129f60960:kunden | -xw-x--x-- | |
| wc-sale-flash.php | 2026-11-26 08:19 | 491 B | 76129f60960:kunden | -xw-x--x-- | |
| wc-setup.php | 2026-11-26 08:19 | 608 B | 76129f60960:kunden | -xw-x--x-- | |
| wc-single-product-reviews.php | 2026-11-26 08:19 | 2.78 KB | 76129f60960:kunden | -xw-x--x-- | |
| wc-skip-cart.php | 2026-11-26 08:19 | 1.25 KB | 76129f60960:kunden | -xw-x--x-- | |
| wc-stock-badge.php | 2026-11-26 08:19 | 706 B | 76129f60960:kunden | -xw-x--x-- | |
| wc-tabs.php | 2026-11-26 08:19 | 3.02 KB | 76129f60960:kunden | -xw-x--x-- | |