• Resolved safianasim2

    (@safianasim2)


    For the caddy cart sidebar, I want to change the “checkout now” button to “view cart” button with its url redirect to cart page. Can you please help about it?

Viewing 1 replies (of 1 total)
  • Plugin Support usecaddy

    (@usecaddy)

    This is no option for a cart button however you can add one with some coding.

    1. Hide the checkout button:

    .cc-window .cc-cart-actions a.cc-button-primary { display: none; }

    2. Then you can hook in your own custom cart button:

    function custom_view_cart_button() {
    // Get the URL for the cart page
    $cart_url = wc_get_cart_url();

    // Output the "View Cart" button HTML
    echo '<a href="' . esc_url($cart_url) . '" class="button wc-forward">' . __('View Cart', 'woocommerce') . '</a>';
    }

    // Hook the custom function into the 'caddy_after_cart_screen_totals' action
    add_action('caddy_after_cart_screen_totals', 'custom_view_cart_button');
Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.