This file contains hidden or 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
if ( ! function_exists( 'around_wc_order_item_name' ) ) { | |
function around_wc_order_item_name( $name, $item ){ | |
$variation_id = $item['variation_id']; | |
if( $variation_id > 0 ) { | |
$product_id = $item['product_id']; | |
$_product = wc_get_product( $product_id ); | |
$product_name = $_product->get_title(); | |
$_name = $product_name; | |
$variation_name = str_replace( $product_name . ' -', '', $item->get_name() ); | |
$_name .= '<span class="your-class">' . $variation_name . '</span>'; |
This file contains hidden or 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
<?php | |
// Custom registration form for WooCommerce | |
function custom_woocommerce_register_form() { | |
$user_role = ( ! empty( $_POST['user_role'] ) ) ? sanitize_text_field( $_POST['user_role'] ) : ''; | |
$company_id = ( ! empty( $_POST['company_id'] ) ) ? sanitize_text_field( $_POST['company_id'] ) : ''; | |
?> | |
<p class="form-row form-row-wide"> | |
<label for="user_role"><?php _e( 'Choose account type', 'woodmart' ); ?></label> |
This file contains hidden or 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
<?php //<~ don't add me in | |
add_filter( 'wp_nav_menu_items', 'my_account_loginout_link', 10, 2 ); | |
/** | |
* Add WooCommerce My Account Login/Logout to Registered Menu | |
* | |
* @link https://support.woothemes.com/hc/en-us/articles/203106357-Add-Login-Logout-Links-To-The-Custom-Primary-Menu-Area | |
*/ | |
function my_account_loginout_link( $items, $args ) { | |
if (is_user_logged_in() && $args->theme_location == 'primary') { //change your theme registered menu name to suit |
This file contains hidden or 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
/* --------- Adds custom fields using filters. ------ | |
The below custom fields shows various types one can use. | |
It is then displayed in the backend Order Details page and in admin and customer e-mails. | |
Checkboxes by default result only show the number 1 when clicked. I have added code so that when the a checkbox is clicked it will | |
show text such as On and Yes. Checkbox is also pre-selected. | |
Tutorial: https://easywebdesigntutorials.com/woocommerce-modifying-the-checkout-page/ | |
*/ | |
// Initial inspiration: https://businessbloomer.com/woocommerce-add-shipping-phone-checkout/ | |
// My Custom Fields |
This file contains hidden or 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
<?php | |
/** | |
* File Upload @ WooCommerce My Account Registration | |
*/ | |
// -------------- | |
// 1. Add file input to register form | |
This file contains hidden or 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
<?php | |
/** | |
* File Upload @ WooCommerce My Account Registration | |
*/ | |
// -------------- | |
// 1. Add file input to register form | |
This file contains hidden or 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
<?php | |
/** | |
* Ajoute un tab/endpoints dans la partie mon compte | |
* https://nicola.blog/2017/08/01/add-enquiry-form-my-account-woocommerce-contact-form-7/ | |
* | |
*/ | |
class WC_Custom_My_Account_Tabs extends WC_Query { | |
/** | |
* Adds main filters and actions and inits the endpoints. |
This file contains hidden or 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
<?php | |
function streamium_add_watchlist_endpoint() { | |
add_rewrite_endpoint( 'watchlist', EP_ROOT | EP_PAGES ); | |
} | |
add_action( 'init', 'streamium_add_watchlist_endpoint' ); | |
This file contains hidden or 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
<?php | |
/** | |
* Plugin Name: WooCommerce Custom Account Tabs | |
* Plugin URI: https://www.example.com/ | |
* description: PHP Class to generate new account tabs for WooCommerce My Account page | |
* Version: 1.0 | |
* Author: | |
* Author URI: https://gist.github.com/JiveDig/0d3658676127f30a098859228fc5d8eb | |
* License: GPL2 |
This file contains hidden or 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
<?php | |
/** | |
* Plugin Name: WooCommerce Registration Fields | |
* Description: My Custom registration fields. | |
* Version: 1.0 | |
* Author: Antonio Crespo | |
* License: GPL2 | |
*/ | |
/* Extra Fields in WooCommerce Registration */ |