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
<?php | |
add_filter( 'woocommerce_countries', 'gnwooc2_ajouter_pays' ); | |
function gnwooc2_ajouter_pays( $countries ) { | |
$new_countries = array( | |
'NIRE' => __( 'Irlande du NORD', 'woocommerce' ), | |
); | |
return array_merge( $countries, $new_countries ); | |
} |
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
<?php | |
/** | |
* Code goes in functions.php or a custom plugin. | |
*/ | |
add_action( 'woocommerce_email', 'unhook_those_pesky_emails' ); | |
function unhook_those_pesky_emails( $email_class ) { | |
/** | |
* Hooks for sending emails during store events |
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
<?php | |
/** | |
* Enqueue CSS pour WooCommerce | |
* | |
* Les CSS déclarés dans votre thème seront chargés après ceux de WooCommerce | |
* | |
* @package Genesis Sample | |
* @author Grégoire Noyelle | |
* @license GPL-2.0+ | |
*/ |
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
<? // Template Name: Boutique avec options | |
/** | |
* Ajouter nouveau contenu | |
* @author Grégoire Noyelle | |
* @link https://github.com/woocommerce/woocommerce/wiki/wc_get_products-and-WC_Product_Query | |
* @link https://businessbloomer.com/woocommerce-easily-get-product-info-title-sku-desc-product-object/ | |
*/ | |
add_action( 'genesis_entry_content', 'woomod_nouveau_contenu', 20 ); |
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
<?php | |
//* Extrait de la fonction wp_add_to_cart_message dans le fichier woocommerce/includes/wc-cart-functions.php | |
//* Ici on se concentre sur le `apply_filters` pour la redirection native. Elle est éditable avec le hook. | |
// Output success messages | |
if ( 'yes' === get_option( 'woocommerce_cart_redirect_after_add' ) ) { | |
$return_to = apply_filters( 'woocommerce_continue_shopping_redirect', wc_get_raw_referer() ? wp_validate_redirect( wc_get_raw_referer(), false ) : wc_get_page_permalink( 'shop' ) ); | |
$message = sprintf( '<a href="%s" class="button wc-forward">%s</a> %s', esc_url( $return_to ), esc_html__( 'Continue shopping', 'woocommerce' ), esc_html( $added_text ) ); | |
} else { |
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
<?php | |
/** | |
* The Template for displaying all single products | |
* | |
* This template can be overridden by copying it to yourtheme/woocommerce/single-product.php. | |
* | |
* HOWEVER, on occasion WooCommerce will need to update template files and you | |
* (the theme developer) will need to copy the new files to your theme to | |
* maintain compatibility. We try to do this as little as possible, but it does | |
* happen. When this occurs the version of the template file will be bumped and |
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
<?php | |
/***** | |
* Voir les hook dans les fichiers: | |
* /woocommerce/includes/wc-template-hooks.php | |
* Les fonctions sont ajoutées à un fichier dédié dans mon thème qui est appelé depuis le | |
* le fichier principal: functions.php | |
*/ | |
// Ajout de texte avant les vignettes |
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
<?php | |
//* A placer dans un fichier de function dans votre thème | |
/** | |
* Hook pour retirer du texte | |
* @author Grégoire Noyelle | |
* @note bien mettre le paramètre et la référence à la classe. | |
*/ |