hook-woocommerce

Remove Cash On Delivery Instructions From WooCommerce Emails

最后都变了- 提交于 2019-12-13 15:31:14
问题 Here is what my email looks like currently: I have spent some time trying to remove this: 'Pay wish cash upon arriving to destination.' But cannot make it go away without removing other stuff. Please help if you can. Thank you. 回答1: — Update 1 — In backend, if you go to WooCommerce > settings > Checkout > Cash on Delivery (tab), you will see: You will be able to remove "Pay wish cash upon arriving to destination." instructions message, or to replace it with something more convenient. You

Woocommerce disable automatic order status change pending->processing

*爱你&永不变心* 提交于 2019-12-13 12:22:18
问题 I want to dissable this option: Whenever someone makes and order on my site and the payment is successfull the order status automaticaly changes from pending to processing . However I don`t want this feature to have enabled . Rather I want to do it manually when i proces the orders. I found this function in the woocommerce which is making this feature possible. I don`t want to directly change it there but rather with some kind of php snippet which overrides this function. Here is the function

Display dokan vendor name on Woocommerce single product pages

被刻印的时光 ゝ 提交于 2019-12-13 00:16:56
问题 With woocommerce I am using Dokan plugin and I am trying to display the vendor name, rating and vendor location on single product pages. I tried this code to display vendor name but no luck: //show store name add_action( 'woocommerce_single_product_summary', 'show_store_name', 20 ); function show_store_name() { printf( '<b>Seller Name:</b> <a href="%s">%s</a>', dokan_get_store_url( $author->ID ), $store_info['store_name'] ); } Any help is appreciated. 回答1: I don't use dokan plugin. Here is

Generate JS variable array through data-set from woocommerce HTML variation

↘锁芯ラ 提交于 2019-12-13 00:04:00
问题 This is the part of a vanilla JS code = var prices = [100, 536, 2368]; But the above is hardcoded. I want them through an HTML select drop down: <select class="license_type" name="license_type" id="license_type"> <option value="license" data-price="500">Single Site License</option> <option value="license" data-price="700">5 Site License</option> <option value="license" data-price="1400">Developers License</option> </select> Here values in the dataset are generated dynamically in woocommerce:

Woo-commerce Registration form add otp as custom field

怎甘沉沦 提交于 2019-12-12 23:47:25
问题 I want to add otp when user register on woo-commerce registration page, i have added custom field for phone number but i am not able to get any sources for otp in word-press i have my own API please if someone can share any resource for finding it It will be very helpful ... function iconic_get_account_fields() { return apply_filters( 'iconic_account_fields', array( 'user_url' => array( 'type' => 'text', 'label' => __( 'Phone' ), 'placeholder' => __( 'E.g. 9861234567', 'iconic' ), 'required'

Changing WooCommerce processing orders status based on product stock quantity

风流意气都作罢 提交于 2019-12-12 20:25:37
问题 I'm currently working on an automated status changes for WooCommerce orders: When a product stock reaches 50%, I am trying to change all related "processing" orders to 'kundenupdate' order status. I am using the function retrieve_orders_ids_from_a_product_id() from this answer thread, querying orders with "processing" status, form a product ID in the code below: function retrieve_orders_ids_from_a_product_id( $product_id ) { global $wpdb; // Define HERE the orders status for queried orders

Insert Values into a custom table once order is placed in Woocommerce

六月ゝ 毕业季﹏ 提交于 2019-12-12 18:04:21
问题 I need to insert into my custom table called license_table **username**, **order id**, **Quantity** This needs to be populated when an order is placed. Username = customer's email id Quantity = quantity (of the product) order id=Order ID i have used but not working add_action( 'woocommerce_order_status_completed', 'my_function' ); function my_function($order_id) { global $wpdb; $order = new WC_order($order_id); $customer_id= $order->id; $email= $order->billing_email; $email1= $order->id;

Add to cart bookable product by URL - WooCommerce Bookings

喜夏-厌秋 提交于 2019-12-12 09:01:30
问题 I'm using Woocommerce Bookings How to add to cart bookable product by URL? /?add-to-cart=[n.product] How can I pass an avaiable date with variations? Thanks 回答1: I ran into the same problem recently but I discovered a solution. It's not possible to add a bookable product just by adding the right variables to the end of the URL because WooCommerce Bookings expects data to be sent via the POST method as you can see at the plugin's source: // woocommerce-bookings/includes/class-wc-booking-cart

How do I programmatically apply a coupon in Woocommerce for first order made by a customer?

梦想的初衷 提交于 2019-12-12 03:03:53
问题 In Woocommerce I'm trying to find a way to apply a 20% discount to the first order made by a new customer. It appears that I can use the functions woocommerce_after_checkout_validation and check_new_customer_coupon to do this but it doesn't work. function.php: add_action('woocommerce_after_checkout_validation','check_new_customer_coupon', 0); function check_new_customer_coupon(){ global $woocommerce; // you might change the name of your coupon $new_cust_coupon_code = 'test'; $has_apply_coupon

Eliminate Hide or Remove “Services” and “Clear” from the Variation Drop Down in Woocommerce

人盡茶涼 提交于 2019-12-11 19:13:26
问题 W/o altering the template can we eliminate "services" and "clear" from the variation dropdown system. I have copy-pasted a template in a theme, and its modification was successful, but I am looking for ways to get rid of this through some hook/function without altering any template whatsoever. 回答1: Remove variation reset "clear" button using below hook add_filter( 'woocommerce_reset_variations_link', '__return_false' ); Remove attribute label using the hook below add_filter( 'woocommerce