hook-woocommerce

Add Cancel button on My account Orders list using Woo Cancel for Customers Plugin

北慕城南 提交于 2019-12-06 09:33:27
问题 In My WooCommerce website I am using this plugin WooCommerce Order Cancel for Customers which allow customers to cancel their order based on payment type and on a time delay. But the cancel button only appears on the " woocommerce_order_details_after_order_table ". I would like this cancel button to appear in the "My account" > "Orders list" near the "View" button: I have tried to edit the plugin and adding this code: add_filter('woocommerce_my_account_my_orders_actions', array($this, 'order

How to add a heading above woocommerce-account-fields in Woocommerce

廉价感情. 提交于 2019-12-06 09:01:49
Preamble My question is very similar to the one asked here . The answer, I suspect, will also be very similar to the one here . Scenario The checkout page displays the typical Billing fields. Below those is the div class woocommerce-account-fields , in which is the div class create-account . The form nested in that has two fields, account_username and account_password . I want to hook into this and display a heading below the last billing field ( billing_email ) and above the account_username field. What I tried Reading the above mentioned question and answer, I figured I'd be able to do

How to add Variations tab in custom product type in Woocommerce?

放肆的年华 提交于 2019-12-06 07:55:06
问题 I've installed a plugin for "Gift Cards", which is basically adding a product type "Gift card". I need to enhance its functionality. There are other tabs available for this but the tab "Variations" is not. How can i add this tab so my custom product type can also behave like a variable product. Screen Shot: http://prntscr.com/ekogwd And i've to use my custom product type strictly means i cannot change it to variable product type. Is there any hook, action, or filter to add this tab manually

Adding a custom text under the X button that removes items from cart

自古美人都是妖i 提交于 2019-12-06 07:14:59
With Wordpress and WooCommerce, I am trying to add a custom text "delete item" under the "x" in the shopping cart tthat removes items from cart. I tried to "inspect element" to find where this "x" text icon was located, but I am hitting a brick wall. Any suggestions on how I can find this, and amend the "x" button to include text underneath? Thanks. add_filter('woocommerce_cart_item_remove_link', 'remove_icon_and_add_text', 10, 2); function remove_icon_and_add_text($string, $cart_item_key) { $string = str_replace('class="remove"', '', $string); return str_replace('×', 'Delete Item', $string);

Text under Add to cart (woocommerce)

假如想象 提交于 2019-12-06 06:41:28
How can I add a text saying "Contact us for bulk purchase enquiry" under 'Add to cart' button for all woocommerce products. Thanks Try adding this code to your functions.php file : add_action( 'woocommerce_after_add_to_cart_button', 'content_after_addtocart_button_func' ); function content_after_addtocart_button_func() { // Echo content. echo '<div style="font-size:10px;"><em>(*Contact us for bulk purchase enquiry)</em></div>'; } Hope it helps! 来源: https://stackoverflow.com/questions/44059449/text-under-add-to-cart-woocommerce

Add customer email in a text on WooCommerce Order received page

北城以北 提交于 2019-12-06 06:35:52
问题 In WooCommerce, on top of my thank you / order-received page, I've added a custom text, with the following code: add_action( 'woocommerce_thankyou', 'my_order_received_text', 1, 0); function my_order_received_text(){ echo '<div class="my_thankyou2"><p>' . __('Your download link was sent to: ') . '</p></div>' ; } How can I get the email address of the customer added to the end of the custom text? 回答1: To get the customer billing email , you can use one of those: The Woocommerce WC_Order method

Get all active users for a membership plan in WooCommerce

馋奶兔 提交于 2019-12-06 06:26:53
I am Using Wordpress version 4.9.4 with WooCommerce an WooCommerce Memberships plugin . How can I get all users for specific membership plan ($memberships)? Is there a hook or should I use raw query? On the documentation, it says that plans / memberships are post type, so I tried to query this table: SELECT jsu.id, jsu.user_email, jsu.display_name, jsp.post_title, jsp.post_type FROM `wp_users` jsu LEFT JOIN `wp_posts` jsp ON (jsu.id = jsp.post_author) LEFT JOIN `wp_usermeta` jsum ON (jsu.id = jsum.user_id) WHERE jsp.post_title IN ($memberships) AND post_type = 'wc_membership_plan' But I don't

Adding a hidden fields to checkout and process it through order

你离开我真会死。 提交于 2019-12-06 06:24:27
问题 I would like to add an verification code to the checkout process that is read-only ( or invisible) and pre-filled, pinned on an order. The Customer Need this Code to verifiy the Order. I add a custom Array to the Billing Field at the woocommerce_checkout_fields filter: //VID $fields['billing']['billing_vid'] = array( 'label' => __('', 'woocommerce'), 'placeholder' => _x('', 'placeholder', 'woocommerce'), 'required' => false, 'type' => 'text', 'class' => array('form-row-wide'), 'clear' =>

Add custom order status to filter menu in WooCommerce Admin Orders list

假如想象 提交于 2019-12-06 06:15:51
I'm currently trying to add new quick filters (subsubsub) to the WooCommerce admin orders list: I've a custom order status which is named "wc-test-accepted". How can I add a new quick filter for my custom order status to the top? To get the related filter to your custom order status "wc-test-accepted" in the orders statuses menu filter, you just need to change the status of at least one order and the filter will appear. The following code will add new a custom order status "wc-test-accepted" (Accepted): // Register new custom order status add_action('init', 'register_custom_order_statuses');

When changing woocommerce title hook the first item doesn't change

情到浓时终转凉″ 提交于 2019-12-06 06:06:26
I have a strange behaviour that I don't understand I've changed the woocommerce_shop_loop_item_title hook to add a link to the title of the product. This is my code inside functions.php // Add HREF TO TITLE function abChangeProductsTitleHook(){ remove_action( 'woocommerce_shop_loop_item_title', 'woocommerce_template_loop_product_title', 10 ); add_action('woocommerce_shop_loop_item_title', 'abChangeProductsTitle', 10 ); } add_action( 'woocommerce_shop_loop_item_title', 'abChangeProductsTitleHook' ); function abChangeProductsTitle() { echo '<h2 class="woocommerce-loop-product_title"><a href="'