In WooCommerce membership plugin there is a file with name class-wc-memberships-restrictions.php this file have the following class and constructor and that constructor have lots of filters, but I want to remove this filter from my child theme functions.php file How can I remove this filter from child theme f…
Tag: wordpress
Allow checkout only when a product of a mandatory category is in cart
I’d like to stop any customer advancing to the checkout if they do not have a particular product category in their basket. I would also like to tell them with an error message that they need to add a certain product. I’ve found some code but cannot it to work. I’ve added it as a code snippet…
Yoast SEO Generating blank sitemap
I am having trouble in generating site map for my site. I have latest version of yoast SEO plugin 3.5 and WordPress 4.6.1 I have tried different methods available on google but still cannot fix. Even disabled all other plugins. Changed the permalinks to postname but could not be fixed. Any Suggestions? Answer…
woocommerce cart custom thumbnail image image in cart
I want to show custom thumbnail images in cart. I made product with a custom attribute, say imageurl. I used the hook below to make it work: function custom_new_product_image($cart_object) { $a =…
WooCommerce – Remove downloads from menu in my account page
I would like to remove downloads menu from my account page. How can I do this? Is it any hook to remove a specific item from the menu? Thanks. Answer Go to WooCommerce > Settings > Advanced and remove the entry for Downloads in the Account endpoints section, just leave it blank. And the menu will not be…
WooCommerce action hooks and overriding templates
I have started to learn how to create templates with WooCommerce and I had faced with a little problem. For instance, in the php file content-single-product.php of Woocommerce plugin I have strings …
How do I hide WooCommerce products with a given category based on user role
I have a client with the following issue: I need to be able to split their WooCommerce WordPress site into essentially two categories. If a user is logged in as a “Wholeseller”, only products in the “Wholesale” category get pulled from the database. However if the user is not logged in…
Disable all payments gateway if there’s specifics products in the Cart
I would like to disable all payments gateways under special situation: I’ve 2 special products that I don’t want to be combined at checkout with any other product. Lets say that my “special” …
WordPress – PHP Fatal error: Call to undefined function get_bloginfo()
I’m integrating an external script with my wordpress theme and I’m getting this error in one of my files: PHP Fatal error: Call to undefined function get_bloginfo() this script is located in themes/mytheme/myscript And all files are included as following: how can I fix it? Answer you must include …
WooCommerce order status change from payment gateway
I have integrated a payment gateway to accept online payments for my store running on woocommerce. Everything works fine but I noticed that woocommerce is changing the order status to wc-processing for all the online paid orders by default. As per my store’s functionality I want all the online paid orde…