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 | |
| remove_action( 'woocommerce_before_shop_loop', 'woocommerce_result_count', 20 ); |
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 | |
| add_action( 'woocommerce_after_shop_loop_item_title', 'bbloomer_ins_woocommerce_product_excerpt', 35, 2 ); | |
| function bbloomer_ins_woocommerce_product_excerpt() { | |
| the_excerpt(); | |
| } |
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 | |
| add_filter( 'woocommerce_account_menu_items', 'bbloomer_remove_address_my_account', 9999 ); | |
| function bbloomer_remove_address_my_account( $items ) { | |
| unset( $items['edit-address'] ); | |
| return $items; | |
| } | |
| /** |
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 | |
| add_filter( 'woocommerce_payment_complete_order_status', 'bbloomer_autocomplete_processing_orders', 9999 ); | |
| function bbloomer_autocomplete_processing_orders() { | |
| return 'completed'; | |
| } |
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
| 1 - Mettre la liste de tous les ID des catégories de produits | |
| <?php | |
| add_action( 'product_cat_pre_add_form', 'bbloomer_list_all_product_cat_ids', 5 ); | |
| function bbloomer_list_all_product_cat_ids() { | |
| $ids = ''; | |
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
| 1 - PHP | |
| <?php | |
| add_action( 'woocommerce_before_shop_loop_item_title', 'bbloomer_display_sold_out_loop_woocommerce' ); | |
| function bbloomer_display_sold_out_loop_woocommerce() { | |
| global $product; | |
| if ( ! $product->is_in_stock() ) { | |
| echo '<span class="rupture_de_stock">En rupture de stock !</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 | |
| add_action( 'woocommerce_after_shop_loop_item', 'popcorn_show_stock_shop', 10 ); | |
| function popcorn_show_stock_shop() { | |
| global $product; | |
| echo wc_get_stock_html( $product ); | |
| } |
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 Snippet #1: Remove a Sorting Option @ WooCommerce Shop | |
| <?php | |
| add_filter( 'woocommerce_catalog_orderby', 'bbloomer_remove_sorting_option_woocommerce_shop' ); | |
| function bbloomer_remove_sorting_option_woocommerce_shop( $options ) { | |
| unset( $options['rating'] ); | |
| return $options; |
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 | |
| add_action( 'woocommerce_cart_is_empty', 'popcorn_add_content_empty_cart' ); | |
| function popcorn_add_content_empty_cart() { | |
| echo 'Voici un texte pour remplir le panier vide !'; | |
| } |
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 | |
| add_filter( 'woocommerce_cart_subtotal', 'bbloomer_slash_cart_subtotal_if_discount', 99, 3 ); | |
| function bbloomer_slash_cart_subtotal_if_discount( $cart_subtotal, $compound, $obj ){ | |
| global $woocommerce; | |
| if ( $woocommerce->cart->get_cart_discount_total() <> 0 ) { | |
| $new_cart_subtotal = wc_price( WC()->cart->subtotal - $woocommerce->cart->get_cart_discount_tax_total() - $woocommerce->cart->get_cart_discount_total() ); | |
| $cart_subtotal = sprintf( '<del>%s</del> <b>%s</b>', $cart_subtotal , $new_cart_subtotal ); | |
| } |