Woocommerce How to preview and test the order received page?

I want to test how the order received page template looks in woocommerce. The template says Thank you. Your order has been received. and underneath is current order information. How do i view this template without making a payment? I've found order-details.php in woocommerce/my-account and i've found thankyou.php in woocommerce/checkout but how do i preview the order recieved page so i can see what the customer sees after they make a purchase?

woocommerce shipping should include on checkout page

How can I exclude shipping charges from cart page? Meaning it should include only on checkout page. I am new to woocommerce and I do not have much knowledge about that. In my project, I do not want to include Shipping charges on cart page. I tried this add_filter( 'woocommerce_cart_needs_shipping', '__return_false' ); But it hides shipping (charges + address) from the whole project until I remove the code.

Woocommerce Remove dash board from WooCcommerce my account?

I have a strange requirement from the client. I want to remove dashboard text. Instead,dashboard text I want to show the order details when my account pages load. ie /my-account/ shows the order details(content of /my-account/orders). I tried some wp-redirection, but its won't work.

Woocommerce Replace <div id="content"> across entire store

I'm on a quest to remove the <div id="content"><div class="woocommerce"> wrapping container and replace it with more appropriate tag which matches the rest of my site. I first tried actions: remove_action( 'woocommerce_before_main_content', 'woocommerce_output_content_wrapper', 20); remove_action( 'woocommerce_after_main_content', 'woocommerce_output_content_wrapper_end', 20); function WOO_before_main_content( $woocommerce_output_content_wrapper ) { echo '<main class="wo

Woocommerce Bots, Woo and Adding to carts

Quick question here. Does anyone know how to stop bots from adding items to carts in Woocommerce? I have added a nofollow to the tag but its still happening. We are using the Ajax enabled add to cart on the homepage, categories and archives. Thank you in advance.

Unhooking Woocommerce Subscriptions emails (via php not the admin dashboard)

I'm trying to disable a number of WC Subscriptions emails (so they don't get sent). I know that I can do this in the admin settings area manually however I'm trying to do this via PHP (in a plugin). The reason for this is so that when it's moved from the test site to the live site the relevant files can be simply copied across and it's good to go without any manual settings changes. As an example - removing the new renewal order that gets sent to the site admin. add_action( 'woocommerce_email'

Woocommerce $order->get_checkout_payment_url() different behavior for product and subscription

I'm trying to create subscription order by code. I'm using the latest version of Woocommerce and Woocommerce Subscription plugins. It's working fine, but I got different order-pay page when the order contains subscription product. When the order contains a subscription, I got all the billing and the shipping fields. If the order only contains simple products, I got a summary about the order and the payment methods. I would like the same behavior for subscriptions. Example link: https://test.eu

Woocommerce Change order of billing fields on checkout page

