I only have two snippets working right now. They both seem to be doing what they are intended to do from a functionality standpoint. Both are related to the woocommerce cart.
This one adds a “continue shopping” button in the cart:
/**
* Add Continue Shopping Button on Cart Page
* Add to theme functions.php file or Code Snippets plugin
*/
add_action( 'woocommerce_before_cart_table', 'woo_add_continue_shopping_button_to_cart' );
function woo_add_continue_shopping_button_to_cart() {
$shop_page_url = get_permalink(3434);
echo '<div class="woocommerce-message">';
echo ' <a href="'.$shop_page_url.'" class="button">Continue Shopping →</a> Did you forget anything?';
echo '</div>';
}
This one moves the “proceed to checkout” button to a different place in the cart view:
add_action( 'woocommerce_cart_actions', 'move_proceed_button' );
function move_proceed_button( $checkout ) {
echo '<a href="' . esc_url( WC()->cart->get_checkout_url() ) . '" class="checkout-button button alt wc-forward" >' . __( 'Proceed to Checkout', 'woocommerce' ) . '</a>';
}
Any idea which is the issue with the error?
Can snippets that aren’t active cause errors too? Those are the only two active.