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
/* Display the text on specific checkout pages */ | |
add_action( 'woocommerce_checkout_before_order_review', 'mi_add_text_after_your_order_heading' ); | |
function mi_add_text_after_your_order_heading(){ | |
global $post; | |
switch ( $post->ID ) { | |
case 105: // Add your checkout page id on which you want to display the custom text | |
$html_code = ' | |
<div class="hello">for first checkout page</div> |
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
/* Coupon field text change filter */ | |
add_filter( 'cartflows_custom_coupon_text', 'be_change_coupon_fields_text' ); | |
// Callback function. | |
function be_change_coupon_fields_text( $coupon_text ){ | |
$coupon_text['field_text'] = 'textbox_placeholder_text'; // Replace your string here. | |
$coupon_text['button_text'] = 'Apply_button_test'; // Replace your string here. |
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
// Change the Text & URL of the ADD TO CART button on the shop page | |
add_filter( 'woocommerce_loop_add_to_cart_link', 'an_replacing_add_to_cart_button_link', 10, 2 ); | |
function an_replacing_add_to_cart_button_link( $button, $product ) { | |
// Get the current product id. | |
$this_product_id = $product->get_id(); | |
// add the condition cases for the product which you want to set the custom URL. | |
switch ($this_product_id) { |
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
/* Remove the add to cart message/notice from the CartFlows checkout page only */ | |
function remove_added_to_cart_notice() | |
{ | |
// Get all notices. | |
$notices = WC()->session->get('wc_notices', array()); | |
// Check array is blank or not. Means any notices are present or not. | |
if( is_array( $notices ) && !empty( $notices ) ){ | |
// Search for only sucess message. |
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
/* | |
* How to add the custome code. | |
* | |
* Please follow below instructions: | |
* 1. Copy the below code. | |
* 2. Open your child theme's functions.php file. | |
* 3. Paste the copied code at the very bottom of it & save the file OR upload it on your server/hosting. | |
*/ | |
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
/* | |
* How to add the custome code. | |
* | |
* Please follow below instructions: | |
* 1. Copy the below code. | |
* 2. Open your child theme's functions.php file. | |
* 3. Paste the copied code at the very bottom of it & save the file OR upload it on your server/hosting. | |
*/ | |
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
/* | |
* How to add the custome code. | |
* | |
* Please follow below instructions: | |
* 1. Copy the below code. | |
* 2. Open your child theme's functions.php file. | |
* 3. Paste the copied code at the very bottom of it & save the file OR upload it on your server/hosting. | |
*/ | |
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
/* Autofill checkout fields from user data provided from the URL*/ | |
add_filter( 'woocommerce_checkout_fields' , 'mi_prefill_billing_fields' ); | |
function mi_prefill_billing_fields ( $address_fields ) { | |
// Get the data from the URL | |
if ( isset( $_GET['fname'] ) || isset( $_GET['lname'] ) || isset( $_GET['email'] ) ) | |
{ | |
// wp_die(); | |
$fname = isset( $_GET['fname'] ) ? esc_attr( $_GET['fname'] ) : ''; |
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
/* Remove extra html Jupiter Theme conflict */ | |
add_action( 'wp', 'remove_jupiter_conflict_actions' ); | |
function remove_jupiter_conflict_actions(){ | |
global $post; | |
$post_type = get_post_type(); | |
$page_template = get_post_meta( $post->ID, '_wp_page_template', true ); |
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
/* Change the place order button on checkout page. */ | |
add_filter( 'gettext', 'show_custom_button_text', 20, 3 ); | |
function show_custom_button_text( $translated_text, $text, $domain ) { | |
switch ( $translated_text ) { | |
case 'Proceed to PayPal' : // you can remove this if you don't want to change the button text for PayPal | |
$translated_text = __( 'Your new Paypal button text here', 'woocommerce' ); | |
break; | |
case 'Place order' : // This text will change for all other firstly with the COD option and for those payment gateways who don't change the text. | |
$translated_text = __( 'Your new COD button text here', 'woocommerce' ); | |
break; |
OlderNewer