FAQ Database Discussion Community


Show product's image in “Orders” page - Woocommerce

php,wordpress,woocommerce
I am working with WC for the first time and I am chasing my tail with this one. In "Orders" page where customer's can see all the purchases they've made the array shows some basic info about the order. I need to also show the image of the product the...

How to add user roles dropdown in registration and login woocommerce wordpress

wordpress,woocommerce,wordpress-plugin-dev,wordpress-loop
I have a job site but i want to set drop down with roles i have 2 roles candidate and employer so i want to set a drop down select they roles i am using woocommerce registration and login i want to integrate dropdown with that roles for registration and...

Customize Quantity Selector in WooCommerce Cart

woocommerce,cart,shopping
I am using the Canvas theme from WooThemes, and running the WooCommerce plugin for my e-commerce website. My products are measured in Square Feet, and the order quantities range widely with random numbers of sq. ft. ordered. The units of measure available to me in the WooCommerce cart do not...

Wordpress - Alter the form action url in wp-includes/comments-template.php

php,wordpress,https,woocommerce,comments
I am currently working on a website that is non ssl for the non eCommerce sections, but uses ssl for the woocommerce portion. I am attempting to redirect reviews of products to a thank you page, which I was able to get working just fine on staging. When moving to...

trouble using AFOAuth2manager to generate HTTPSOauthToken

ios,oauth,woocommerce,afoauth2client
I'm building an iOS app where costumers can login (with the same website username and password) into the app and purchase items from the app. The rest api for woo commerce says to use HTTP Basic Auth by providing the API Consumer Key as the username and the API Consumer...

woocommerce redirect after registration

woocommerce
I am trying to redirect user after woocommerce registration. I have tried everything and it is not working. I tried this methods to no avail: http://wtheme.co/wordpress/questions/185926/woocommerce-registration-custom-redirect When I change 'myaccount' to another permalink it just freezes when you click register.. not sure why. wp_safe_redirect( apply_filters( 'woocommerce_registration_redirect', wp_get_referer() ? wp_get_referer() :...

Woocommerce tax calculation with cart custom fees

