Last active
April 11, 2022 14:43
-
-
Save johnnya23/5a646497747e6507d6a7a3ea283cb8f2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* align button on product page??? */ | |
div.product form.cart .button { | |
margin-top: 0; | |
} | |
#customer_details * { | |
max-width: 100% !important | |
} | |
/* button colors **/ | |
.woocommerce #respond input#submit.alt, .woocommerce a.button.alt, .woocommerce button.button.alt, .woocommerce input.button.alt { | |
background-color: #1e73be; | |
} | |
.woocommerce #respond input#submit, .woocommerce a.button, .woocommerce button.button, .woocommerce input.button { | |
color: #ffffff; | |
background-color: #1e73be; | |
} | |
/* woo checkout */ | |
.page-id-2308 .woocommerce-notices-wrapper { | |
display: none; | |
} | |
.woocommerce-checkout .form-row { | |
display: block; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* add woo cart to checkout **/ | |
function jma_cart_on_checkout_page_only() | |
{ | |
if (is_wc_endpoint_url('order-received')) { | |
return; | |
} | |
echo do_shortcode('[woocommerce_cart]'); | |
} | |
add_action('woocommerce_before_checkout_form', 'jma_cart_on_checkout_page_only', 5); | |
function jma_redirect_empty_cart_checkout_to_custom() | |
{ | |
if (is_checkout() && 0 == WC()->cart->get_cart_contents_count() && ! is_wc_endpoint_url('order-pay') && ! is_wc_endpoint_url('order-received')) { | |
wp_safe_redirect(get_permalink(2311)); | |
exit; | |
} | |
} | |
add_action('template_redirect', 'jma_redirect_empty_cart_checkout_to_custom'); | |
function jma_change_cart_url_to_checkout() | |
{ | |
return wc_get_checkout_url(); | |
} | |
add_filter('woocommerce_get_cart_url', 'jma_change_cart_url_to_checkout', 10, 1); | |
function jma_return_to_shop_redirect() | |
{ | |
return get_permalink(2311); | |
} | |
add_filter('woocommerce_return_to_shop_redirect', 'jma_return_to_shop_redirect'); | |
function jma_redirect_checkout_add_cart() | |
{ | |
return wc_get_checkout_url(); | |
} | |
add_filter('woocommerce_add_to_cart_redirect', 'jma_redirect_checkout_add_cart'); | |
function jma_woocommerce_custom_product_add_to_cart_text() | |
{ | |
return __('Buy Now', 'woocommerce'); | |
} | |
//add_filter('woocommerce_product_add_to_cart_text', 'jma_woocommerce_custom_product_add_to_cart_text'); | |
add_filter('woocommerce_product_single_add_to_cart_text', 'jma_woocommerce_custom_product_add_to_cart_text'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment