WooCommerce Cart Items

You’re passing two parameters to _n function, the first one is the pattern for one item, and the second for 2 or more. Just change the pattern. Show only numbers: <?php echo sprintf (_n( ‘%d’, ‘%d’,count( WC()->cart->get_cart())),count( WC()->cart->get_cart())); ?> Show item for two or more: <?php echo sprintf (_n( ‘%d’, ‘%d items’,count( WC()->cart->get_cart())),count( WC()->cart->get_cart())); ?> … Read more

Add key and value to an array in another file

I tried another solution and that did the trick. I found in the WooCommerce docs this little snippet: // Display 24 products per page. Goes in functions.php add_filter( ‘loop_shop_per_page’, create_function( ‘$cols’, ‘return 24;’ ), 20 );. It is overriding the settings in the customizer. I only have to change the number ’24’ to my liking.

WordPress site with embedded menu – gives You don’t have permission to access /wp-content/themes/xxx/taxonomy-redirect.php on this server

The server is setup correctly, no one should be able to execute php which is not at the root directory of wordpress (if he cares about the site’s security). You can look into the htaccess or other server settings to figure out how it was done and remove it, but -10 for that option. The … Read more

Woocommerce search form with category select

You can try below code. Below code shows search box and woocommerce product categories . It will also show selected category. <form name=”myform” method=”GET” action=”<?php echo esc_url(home_url(“https://wordpress.stackexchange.com/”)); ?>”> <?php if (class_exists(‘WooCommerce’)) : ?> <?php if(isset($_REQUEST[‘product_cat’]) && !empty($_REQUEST[‘product_cat’])) { $optsetlect=$_REQUEST[‘product_cat’]; } else{ $optsetlect=0; } $args = array( ‘show_option_all’ => esc_html__( ‘All Categories’, ‘woocommerce’ ), ‘hierarchical’ => … Read more

Hide Add to Cart button on woocommerce Product description page of a particular product

You are applying your hook to early. WordPress is perfectly fine with removing that action, however it doesn’t know what product/post ID is yet. You can rewrite the last line of your code like that: add_action(‘wp’,’remove_product_description_add_cart_button’); WordPress actions chronologically – https://codex.wordpress.org/Plugin_API/Action_Reference