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 */ |
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
User-agent: * # Создаем секцию правил для роботов. * значит для всех | |
# роботов. Чтобы указать секцию правил для отдельного | |
# робота, вместо * укажите его имя: GoogleBot, Yandex. | |
Disallow: /cgi-bin # Стандартная папка на хостинге. | |
Disallow: /wp-admin/ # Закрываем админку. | |
Allow: /wp-admin/admin-ajax.php # Откроем аякс. | |
Disallow: /? # Все параметры запроса на главной. | |
Disallow: *?s= # Поиск. | |
Disallow: *&s= # Поиск. | |
Disallow: /search # Поиск. |
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
//Display Fields | |
add_action( 'woocommerce_product_after_variable_attributes', 'variable_fields', 10, 2 ); | |
//JS to add fields for new variations | |
add_action( 'woocommerce_product_after_variable_attributes_js', 'variable_fields_js' ); | |
//Save variation fields | |
add_action( 'woocommerce_process_product_meta_variable', 'variable_fields_process', 10, 1 ); | |
function variable_fields( $loop, $variation_data ) { ?> | |
<tr> | |
<td> |