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_action( 'user_register', 'figarts_make_users_vendors_wrapper', 10, 1 ); |
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
/** | |
* Turn all subscribers into Woo Vendors | |
*/ | |
function figarts_make_users_vendors( $user_id ) { | |
if (!defined('WC_PRODUCT_VENDORS_TAXONOMY')){ | |
return; | |
} |
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
function mytheme_custom_add_to_cart_message($message, $product_id = null) { | |
$titles[] = get_the_title( key($product_id)); | |
$titles = array_filter( $titles ); | |
$added_text = sprintf( _n( '%s has been added to cart.', '%s have been added to cart', sizeof( $titles ), 'woocommerce' ), wc_format_list_of_items( $titles ) ); //Change the message here | |
$message = sprintf( '%s <a href="%s" class="button">%s</a>', | |
esc_html( $added_text ), | |
esc_url( wc_get_page_permalink( 'checkout' ) ), // Change to esc_url( wc_get_page_permalink( 'cart' ) ), if you want users to go to cart | |
esc_html__( 'Pay Now', 'woocommerce' )); |
NewerOlder