wordpress-plugin,woocommerce
I have 3 custom fees added to my cart using this code, and it works fine function woo_add_cart_fee() { global $woocommerce; $admin_fees = get_option( 'admin_fees', 10 ); $stamp_duty = get_option( 'stamp_duty', 10 ); $refundable_deposit = get_option( 'refundable_deposit', 10 ); $woocommerce->cart->add_fee( __('Admin Fees', 'woocommerce'), $admin_fees ); $woocommerce->cart->add_fee( __('Stamp Duty', 'woocommerce'), $stamp_duty...

Wordpress & Advanced Custom Fields - Retrieving categories

php,wordpress,woocommerce,advanced-custom-fields
I seem to be having problems retrieving posts/attachments after connecting them to Woocommerce categories while using advanced custom fields. I've tried using the advanced example as detailed here and this is as close as I can get using that example: $images = get_posts(array( 'numberposts' => -1, 'post_type' => 'attachment', 'meta_query'...

Upgrade to Woocommerce 2.3.10 caused checkout to block

php,wordpress,woocommerce
Environment: Wordpress - 4.2.2 Woocommerce - 2.3.10 Woocommerce Product Add-Ons - 2.7.4 WooThemes StoreFront Theme - 1.4.5 I just upgraded to WC 2.3.10 and then tried a test purchase. When I got to the checkout page the checkout area is grayed out (class="blockUI blockOverlay") and you cannot continue the purchase....

How to display quantity in select box in woocommerce

wordpress,woocommerce
How to change the Product Quantity to a Dropdown in WooCommerce WooCommerce by default adds a quantity input box to your product pages where customers can enter quantities, but a lot of times you want to have more control over the quantities and make it more idiot proof on your...

How to control HTML output of variable $image in WooCommerce

wordpress,woocommerce,thumbnails
I'm using WooCommerce and on my single product page I have an overview of the product images. I call the images with the product-thumbnails.php template, but the result conflicts with my CSS because the output of $image adds the pixel size in the HTML. now: <img src="http://example.com/image.jpg" height="480" width="360"> desired:...

Is it possible to edit/customize php code in woocommerce cart and checkout page?

wordpress,woocommerce
Specially wants to change functionality of those pages with custom coding. Example: If any one ask for Buy two and get one free for similar category product, then what would be the best procedure to carry on. With out plugin need solution.

Remove item with $product_id - Woocommerce

php,wordpress,woocommerce
Made a function where the customer get a product added to the cart when they reach a specific amount. Example of when customer reaches level 3 and get the product added. // Bonus products $product_1 = '4751'; $product_2 = '4752'; $product_3 = '4753'; // Get cart value in a clean...

How can I set the Image of woocommerce category as the background of the category title? [duplicate]

php,html,wordpress,woocommerce
This question already has an answer here: How to display Woocommerce Category image? 3 answers I want to set the woocommerce category image as the title background. This is the title line in archive-product.php <h1 class="page-title"><?php woocommerce_page_title(); ?></h1> I wrote <h1 style="background: url(<?php if ( is_product_category() ){ global $wp_query;...

I need to add WooCommerce provided code in my custom html

php,wordpress,woocommerce
I recently purchase Woo Commerce Follow up Email extension and I want to add "Sign-ups, Subscriber Lists, and Email Newsletters" they provide the code [fue_subscribe label="Email:" placeholder="Your email address" submit_text="Subscribe" success_message="You have been subscribed!"] The above code working fine on widgets and post/pages but when I add the code in...

dont allow PO BOX shipping woocommerce not working

wordpress,woocommerce
add_action('woocommerce_after_checkout_validation', 'deny_pobox_postcode'); function deny_pobox_postcode( $posted ) { global $woocommerce; $address = ( isset( $posted['shipping_address_1'] ) ) ? $posted['shipping_address_1'] : $posted['billing_address_1']; $postcode = ( isset( $posted['shipping_postcode'] ) ) ? $posted['shipping_postcode'] : $posted['billing_postcode']; $replace = array(" ", ".", ","); $address = strtolower( str_replace( $replace, '', $address ) ); $postcode = strtolower( str_replace(...

woocommerce conditional products/categories on user role

wordpress,wordpress-plugin,woocommerce
Looking for a plugin that helps me to restrict woocommerce products or product categories based on role. Let's say that I only want to sell bulk products to whole sale buyers. Any help is awesome, thanks!...

CSS help to remove outline

css,woocommerce
Looking for the right css code to remove the outline around the price $489.00 found halfway down the page http://www.korekote.com/epoxy-coating/ I hope someone can help. Thank you, Keith...

is somehow displaying twice

php,wordpress,woocommerce
Woocommerce shopping cart page is acting very strange. I just updated my theme ( X | Theme v3.2.5 ) and woocommerce ( v2.3.8 ) So I am running the most current versions. For some reason, since the update my cart totals are now displaying twice on my cart page. I...

Add product category name on order page in admin

woocommerce
Is there a way to add product category name to the admin order page in Woocommerce? Right now it only display the product name....

How do I get the Product ID in the filter 'woocommerce_product_get_weight'?

php,wordpress,woocommerce
The following code in my functions.php file and does indeed change the weight for all products but I would like to isolate it to a specific product. add_filter('woocommerce_product_get_weight', 'rs_product_get_weight', 10, 1); function rs_product_get_weight($weight) { $weight = 45.67; return $weight; } Is there any way to determine the product ID in...

How to get the value instead of order_id with get_post_meta()

wordpress,woocommerce
I've had the following code to add a custom order field in the woocommerce checkout: add_filter('woocommerce_checkout_fields', 'custom_override_checkout_fields'); function custom_override_checkout_fields($fields) { $fields['billing']['billing_reason_for_purchase'] = array( 'label' => __('Reason for purchase', 'woocommerce'), 'placeholder' => _x('Reason for purchase', 'placeholder', 'woocommerce'), 'required' => false, 'type' => 'select', 'class' => array('form-row-first'), 'options' => array( 'option_1' =>...

how to set different minimum order amount for free shipping for different user roles in woocommerce

php,wordpress,woocommerce
I want to set different minimum order price for different user roles for free shipping. How can I implement it? I am currently using the below code. add_filter( 'woocommerce_available_shipping_methods', 'filter_woocommerce_available_shipping_methods'); filter_woocommerce_available_shipping_methods() function: function filter_woocommerce_available_shipping_methods( $methods ) { global $woocommerce; get_currentuserinfo(); global $current_user; $roles = $current_user->roles[0]; if($roles == '') { $roles...

Troubleshooting Wordpress/Woocommerce custom SQL query for reporting

mysql,sql,wordpress,woocommerce,query-optimization
Hopefully this is the right forum, my question seems to overlap the stack exchange community so this seemed best. I have some custom reports for my WooCommerce orders on my wordpress site. I have one query that is just freezing locally, meaning in my localhost my CPU goes to 100%...

Woocommerce API returns 1, but works

php,wordpress,woocommerce
I'm trying to write my own payment gateway for WooCommerce and it's going pretty well. Now my payment provider can do a callback to verify the payment status, so i created a callback function. add_action('woocommerce_api_'.strtolower(get_class($this)), array(&$this, 'callback')); public function callback() { mail('[email protected]', 'callback ideal', print_r($_REQUEST,true) . print_r($_SERVER,true)); echo '+'; return...

How to remove the quantity field from cart page for specific product attribute WooCommerce

php,wordpress,woocommerce
I need to hide the "quantity" field for specific product in cart.php Here Is my cart.php . WHere the attribute is Color the quantity field should hide. I have try $attributes = $product->get_attributes(); but I failed or I was missing something . I have share the cart Image and my...

How to read data sent by webhooks?

php,wordpress,woocommerce
I have the latest woocommerce plugin, and I have to set a webhook to one of my url. But I am not able to read it in my $_REQUEST and nor in $input = file_get_contents("php://input"); Can someone please help. Thanks....

fetch products if image is found in woocommerce?

wordpress,woocommerce,wp-query
i want to show image only products in woocommerce. My fetch query is given below $args = array( 'post_type' => 'product', 'stock' => 1, 'posts_per_page' => 9, 'orderby' =>'date','orderby' => 'rand' ); $loop = new WP_Query( $args ); how can i get the image products only?...

In woocommerce how to add Participant List on checkout page and show in order detail page

wordpress,wordpress-plugin,woocommerce,wordpress-theming,wordpress-loop
How to add list of participant in check out and show in order detail page. using function and wordpress action and filters

Display a specific form depending on the product category - Woocommerce and Contact Form 7 [closed]

wordpress,woocommerce,category,product,contact-form-7
I'm using Woocommerce and Contact Form 7, and I want to embed a specific form in the product description template, depending on the product's category. In other words, for every product under the category "Shoes", I want a specific form called "Contact Form Shoes" to be displayed in the description...

fabricjs: how to show object size after scaling

javascript,jquery,wordpress,woocommerce,fabricjs
I am using wordpress plugin called "Woocommerce Product Designer" which includes a JavaScript library called fabicjs in version 1.4.9. I need a way to show the width and height of an object in fabric after (or while) I re-scale them. I made some adjustments directly in file fabric-all.min.js: _beforeTransform: function...

WooCommerce Storefront - Why are search results not paginated?

wordpress,pagination,woocommerce
On my WordPress site, I have set up a WooCommerce store, and am using a child theme of "Storefront" for display. I have been trying to figure out why the search results are not being paginated. I'm not even getting all results on one page. I'm only seeing the first...

WooCommerce REST API v2: How to process payment?

rest,woocommerce,payment-gateway
Using the WooCommerce REST API v2, I'm successfully creating an order in a pending, unpaid state. I can see that I can set the order.payment_details.paid field to true which will create the order in a completed state and send out a completed order email, but it doesn't actually process the...

WooCommerce query quantity on product page

php,forms,woocommerce
I have a button that I've added to my product page, and I want to query the quantity in the woocommerce_quantity_input() control. For the life of me I can't find how to do that. I can get $product information, and $cart information, but I can't find how to get the...

Woocommerce Breadcrumbs not displaying full path

woocommerce,breadcrumbs,shop
Working on a woocommerce cart with many categories / sub categories / sub-sub cat's etc. Bread crumbs default to only displaying the Home page, and whatever page your on... its kind of stupid. so if i navigate home/catalog/cat1/subcat1/product. the bread crumbs only display; home/catalog/product... whats the point of bread crumbs...

Wordpress End If Statements

php,wordpress,woocommerce
Apologies, PHP is not my strongest area so this might seem super easy to others. I am trying to implement a statement to say, when there is something in my WooCommerce Cart to show the cart. If there's nothing in the cart then show nothing. The code I have so...

in woocommerce, is there a shortcode/page to view all orders?

wordpress,plugins,woocommerce,shortcode
I'm using the plugin woocommerce for my wordpress site, and need a section where member can see their order history. Are there any shortcodes or page in woocommerce that shows the order history of a member?

“Validation error: PayPal currencies do not match” in WooCommerce

wordpress,validation,paypal,woocommerce,currency
Using WooCommerce and the standard PayPal gateway to accept payments. When testing in Sandbox mode, everything works great. When we test live with a real transaction, payment goes through no problem, but within WooCommerce there is a note as follows: "Validation error: PayPal currencies do not match (code USD). Order...

Wordpress woocommerce - hide flat rate when free shipping

wordpress,woocommerce,shopping-cart
I have one wordpress/woocommerce site. When user cart amount is over 500 i must have free shipping in cart subtotal. Right now i have setup flat rate 25 and free shipping if amount is more then 500. I google it from help and add some code into functions.php but still...

Woocommerce Attributes Pulling data in alpahabetic order

wordpress,woocommerce
My Problem is trying to pull the size attributes for the different products. So, for that i used this php code <?php $terms = get_terms('pa_size'); foreach ( $terms as $term ) { echo "<li>" .$term->name. "</li>"; } ?> The size attributes displaying for the above code should be in alphabetic...

Wordpress ordered by two custom fields meta_key's

php,wordpress,woocommerce
I have a Woocomerce query working with one meta_key ( 'countdown_date' or 'hour' ). It sorts the products by a custom 'meta_key' => 'countdown_date' or 'hour' and orders them using 'orderby' => 'meta_value_num'. I need to join two meta_key's together. ('hour' key only returns the first two ints of a...

Select woocommerce chosen shipping method price

php,wordpress,woocommerce
I'm trying to select the chosen_shipping_method price in woocommerce using this code: $packages = WC()->shipping->get_packages(); foreach ($packages as $i => $package) { $chosen_method = isset(WC()->session->chosen_shipping_methods[$i]) ? WC()->session->chosen_shipping_methods[$i] : ''; } echo $chosen_method; the code works, but it prints the ID, and i cannot figure out how to make it print...

WooCommerce: Change priority of tabs by number of product ratings

php,wordpress,woocommerce
I have this code that set reviews tab to show first before item description. add_filter( 'woocommerce_product_tabs', 'woo_reorder_tabs', 98 ); function woo_reorder_tabs( $tabs ) { $tabs['reviews']['priority'] = 5; // Reviews first $tabs['description']['priority'] = 10; // Description second return $tabs; } Its works fine, But i want to set it to do...

Displaying all woocommerce product liks with title in Footer for SEO - Wordpress PHP

php,wordpress,woocommerce,e-commerce
I am wanting to display all woocommerce products with links with the woocommerce title on the links top help my SEO. I have managed to find some code below which gets the product categories but cant seem to get the code to display all products with the title on the...

woocommerce removing images from archive page

php,wordpress,woocommerce
I have some experience of create wordpress templates... I have a small woocommerce digital download shop and my client wants to remove the images from right across the site. I have managed to remove the images on the single product page by adding this into my theme's function.php removeaction( 'woocommercebeforesingleproductsummary',...

Trying to edit a php file to put it's content within a div

php,css,wordpress,woocommerce
So I have a php script on my wordpress woo commerce site that make the top of the page look like this: And when you click the link, then like this: I want to put the whole content in a div so that I can add a background and border...

WooCommerce - Redirecting a User after They've Reset Their Password

wordpress,redirect,woocommerce
I'm setting up a WooCommerce shop for a client and he has requested that the user be redirected back to the login form after the reset password form has been submitted. Is this possible? Which function controls this? Thanks in advance....

Change the “Ship to a different Address” Checkbox to a String

jquery,wordpress,checkbox,woocommerce
I am currently using woocommerce and I would like to know if it is possible to change a checkbox to a kind of string (anchor with spam, label,..). The page I'm trying to modify is the checkout page. Bellow the billing details the client can click on a checkbox and...

WooCommerce seems to only orderby date and not price

php,ajax,wordpress,woocommerce
I am loading in variable products via a custom WP_Query $args = array( 'post_type' => 'product', 'posts_per_page' => 100, 'product_cat' => 'beast-balls', 'orderby' => 'date', 'order' => 'desc' ); $loop = new WP_Query( $args ); if ( $loop->have_posts() ) { while ( $loop->have_posts() ) : $loop->the_post(); ?> <div class="product-node cat-beast-balls">...

WooCommerce - Checking for brand page

php,wordpress,wordpress-plugin,woocommerce
I'm using WooCommerce on our site along with their Brands add-on to be able to group products together by brand - I know WooCommerce has it's own built in selection of hooks and filters but I want to write a function that checks if I'm on a Brand page or...

Add custom functionality on WooCommerce complete button

php,ajax,wordpress,wordpress-plugin,woocommerce
I've a situation to add some data to the database tables on order status completed button. I can see the url in class-wc-admin-post-types.php Can someone help me for any hook? Or how the admin-ajax.php works? I have to add status to some of mine custom database tables....

Woocommece login URL

wordpress,woocommerce
I have a custom page for login in Wordpress with Woocommerce integrated, and need that when a user click on my-account page, instead of using the login form from woocommerce, redirect to my custom login url. my-account page only must be seen in case the user is logged in,else, I...

WooCommerce – wc_customer_bought_product() or $order->get_items()

php,woocommerce
I am at my wits end. I need to display certain products on customers' account pages based on their subscription. Example: If a customer subscribed to Product #517, but then switched to Product #5910, I want their emails and account page to show the data ($menu_listing) associated with #5910. In...

woocommerce products category order

php,wordpress,woocommerce
I have created a template and I'm using the code to show the product categories on a page: <?php $wcatTerms = get_terms('product_cat', array('hide_empty' => 0, 'orderby' => 'ASC', 'parent' =>0)); //, 'exclude' => '17,77' foreach($wcatTerms as $wcatTerm) : $wthumbnail_id = get_woocommerce_term_meta( $wcatTerm->term_id, 'thumbnail_id', true ); $wimage = wp_get_attachment_url( $wthumbnail_id );...

How can I sort woocommerce grouped products by post date instead of menu order?

php,wordpress,filter,woocommerce,hook
What code/filter can I add to my wordpress functions.php file to modify the order of grouped products by post date instead of menu_order? class-wc-product-grouped.php $args = apply_filters( 'woocommerce_grouped_children_args', array( 'post_parent' => $this->id, 'post_type' => 'product', 'orderby' => 'menu_order', 'order' => 'ASC', 'fields' => 'ids', 'post_status' => 'publish', 'numberposts' => -1,...

How do I get items categories from the WooCommerce cart?

php,wordpress,woocommerce
I am writing the function which should check up whether there is in the cart an item, which has a particular category. My idea was: add_filter( 'woocommerce_package_rates', 'remove_flat_rate_from_used_products', 10, 2 ); function remove_flat_rate_from_used_products($rates, $package) { if( is_woocommerce() && ( is_checkout() || is_cart() ) ) { if( check_whether_item_has_the_category() ) { unset(...

Listing Product Attributes in Alphabetical Order (Woocommerce)

php,wordpress,attributes,woocommerce,product
For starters thank you for taking a look / any assistance you may offer. I am trying to create a custom page template that creates a list in alphabetical order displaying all the results for a specific (Woocommerce) product attribute across my site. So in my case the product attribute...

How to display grouped products in a list with quantity in woocommerce?

wordpress,woocommerce
I want to change the way grouped products are shown by two different versions of wordpress. case 1: Wordpress 4.1.5 running WooCommerce 2.3.11 with custom theme. case 2: Wordpress 4.2.2 running WooCommerce 2.3.11 with default theme. I need to display grouped products (child products) in a tabular form with quantity...

How to set woocommerce checkout form values to empty

wordpress,wordpress-plugin,woocommerce
I am using Woocommerce plugin for a WordPress site. But when as user I checkout I can see form populated with last user's details. How to set form entries to blank in Woocommerce. Please help. Fields are pre-populated with last user's detail. Is there a way to avoid this?

Woocommerce add to cart and login button not working, quantity button missing

wordpress,woocommerce
I am facing annoying issues with woocommerce. First, nothing happens anymore when I click on my 'Add to card' button from the content-single-product page. The button becomes disabled but the product isn't added to cart (even if I can see its id in hidden input). I tried to update both...

WooCommerce display product categories in product title

php,wordpress,woocommerce,taxonomy
I have a Wordpress (version 4.2.2) eCommerce site running WooCommerce (version 2.3.8). On my individual product page I wish to set the title of the product to also include the custom categories I have created in WooCommerce and that this product belongs to. I find the following file (wp-content/themes/mytheme/woocommerce/single-product/title.php) that...

WordPress - Failing to override woocommerce templates

wordpress,templates,woocommerce,override
I am trying to override Woocommerce's templates files by duplicating them in my custom theme directory / woocommerce / templates, but the changes don't appear (I tried simply adding classes to begin with) on the website. Is there something I am doing wrong ? Thank you for your concern....

Wordpress woocommerce weird problems

php,wordpress,plugins,woocommerce
First of all, thank you for bothering to read this topic, I feel like this is going to be a long and painful one, as I'm trying for about 7-8 hours now to get what the hell is happening with this plugin. I am a developer, so I know what...

How to change woocommerce checkout page payment mode options?

wordpress,woocommerce
I am working on wordpress with woocommerce. Now i would to change the woocommerce checkout page payment method options that is radio to dropdown. Currently all my payment options are displaying in radio button option now i would like to change radio buttons into select options. ...

Add second single product page in Woocommerce

wordpress,woocommerce
Is it possible to add a second single product page in Woocommerce? So basically when I am at the single product page I click the "next" button and I get directed to the same single product page with another template. So I just want to retrieve the same data on...

making a class apply to only category pages

css,wordpress,woocommerce
The following class I need to only work on archive (category) pages. .woocommerce ul.products li.product a img {width:78.5%!important; padding:10% 10% 10% 10%;} If I add it like that it makes other pages go wrong (they need to be 100%). I only want it to work on pages where the body...

What is wrong with the way I am passing arguments to get_tags()?

php,wordpress,woocommerce
This bit of code has been giving me a problem. Here's the snippet in question: ... strip_tags($product->get_tags(array('order', 'DESC'))) ... Which should produce a reverse alphabetical list of tags from the product, however, something entirely different comes up on the front-end. While get_tags() does work without arguments, as soon as I...

Woocommerce : Replace ' Product Categories ' by ' Short Description ' on Product Page

wordpress,wordpress-plugin,woocommerce,product
In the product page, each product has an image, and below two sub caption : the title and a link to the product categories. I'd like to replace this product categories field with the short description of the product. I had a look at every php file in the woocomerce...

$order_id earliest hook function before payment

php,wordpress,woocommerce
I am writing a plugin for woocommerce which needs the order ID before the users go to paypal and pays. I tried to get this information with several hooking on actions but all the time I get that $order_id is nothing/0. It seems that I hooked it too early, before...

Woocommerce Filter Product by Attribute

filter,attributes,woocommerce,product
I've been searching for many blogs and forum but this seems not yet answered yet. So i am trying to find a way how to filter product by attribute. I am using ajax to pull data and append it.The question is what will be the query to make a loop...

Woocommerce hide payment gateway for user roles

php,wordpress,woocommerce
Hey guys I have a cash on delivery payment method on my wordpress/woocomerce website that I want to hide from the customer user role and non-logged in users. I've been searching up and down and the only thing I found close was this bit of code. function paypal_disable_manager( $available_gateways )...

Changing “add to cart” link with custom url in WooCommerce

php,wordpress,woocommerce
I want to use WooCommerce but instead of buying from the site, the visitor will be redirected in Amazon. I want to change the "Add to Cart" href attribute with a URL specified in each product as a special attribute. I managed to get this working but the code seems...

How to display Woocommerce product price by ID number on a custom page?

wordpress,woocommerce,product
I'm trying to display a price of a product in Woocommerce, on a custom page. There is a short code for that, but it gives product price and also adds an "Add to cart button", I don't want the button, i just want to get the price of a specific...

WooCommerce - Display categories and its products on front page

php,wordpress,woocommerce
when the user visits my shop homepage he sees all the products which are in the shop. I want to change the view, so that the user sees: - Category 1 Products of cat 1 - Category 2 Products of cat 2 How can I achieve this? I looked in...

Woocommerce simple filter php

php,wordpress,woocommerce
My php skills is very low. I need some help this this function. What it should do: When a order is marked as "failed" it should redirect to the woocommerce cart with an error message. But problem is that this code redirect ALL status to the cart with the error...

WooCommerce - Change the shop page layout but keep the archive-product.php

php,wordpress,woocommerce
I am new to WooCommerce and I am trying to build a shop using my custom theme created from scratch. The home page is a static page (custom template) just giving details about the shop . I created a folder in my themes folder named woocommerce and copied the template...

How to store the_title() into a variable to reutrn the value, not just echo it

php,arrays,wordpress,variables,woocommerce
I have a loop, and need to pass one more argument through it. I need to get the current page's single post title, and then use that as the value. I tried going about it like this: $tagz = the_title(); $args = array( 'post_type' => 'product', 'posts_per_page' => 5, 'product_tag'...

Styling woocommerce description

html,css,wordpress,woocommerce,styling
I'm creating this site http://pmgoalkeeperacademy.com/wordpress/ and am running into a big problem! There is 2 descriptions in the "Product" page, 1 above the tabs and 1 inside the tabs. I need to get the text color in the "tab" section to black. I have found out that if I change...

WooCommerce: How to display Category Name in single-product.php

php,wordpress,woocommerce
How can I display the category name in single-product.php? In archive-product.php the code is: <?php woocommerce_page_title(); ?> but what could I use to show the category name in the single-product.php that belong to the category?...

Adjust price if addons are set

php,wordpress,woocommerce
Hi i have woocommerce addons plugin in my wordpress shop, for users to choose a weight and calculate the price upon the weight, i have this code that adds the main price to the price of KG, For example the cake costs 100$ per kg in Cart it shows 700$...

Wordpress - customized pages with blocks - prohibit google seo index of blocks

wordpress,seo,woocommerce,robots.txt,google-sitemap
I'm using Wordpress and WooCommerce for my online shop. With the theme I'm using you can customize the product-category pages by adding "blocks". So if I want to have a text on the top of a product category page I simply create a block page, lets say its called "category-info"....

How To check Product Have Variation in woocommerce

php,wordpress,woocommerce,product
Is there any way to check the product has variation something like Please help me. <?php If (product has variation) { echo"This Product have Variations "; } else { echo "This Product does not have Variations "; } ?> ...

Searching for values in JSON array w/ stdClass subarray

php,arrays,json,woocommerce,stdclass
This JSON snippet is part of a WooCommerce order, extracted from the APIv2 get_order() function. The [meta] holds product variation data chosen by the customer. [meta] => Array ( [0] => stdClass Object ( [key] => pa_size [label] => Size [value] => Large ) [1] => stdClass Object ( [key]...

PHP date not taking into account AM/PM properly

php,wordpress,woocommerce
I have a booking system based on Woocommerce and the Woocommerce Bookings plugin. This means essentially I don't have control over the format of the data given to me. At the end of the checkout process I am given a start date and duration for the booking, and I need...

Woocommerce change product style and display it on a page

wordpress,woocommerce,woothemes
Sorry in advance for my approximative english. I would like to change product page style on woocommerce for a specific product category (don't display pictures and some other important layout changes). Already made it and it works, the problem is that I would like to display these products on a...

How get variation's stock quantity woocommerce

php,woocommerce,stock,variations,variation
I'm developing a theme for wordpress and woocommerce. I need show variation's stock. <p class="stock-m13"><?php echo $product->get_stock_quantity(); ?></p> (here: How to get the stock quantity of an article from woocommerce?) but this code only show me the global stock quantity, not each variation quantity. I need another function to get...

Woocommerce Return False with message

php,wordpress,woocommerce
I am using a function to remove the ability to purchase a product if its price is equal to, or greater than £50,000. I would like to add a message where the add to cart button usually is, to say "this product is over £50,000 - please contact us" add_filter(...

Custom WooCommerce Gateway

wordpress,wordpress-plugin,woocommerce
I`m trying to develop a custom payment gateway for WooCommerce plugin, but I have a problem with the checkout page. What I want is to insert a form on the checkout final step page that is submitted automatically after 5 seconds. My code is: ... add_action('woocommerce_receipt_' . $this->id, array($this, 'receipt_page'));...

Woocommerce product dimensions not showing on first product

php,html,wordpress,web,woocommerce
I am using Wordpress with Woocommerce and would like the shop and archive pages to show the product dimensions along with the price and title of the product. I added this code to my content-product.php woocommerce file: http://docs.woothemes.com/document/display-product-dimensions-on-archive-pages/ Which worked great! Except for the first product in the shop loop....

WooCommerce orders page add customer role custom column

php,wordpress,woocommerce
I want to add column to show the customer role on the WooCommerce orders, I search and everything I found is for one user. I also found this code on this link (WooCommerce show custom column) but I do not understand where I put what I need. I also found...

woocommerce - make order notes required

wordpress,woocommerce
is it posible to make woo 'order_comments' field required - and show message If the field is not filled I have tried the following code but I can not get it to work. add_action('woocommerce_checkout_process', 'my_custom_checkout_field_process'); function my_custom_checkout_field_process() { // Check if set, if its not set add an error. if...

woocommerce_add_order_item_meta hook sending only one argument; three expected

wordpress,woocommerce,wordpress-plugin-dev
I am using WC v. 2.3.9. woocommerce_add_order_item_meta gets fired but my callback function only gets one parameter, three expected. I want to add order item meta at the creation of the order. Is this hook really available? Some rumour say that it's deprecated. Edit : after a few research it's...

Woocommerce empty cart button. “Are you sure?”

javascript,popup,woocommerce,cart
I have added an [empty cart] button to my Woocommerce cart page. Great. I would like to add a pop up to ask the user "Are you sure?" In case they shop for two hours, and then hit this button by mistake. I think this is custom JavaScript here. Lets...

Hide meta data from Order Items on Admin Order Page (WooCommerce)

wordpress,woocommerce
I am using some custom Item Meta for products sold on my WooCommerce store. I am looking for a way to hide the item meta from showing up on the Admin Order page, under the order items section. I am using underscores for the meta name, however the meta is...

Return all args used in query_posts for use in another WP_Query

wordpress,woocommerce,wp-query
I'd like to grab all the args that were passed to the original query_posts (main loop) and be able to modify them for use in another secondary loop. For example, if the main loop passed a whole bunch of args, I'd like to grab them all, modify one of the...

Greying out out-of-stock product variations (WooCommerce)

woocommerce,product
[EDIT: it actually works when adding the code in functions.php and omitting the changes in code WC files. Important: it only works when ONE attribute exists. However when there are 2 attributes (size & color for instance) then it doesn't work because it's not about out-of-stock variations anymore but about...

How to avoid the product's limit for taxonomy in WooCommerce?

php,wordpress,wordpress-plugin,woocommerce,wordpress-plugin-dev
Recently I'm faced with an interesting effect which seems to go with default settings. When you just display products in mixed order it's ok, but when you're trying to create custom category for them - there are I'm getting the limit for loop: only 12 products are displayed in tab...

How to I display these radio buttons horizontally?

html,css,wordpress,radio-button,woocommerce
I have the following table for product variations from woocommerce. Does someone have an idea how i can display these horizontally? I've looked through several different forums but so far none of my attempts have worked. It concerns the woocommerce product variations. They are being displayed as radio buttons instead...

How to add product to cart with product attributes and quantity?

php,wordpress,woocommerce
I tried to search some articles on the google but they mentioned to variation products and I don't know what they are. I'm only want to add product to cart with product attribute (or multi attribute) and quantity. I tried this url <?php echo home_url('/cart/?add-to-cart='.$product->id.'&attribute_mau-sac=#425f70'); ?> for "a" element but...

Show product-category thumbnails in loop which have n price of products in woocommerce

php,wordpress,woocommerce,category
I want to show category thumbnails in loop which has n price of products. Here n price will put from admin panel where a amount will fill and that products-category thumbnail will appear on a page which having that amount or greater than that amount of products. so please help...