How to have a custom display for both woocommerce archive and product-category pages? [closed]

Generally, you can tell WordPress to load a different template. The mostly seen approaches make either use of the template_redirect or the template_include hook. It is preferable to use template_include as described in this article. Following an example on how to approach this: Code: // load the woocommerce category archive template add_filter( ‘template_include’, ‘wpse138858_woocommerce_category_archive_template’ ); … Read more

Default woocommerce placeholder image

The code for changing the default image is provided by WooCommerce in this link but for your requirement we have to customize the code as follows /* * goes in theme functions.php or a custom plugin. Replace the image filename/path with your own 🙂 * **/ add_action(‘init’, ‘custom_fix_thumbnail’); function custom_fix_thumbnail() { add_filter(‘woocommerce_placeholder_img_src’, ‘custom_woocommerce_placeholder_img_src’); function custom_woocommerce_placeholder_img_src($src) … Read more

Create custom page in WooCommerce

Create a new page in /wp-admin (in the left column: Pages -> Add New); create new custom page template after reading through this doc; put your code in there; go into the page you created in #1 and assign the page template to it (in the right column, Page Attributes box, the drop-down under ‘Template’ … Read more

Adding an action within a function that is being called by add_filter

The answer when the question is about hooks is always either: timing, priority, or both. Consider the following code: add_action( ‘shutdown’, ‘wpse_258451_shutdown’ ); function wpse_258451_shutdown() { add_action( ‘init’, ‘wpse_258451_init’ ); } function wpse_258451_init() { wp_die( ‘I will never be called.’ ); } It should be obvious that the function wpse_258451_init() will never be called. This … Read more

Woo-commerce | Disable proceed to checkout button in cart page if total in cart less than 15 [closed]

Try this: function disable_checkout_button_no_shipping() { $total = WC()->cart->get_cart_subtotal(); // Change made if( $total < 15 ){ remove_action( ‘woocommerce_proceed_to_checkout’, ‘woocommerce_button_proceed_to_checkout’, 20 ); echo ‘<a href=”#” class=”checkout-button button alt wc-forward”>Proceed to checkout</a>’; } } add_action( ‘woocommerce_proceed_to_checkout’, ‘disable_checkout_button_no_shipping’, 1 );

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)