I’m using the WC filter to order billing fields It seems the filter works fine, but for unknown reasons it revert back on the fly to the default order. add_filter("woocommerce_checkout_fields", "custom_order_fields"); function custom_order_fields($fields) { $order = array( "billing_first_name", "billing_last_name", "billing_country", "billing_address_1", "billing_address_2", "billing_state", "billing_city", "billing_phon

Woocommerce Where is the New Order form on the ADMIN side generated in the core files?

I am having trouble locating where these form elements are being generated, specifically the "State" fields in the Billing and the Shipping sections. Clearly there is some javascript happening. I'm wondering where the HTML and the javascript are being generated in the core files? I know, I know, don't edit the core files. Don't worry, this is for my own knowledge. I really appreciate any help. Here is a screenshot of the State dropdown that I am specifically targeting: Thanks for any insigh

Woocommerce Removing price suffix based on user role

Having failed at adding a suffix based on User Role because it wont display the Woo price display shortcode, I'm now approach the problem from the other direction - I have added the suffix to Woos tax tab, and now instead want to remove the suffix (from all user roles except one). I found this code on github to remove the suffix from products: add_filter( 'woocommerce_get_price_suffix', 'custom_woocommerce_get_price_suffix', 10, 2 ); function custom_woocommerce_get_price_suffix( $price_displa

Woocommerce stripe payment form cardnumber only shows last 4digits of cardnumber when select expiry/ccv input field

Hi I have a problem with stripe payment form when viewing on mobile the inline credit card form only shows the last 4 digits of the card number when I click the expiry date / ccv input field when i enter card number when i click expiry/ccv it only shows lasts 4digits not full cardnumber this is the CSS for the stripe woocommerce plugin stylesheet .wc-stripe-elements-field,.wc-stripe-iban-element-field{ border:1px solid #ddd; margin:5px 0; padding:5px; background-color:#fff;

WooCommerce - GET Order API filter with Order "meta_data" property using Postman

I'm using Postman to get WooCommerce Orders in an environment that I've setup locally for testing purposes. I need to know is there a way where I could filter the Orders by Custom field values (meta_data fields)? I could not find any documentation on this matter. I tried below in Postman but it did not give the result I expected. Since the 'is_vat_exempt' value was set to 'no', and it still gave me results in the Order response. GET http://localhost/woosite/wp-json/wc/v3/orders?meta_key='is_vat_

Woocommerce reset variation

I have an issue with a Woocommerce website where I provide flying vouchers. On each product, there are 2 varieties to choose from Airport (each airport offers different flight durations to pick from) duration of flight Currently, when user chooses an airport and the duration. He is unable to go back and choose from all the airports if they don't provide the same time. I need to ensure that the customer will always be able to choose from all of the airports, and if he changes it, the duration w

WooCommerce custom checkout fields issue

Added custom checkout field with add_filter, but I want to make the checkout page like this: There will be two rows and each row will have two columns. I want to add fields in four sections of the checkout page. But whenever I work with add_filter in another section like this, the field of other section also comes up. What is the solution? Here's what i've tried: function custom_billing_field ( $fields ) { $fields['billing']['checkout_custom_field_1'] = array( 'priority' =>

Woocommerce: display crossed price for free products

I can't display crossed price for 0 priced variable products. That is my code. Where I'm going wrong ? add_filter( 'woocommerce_get_price_including_tax_html', 'woocommerce_get_regular_price_html', 'woocommerce_get_price_html', 'price_free_zero_empty', 9998, 2 ); function price_free_zero_empty( $price, $product ){ if ( '' === $product->get_price_including_tax() || 0 == $product->get_price_including_tax() ) { $regular_price = $product->get_price_including_tax(); $price = '&

Woocommerce Coupon discount only at the end of invoice

I apply a coupon in Woocommerce: is a Fixed Cart Discount of 40 CHF.Everything works fine, except when the customer receive the Invoice. The amount of the coupon is added at the end of the Invoice and this is correct, but it's also deducted on the rows of the invoice and this is very confusing for the customer. There's a way to show the discount only at the end of the Invoice and the price without discount in the rows? I add 2 screenshot to explain better: Thanks for the help! now how should be

WooCommerce - changing dropdown list to text-input

i'm searching a way to convert dropdown list in WooCommerce into text-input field. I added hundreds of variation for width and height and now my client ask me to change it to input ;/ I need create something like this: 1st variation: if width = 20cm to 40cm AND height = 40cm to 90cm then price=myValue And my products are in different price cathegory,so i have hundreds of variation for each group Should i use csv pricing table? or something else than woocommerce ?

Woocommerce add_shipping on wc_create_order (woo commerce)

I have successfully able to create an order through functions.php file. I need help adding the free_shipping into the order. Can you please help with this one line? The code I used to create an order on functions.php: $lp_order = wc_create_order(); $lp_order->add_product( get_product( $lp_product_id ), 1 ); //(get_product with id and next is for quantity) $lp_order->set_address( $lp_address_full, 'billing' ); $lp_order->set_address( $lp_address_full, 'shipping' );

What is the best way to sync CRM and POS with WooCommerce?

Our client is a UK based shop, has two physical shops and one online e-commerce store running WooCommerce. The client needs to sync his stock and POS with WooCommerce. What do you recommend? He is willing to change his current CRM that does not have integration with Woo (Microsoft Dynamics) but I do not know what to recommend him.

Woocommerce Price not updating in the navigation (front end)

I have copied the code from http://demo.woothemes.com/boutique/product/woo-ninja-3/ <ul id="site-header-cart" class="site-header-cart menu"> <li class=""> <a class="cart-contents" href="http://demo.woothemes.com/boutique/cart/" title="View your shopping cart"> <span class="amount">£168.00</span> <span class="count">12 items</span> </a>

WooCommerce Different Stock Numbers for Product Variations

Currently have a setup where I want to be able to manage stock on WooCommerce. So say I have a single product with 3 Variations (small, medium, large). The way the is arranged is the small option dispenses 1 piece, medium 2 pieces, and large 3 pieces of the same product. Now say I have 100 pieces of inventory stock. When a user buys a size small I want this to deduct 1 piece from the total stock, but when a user buyers the size large, I need this to deduct 3 pieces from the total stock number.

Woocommerce Custom item prices change in WooC

Have situation with custom price for item line in WooC. Now find solution to change subtotal in Edit of order this way: add_action( 'woocommerce_update_order_item', function ($_item_id, $_item, $_order_id) { if( $arr_item_meta = wc_get_order_item_meta($_item_id) ) { $prc = wooc_item1_price( $arr_item_meta["_a1"][0], $arr_item_meta["_a2"][0], $arr_item_meta["_a3"][0], $_item->get_product()->get_id() ); $_item -> set_total( $prc ); $_item -> set_subto

woocommerce booking subtract weeks or days from date picked

I am using Woothemes Woocommerce Bookings. I want users to be able to enter a date in the product booking date picker and have the system make the booking three weeks prior to that date. e.g. customer uses the date picker to select 28/04/2018 (28th April 2018) but the booking is made for 07/04/2018 (7th April 2018). All bookings are made in blocks of 5 weeks (35 days) but they enter in a date that results in their booking being 3 weeks (21 days) before that date, and 2 weeks (14 days) after. Cu

Backorder Notification Woocommerce

I have a little problem with the backorder notification on my woocommerce shop. What it is now: I set in the product backorders: allowed, but notify customer. When I press a variaton on the product page it will show available for backorder. So far so good. When someone place the order it will show the text backorderer: 1 on the order confirmation, on the pdf invoice, on the e-mail. What I want: Show the notification only on the product information page. Not on the e-mails, order confirmation,

Woocommerce WC_CREATE not setting billing or shipping address

favorite I am trying to create a new order and my code as follows { $products = $_POST['products']; $shipping_address = $_POST['shipping_address']; $billing_address = $_POST['billing_address']; global $woocommerce; $args = array( 'customer_id' => get_current_user_id(), ); $order = wc_create_order($args); foreach ($products as $product) { $order->add_product(get_product($product['id']), $product['quanti

woocommerce remove shipping fee with code

On the checkout-page on my shop I have a checkbox which can add a fee to the shipping depending on where the customer is located. It goes something like this: if (isset($post_data['add_gift_box']) && $post_data['add_gift_box'] === 'yes') { $extracost = 600; WC()->cart->add_fee( 'Lives far away', $extracost ); } I would need a similar button that removes the shipping fee completly. Any tips on how to do this?

Woocommerce, variations, custom field and WP All Import plugin

I am trying to add a custom field for all my product variations and show this on the single product page. I am using "WooCommerce: Add/display Product or Variation custom field everywhere" answer code and it does everything I need. But the custom field is not visible anywhere in WP All Import plugin. Adding data manually to each variation works. Also wondering if I am overcomplicating this a bit? All help would be greatly appreciated.

woocommerce_output_related_products_args hook not working as expected

I want to show a specific product with id 64391 in related products section but the following code doesn't work for that. Am I missing something? add_filter( 'woocommerce_output_related_products_args','msrp_reconfigure_related_products_args', 20 ); public function msrp_reconfigure_related_products_args($args) { $args['posts_per_page'] = 5; $args['columns'] = 5; $args['post__in'] = array(64391); return $args; }

Woocommerce Why wc_get_template_part() not working inside wc_get_products()?

Cant find full loop example on the web with wc_get_template_part() and wc_get_products(), so looking for help here: global $woocommerce; global $product; $args = array( 'limit' => 15, 'category' => array('printers', 'laptop') ); $query_cats = wc_get_products($args); foreach ($query_cats as $query_cat) { echo $query_cat->get_id(); echo

Frontity Woocommerce

I am new to the use of Frontity, but I do have a few questions, I hope this is the right place for it!. Can someone explain me how to : List products with Frontity. Show variable products with Frontity The use of REST API in Frontity.

How to create a terawallet product_user credit function a hook after successful woocommerce payment

i'm running a woocommerce wordpress store and i've integrated a virtual wallet add-on called "terawallet aka woo-wallet". this add-on gives each user on the site the option to top-up their virtual wallet, withdraw funds or use it as a payment method during checkout. i would like to create a function/hook that automatically tops-up the product author wallet(user who posted the product post) when a product is purchased. I'm using a marketplace plugin that sets commission for each vendor/

Select Bank account in woocommerce checkout page

there is any way to get list of "Direct bank transfer" from woocommerce woocommerce, inside checkout page, so user when he clicked "Direct bank transfer" the account will be displayed as checkbox, and he can choose which bank details will use?. this data will be saved in the order page, so in the backend admins can know which bank was selected by the user

Woocommerce CRM connect

I'm trying to connect my Woocommerce to a CRM. They gave me this example code. My question: In what file do i need to add this code in Woocommerce. class SimplicateApi { public $authentication_key; public $authentication_secret; public $api_url; public function __construct($domain, $key, $secret){ $this->authentication_key = $key; $this->authentication_secret = $secret; $this->api_url = 'https://'.$domain.'/api/v2'; } public f

Navigation arrows in Woocommerce 3.x product gallery slider

Has anyone been able to add navigation arrows for Next/Prev slides in the new woocommerce slider? The thumbnail navigation particularly on mobile/table is great, but having arrows as well for desktop users would be a dream! Arrows on the main product image are preferred over the lightbox. You will understand why on our site: Would seem an easy and obvious option that Woocommerce has forgotten. Any help or guidance would be m

Custom Add to cart link - WooCommerce

As I have a custom product page, I would like to add a custom add to cart button. I have tried the following: http://"website"/cart/?add-to-cart="product id"&variation_id="variation id"&attribute_"attribute slug name" This used to work but since I updated woocommerce it doesn't work anymore. Any ideas on how I could create a custom add to cart link for variable products that redirects me to the cart page upon clicking the add to cart button? Thank you in advance for your time!

What is the best code to use for Removing rel=“nofollow” from woocommerce 'add to cart' buttons

I have found a few versions of code that can be added to remove the nofollow from the 'add to cart' links in woocommerce. The most recent code I found is: add_filter( 'woocommerce_loop_add_to_cart_args', 'remove_rel', 10, 2 ); function remove_rel( $args, $product ) { unset( $args['attributes']['rel'] ); return $args; } Will this do the job and where do I put the code? I believe it needs to be put in the functions.php file but sometimes it mentions it needing to be in a child theme

Woocommerce Woo custom badges/bubbles conditions

I create a custom badge/bubble "New!" based on time published: add_action( 'woocommerce_before_shop_loop_item', function() { #add_action( 'woocommerce_single_product_image_html', function() { $postdate = get_the_time( 'Y-m-d' ); // Post date $postdatestamp = strtotime( $postdate ); // Timestamped post date $newness = 10; // Newness in days if ( ( time() - ( 60 * 60 * 24 * $newness ) ) < $postdatestamp ) { echo

WooCommerce product gallery edit image

How can you edit image details (caption, alt etc) once you added image to product gallery? I can only remove the image, then add image again, where I can edit image details in Media Library. If this is not possible, could this metabox be extended with code so a button is added that would open this image in Media library? Is there a hook or similar (for where this metabox is built) where I could add a button above the image (then I will use javascript to attach click to button to open wp media l

Change Woocommerce In Stock/Out Stock Text

I have seen examples on here where you add some text to the functions.php. However how would I change it from its current text which is 10 in stock to Only 10 left so that it keeps the quantity. And then when its sold out it says Sold Out

Add customer as recipient to woocommerce subscriptions cancelled subscription email (notification)

By default woocommerce subscriptions send the email notification that a subscription has been cancelled only to the admin of the store, NOT to the customer. This is not user friendly. I am trying to add the customer as a recipient to this specific email notification, without success so far. I have tried writing add a filter with PhP to the action cancelled_subscription_notification . Which i believe handles the email notification for cancelled subscriptions. add_filter( 'cancelled_subscription

Change the prices of two or three products if they were added to the shopping cart together. Woocommerce

Good afternoon! Please help me implement this feature in woocommerce. I have three specific products (with specific IDs 2, 3, 4). I need to make sure that when adding two of them together to the cart, the prices for both of them change automatically. For example, for a product with id #2, the price was set to $ 100, and for a product with id #3, the price became$200. Also, when they are all added together (three of them), the price changed for all three of them: product # 2 = 100; product # 3 =

Woocommerce How to change Add to basket text on the storefront theme

I cannot seem to replace the text inside the Add to basket buttons on the single product pages, im using a child theme with the storefront theme for WooCommerce. Here's what i've tried: add_filter('woocommerce_product_single_add_to_cart_text', 'woocommerce_custom_add_to_cart_text'); function woocommerce_custom_add_to_cart_text() { return __('Add to cart', 'woocommerce'); } How the button appears on the DOM: <button type="submit" name="add-to-cart" value="117&quo

Woocommerce: Which is the name of custom field?

I created a custom woocommerce checkout billing field with the code below. It works fine. Now, I need to get the value of this fiel to print in a page using a shortcode like this: {{nif_cif}}. Problem is that the shortcode prints nothing. (nothing at all) Should I add billing before the name? Like: {{billing_nif_cif}}. The code I use to create the custom field: add_filter('woocommerce_billing_fields', 'custom_woocommerce_billing_fields'); function custom_woocommerce_billing_fields($fields) {

  1    2   3   4   5   6  ... 下一页 最后一页 共 7 页