hook-woocommerce

Bulk import Product Bundles – WooCommerce?

£可爱£侵袭症+ 提交于 2020-01-07 02:25:10
问题 I’ve installed the plugin Woocommerce – Product bundles As I am working in a shoe company and my boss needs to setup some pack of shoes (pack of some product variations ). I found a way to do that with this plugin but.. is there any way to bulk import product? I’m setting up a website in which the product bundle plugin is required. Due to the very large amount of bundled products to setup along with the very large amount of variable product to link to them, I would like to know if there is

Display different custom fields for different categories in WooCommerce

北慕城南 提交于 2020-01-06 04:19:22
问题 I am trying to display different custom fields for different categories in WooCommerce. I have used the following conditional statement in content-single-product.php template file: if(is_product_category('categoryname')) { // display my customized field } else { do_action( 'woocommerce_after_single_product_summary' ); } But this isn't working for me. Is there any better way to rectify this issue? Thanks. 回答1: The condition is_product_category() will not work for you in single product

Display different custom fields for different categories in WooCommerce

僤鯓⒐⒋嵵緔 提交于 2020-01-06 04:19:06
问题 I am trying to display different custom fields for different categories in WooCommerce. I have used the following conditional statement in content-single-product.php template file: if(is_product_category('categoryname')) { // display my customized field } else { do_action( 'woocommerce_after_single_product_summary' ); } But this isn't working for me. Is there any better way to rectify this issue? Thanks. 回答1: The condition is_product_category() will not work for you in single product

Set back date paid on paid order statuses change in WooCommerce

跟風遠走 提交于 2020-01-05 07:16:08
问题 I WooCommerce, I'm using "Change admin payment status back to unpaid for pending order status in Woocommerce" answer code to reset the paid status of orders when the order status is manually changed in the backend to pending. So for example, it removes the following if the order status was change from "completed" to "pending": "Paid on April 2, 2019 @ 5:29 pm" Now my problem here is after the order status was set to "pending", I tried to set it again the status to "completed" but it failed to

Set back date paid on paid order statuses change in WooCommerce

主宰稳场 提交于 2020-01-05 07:16:05
问题 I WooCommerce, I'm using "Change admin payment status back to unpaid for pending order status in Woocommerce" answer code to reset the paid status of orders when the order status is manually changed in the backend to pending. So for example, it removes the following if the order status was change from "completed" to "pending": "Paid on April 2, 2019 @ 5:29 pm" Now my problem here is after the order status was set to "pending", I tried to set it again the status to "completed" but it failed to

Hide “free trial” text from Woocommerce Subscriptions price but keep the Sign-Up Fee

…衆ロ難τιáo~ 提交于 2020-01-05 04:15:12
问题 The first part of the question (Hide the “free trial” text from Woocommerce Subscriptions price) was answered in this awesome post: Hide the "free trial" text from Woocommerce Subscriptions price However, it removed the "and a xx sign-up fee". Is there any way to keep the sign up fee text after removing the free trial text? 回答1: Updated - Try the following: add_filter( 'woocommerce_subscriptions_product_price_string', 'subscriptions_custom_price_string', 20, 3 ); function subscriptions_custom

Hide sub category titles on single parent sub category archive page WooCommerce

给你一囗甜甜゛ 提交于 2020-01-05 03:50:09
问题 I'm building a WP ecommerce site with multiple categories & sub-categories and need to remove the sub-category titles on just one archive page. All other category & sub category pages still require the sub category titles. Many thanks. 回答1: Update - Nov 2018 The easiest way for that purpose is to make a custom conditional function that you will use in the concerned related template content-product_cat.php where the this subcategory title is hooked. 1) The conditional function Here is that

remove_action From PHP Class in WooCommerce Memberships

假如想象 提交于 2020-01-05 02:48:06
问题 I have previously used a solution described here: remove_action From PHP Class for removing an action in the WooCommerce membership plugin. However, the solution no longer works, as WooComemerce have changed the code behind the membership plugin. So this is the new code. Main woocommerce-memberships.php public function includes() { // load post types require_once( $this->get_plugin_path() . '/includes/class-wc-memberships-post-types.php' ); // load user messages helper require_once( $this-

Email notification to a particular address if a specific product is purchased in Woocommerce

耗尽温柔 提交于 2020-01-05 02:16:06
问题 I am using the woocommerce plugin in my Wordpress website. I am wondering how can I send an email notification to a specific address email if product A is purchased by customer. How to send an email notification to a specific address when a specific product is purchased in Woocommerce? 回答1: The code below will add a custom defined email recipient to New Email Notification When a specific defined product Id is found in order items: add_filter( 'woocommerce_email_recipient_new_order',

Set custom shipping rates programmatically in Woocommerce 3

妖精的绣舞 提交于 2020-01-04 08:06:24
问题 I have searched and found a number of examples of how to change the shipping rates. Basically I am looking to do the same, but I want to use a 3rd party API. I have set up a custom plugin with a functions.php and activated it. I think used something simple like this: add_filter('woocommerce_package_rates','test_overwrite',10,2); function test_overwrite($rates,$package) { echo "<h2>Can you see me</h2>"; foreach ($rates as $rate) { //Set the price $rate->cost = 1000; //Set the TAX $rate->taxes