Malin / largest.sh
0 лайк(-ов)
0 форк(-ов)
1 файл(-ов)
Последняя активность
| 1 | # find and sort largest directories |
| 2 | |
| 3 | du -h /www --max-depth=1 | sort -rh |
Malin / qrh-custom.css
0 лайк(-ов)
0 форк(-ов)
1 файл(-ов)
Последняя активность
| 1 | .col-1 { max-width: 50%!important} |
| 2 | .col-2 { max-width: 50%!important} |
| 3 | |
| 4 | .woocommerce-page .cart-collaterals { |
| 5 | display: none; |
| 6 | } |
| 7 | |
| 8 | .child-category { |
| 9 | color: #9C9C9C; |
| 10 | font-family: 'Roboto', sans-serif; |
Malin / install-cgi.sh
0 лайк(-ов)
0 форк(-ов)
1 файл(-ов)
Последняя активность
| 1 | # from: https://stackoverflow.com/questions/6787579/error-installing-perl-cgi-module-from-cpan |
| 2 | # dependency for LP-MSH-Scanner |
| 3 | |
| 4 | apt-get install libcgi-pm-perl |
Malin / filtered-cats-QRh.php
0 лайк(-ов)
0 форк(-ов)
1 файл(-ов)
Последняя активность
| 1 | function your_theme_enqueue_scripts() { |
| 2 | wp_enqueue_script('jquery'); |
| 3 | // Add here any other scripts you need to enqueue |
| 4 | } |
| 5 | |
| 6 | add_action('wp_enqueue_scripts', 'your_theme_enqueue_scripts'); |
| 7 | |
| 8 | function load_filtered_cats() { |
| 9 | // Security check |
| 10 | if (!check_ajax_referer('load_cats_nonce', 'nonce', false)) { |
Malin / sale-flash-label.php
0 лайк(-ов)
0 форк(-ов)
1 файл(-ов)
Последняя активность
| 1 | /* START Show sale flash label */ |
| 2 | add_filter('woocommerce_sale_flash', 'ds_change_sale_text'); |
| 3 | function ds_change_sale_text() { |
| 4 | return '<span class="onsale">Oferta!</span>'; |
| 5 | } |
| 6 | |
| 7 | /* END Show sale flash label */ |
Malin / user-email-in-header.php
0 лайк(-ов)
0 форк(-ов)
1 файл(-ов)
Последняя активность
| 1 | /* START Display user email in header */ |
| 2 | function show_user_email_shortcode() { |
| 3 | if ( is_user_logged_in() ) { |
| 4 | $current_user = wp_get_current_user(); |
| 5 | return $current_user->user_email; |
| 6 | } else { |
| 7 | return ''; // Return an empty string if the user is not logged in |
| 8 | } |
| 9 | } |
| 10 | add_shortcode('show_user_email', 'show_user_email_shortcode'); |
Malin / brand-above-title-in-cart.php
0 лайк(-ов)
0 форк(-ов)
1 файл(-ов)
Последняя активность
| 1 | /* START Display Brand above title in cart */ |
| 2 | // Function to display child category above product title on cart page |
| 3 | function display_child_category_above_product_title_on_cart( $item_name, $cart_item, $cart_item_key ) { |
| 4 | // We attempt to check if $cart_item contains product details |
| 5 | if ( isset( $cart_item['product_id'] ) ) { |
| 6 | $product_id = $cart_item['product_id']; |
| 7 | |
| 8 | // Get child categories of the product |
| 9 | $product_categories = get_the_terms( $product_id, 'product_cat' ); |
Malin / unique-product-count-in-cart.php
0 лайк(-ов)
0 форк(-ов)
1 файл(-ов)
Последняя активность
| 1 | /* START Unique product count in cart */ |
| 2 | // Shortcode to display the number of unique products in the cart with styling |
| 3 | function display_unique_cart_product_count_styled() { |
| 4 | // Initialize an empty array to store unique product IDs |
| 5 | $unique_product_ids = array(); |
| 6 | |
| 7 | // Get the cart contents |
| 8 | $cart_contents = WC()->cart->get_cart(); |
| 9 | |
| 10 | // Loop through each item in the cart |
Malin / custom-add-to-cart-button.php
0 лайк(-ов)
0 форк(-ов)
1 файл(-ов)
Последняя активность
| 1 | /* START custom add to cart button on home */ |
| 2 | function custom_add_to_cart_button_with_icon() { |
| 3 | // Remove the default add to cart button |
| 4 | remove_action('woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart', 10); |
| 5 | |
| 6 | // Add the new custom button |
| 7 | add_action('woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart_with_icon', 10); |
| 8 | } |
| 9 | |
| 10 | function woocommerce_template_loop_add_to_cart_with_icon() { |
Malin / change-products-per-page.php
0 лайк(-ов)
0 форк(-ов)
1 файл(-ов)
Последняя активность
| 1 | add_action( 'pre_get_posts', 'custom_woocommerce_products_per_page' ); |
| 2 | |
| 3 | function custom_woocommerce_products_per_page( $query ) { |
| 4 | // Check if we're on a WooCommerce shop page or product category or tag page and if it's the main query |
| 5 | if( !is_admin() && $query->is_main_query() && (is_woocommerce() || is_product_category() || is_product_tag()) ) { |
| 6 | $query->set( 'posts_per_page', 9 ); // Set the number of products per page to 12 |
| 7 | } |
| 8 | } |
| 9 |