Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [woocommerce]

OFF TOPIC. Questions *specific* for this e-commerce plugin have their own forum at https://wordpress.org/support/plugin/woocommerce.

1
vote
2answers
24 views

How to upload multiple image using wp_insert_post

Im using wp_insert_post to add products on the front end of a woocommerces site My current code will upload all the images but only the last image will be in the product gallery images heres my code;...
0
votes
0answers
23 views

full backup woocommerce cart content and restore it [closed]

how get full backup of woocommerce cart and restore it? I get cart backup with this code: $cart = WC()->cart->get_cart_contents(); or $cart = WC()->cart->get_cart(); for restore I use ...
0
votes
1answer
8 views

Filter default_content only for products

Is there any way to use default_content only for a certain post type, specifically product (WooCommerce)? My code: add_filter( 'default_content', 'set_default_content', 10, 2 ); function ...
0
votes
0answers
15 views

Woocommerce. Find parent products by meta value of the children

There are grouped products. Tours / Excursions. Every parent product has children. Children products have custom meta - wt_start and wt_expired (dates of start and end of the tour) I'm trying to ...
0
votes
0answers
10 views

Dynamic Population from WooCommerce

I've been trying to add some pre-population to a sample page using WooCommerce. I want the users to be able to click through the 'Request a sample' button and have the drop-down boxes filled based off ...
0
votes
0answers
21 views

Clean URLs get changed to GET parameters based URLs on save

I am working on a multilingual Wordpress website with WooCommerce based on the Orgafresh theme, and I am running into an issue that I can't for the life of me figure out how to fix. Every time I save ...
0
votes
1answer
24 views

How to display products in sidebar in 2 columns?

I would like to put products view to sidebar on each blog page. However, it prints 3 columns by default which does not really look nice: I tried these approaches: 1) Editing functions.php of my ...
0
votes
1answer
22 views

Unable to enocde the result of wc_get_products

I am using the following code to get the best selling products and send the result in JSON. But I am unable to encode the result of wc_get_products(). $best_selling_args = array( '...
0
votes
1answer
18 views

Populate tests database with products

I am trying to test my plugin which uses WooCommerce products, for that I need to populate tests database with dummy product during tests. How can I do it like WordPress itself populating posts table ...
0
votes
0answers
24 views

ACF in Woocommerce edit account page

I have created a field group and i've set to "Show this field group if user form is equal to All". I have a select field and a text field. In woocommerce registration page this field group displays ...
-1
votes
0answers
11 views

yith points and rewards with facebook registering

I have an issue regarding the facebook registration plugin and the yith points and rewards plugin. Whenever i register using facebook the account is succefully created but it does not add points to ...
0
votes
0answers
6 views

Woocommerce Subscribe all things - showing subscribe options twice on product page by variable product

After researching for hours, I still cant find a solution to my problem. Aftercerating a variable product and adding a subscribe option I see the follwoing twice on the product page: - one time ...
-1
votes
1answer
31 views

Hide/show specific products for backend users in woocommerce

i have 5 customers who use the same shop in woocommerce. These 5 customers can enter the backend and see there products (but also the products of each other) in the catalog - I want now to hide ...
0
votes
1answer
22 views

Removing Product from Woocommerce checkout page using Ajax

I have added remove button for products in the checkout page. The code - function add_delete( $product_title, $cart_item, $cart_item_key ) { if ( is_checkout() ) { /* Get Cart of the ...
0
votes
1answer
23 views

Wordpress post_content gets deleted in cron after wp_update_post

I'm developing a Wordpress plugin (integrated with WooCommerce) that fetches HTML Content from an API, and add it to a WP Post as post_content into an iframe, this way: kses_remove_filters(); $...
0
votes
1answer
45 views

WooCommerce - Global $product is returning value null

My code is: function sync_on_product_save($new_status, $old_status, $post) { global $post; global $product; if( $old_status != 'publish' && $new_status == '...
0
votes
0answers
14 views

Fetch WooCommerce popular product via REST API

I need to fetch the popular products via REST API. I searched the WooCommerce REST API documentation but could not find it.
1
vote
1answer
31 views

Move WooCommerce product tabs out of the tabs [closed]

I want to have the product tabs out of the tabs section and put them one down the other with no need of having the tabs functionality. I can unset the tabs add_filter( 'woocommerce_product_tabs', '...
0
votes
0answers
50 views

WooCommerce Add To Cart button not working (JS problem?)

I'm having a terrible issue a few hours before platform opening! Please help. I don't know why, but yesterday evening the ADD TO CART BUTTON stopped working, while some days ago it worked perfectly. ...
0
votes
0answers
21 views

how to get order item discount price woocommerce

I am using woocommerce to display my woocommerce order items in a custom page. I have the following values: order single item price which is $item->get_total() / $item->get_quantity() order ...
0
votes
1answer
16 views

How can I locate where the actions are defined? [duplicate]

Given the following code: <form> <h1> My form <h1> <input type="text" /> <?php do_action( 'woocommerce_checkout_after_customer_details' ); ?> </form> ...
0
votes
0answers
16 views

WooCommerce Category Page - How to display a single category under products? [closed]

In WP in the WooCommerce plugin, i've added my products to a main category (seating, tables, ceramics etc.) and another category for the designer who made it. On the product category page, I am trying ...
0
votes
0answers
10 views

How can I get postal using GeoIP?

WooCommerce: 3.5.1 WordPress: 4.9.8 GeoIP Detection plugin 2.9.1 https://ru.wordpress.org/plugins/geoip-detect/ I need to set the postal code value from GeoIP into billing or shipping fields in ...
0
votes
0answers
20 views

WooCommerce REST API error

I am trying to use the WooCommerce REST API. I have just started by following the instructions from the docs. I have tested with the sample code. I have created a consumer key and secret, this is just ...
0
votes
0answers
10 views

Woocommerce - How can I get a list of all hooks from the product page in admin?

Is it possible to load a list of all available hooks from product in admin or at least those used by current theme?
1
vote
0answers
18 views

How can i manage total price in checkout page? [closed]

This is the situation: I charge my clients with 5€ for shipping just if his total ammount is under 60€. I got checkout-addons plugin installed I got an add on that charges 15€ for an additional ...
0
votes
1answer
33 views

Shortcodes in billing fields doesn't work

WooCommerce: 3.5.1 WordPress: 4.9.8 I want to set automaticly billing fields with data from GeoIP shortcodes, but it doesn't work. add_filter( 'woocommerce_checkout_fields', '...
-1
votes
1answer
71 views

WooCommerce shipping tab is not working admin side

WooCommerce shipping tab is not working. When I click to Setting > Shipping, the link is not working. I am using the latest WooCommerce plugin An error is Secure Connection Failed http://prntscr.com/...
0
votes
0answers
16 views

WooCommerce - Product remains in Cart after Checkout. Using Timber, Twig and WooCommerce

We're experiencing an issue with our WooCommerce subscriptions website wherein a product stays in the cart after completing purchase. ie User adds product to cart User follows checkout process ...
0
votes
0answers
20 views

Coupon Codes for product discount combined with conditional free shipping

I have done some research on product discount coupons that also allow conditional shipping discounts when I was approached with the following request: “We are going to provide customers with a coupon ...
0
votes
0answers
18 views

Add Cart Item meta data based on other items

I use the following function to show the discount in the cart if a product in the cart is on sale: function my_custom_show_sale_price_at_cart( $old_display, $cart_item, $cart_item_key ) { /** @...
0
votes
1answer
37 views

Woocommerce - disable «place order» until user checks Privacy Policy

I've added a checkbox on the checkout page by using this : add_action( 'woocommerce_review_order_before_submit', 'add_privacy_checkbox', 9 ); function add_privacy_checkbox() { woocommerce_form_field( ...
-2
votes
1answer
36 views

Override WooCommerce files from plugin

I want to display my custom template for Single Product i.e. single-product.php For WordPress native templates, we can use add_filter( 'single_template', 'custom_single_tmpl' ); and a callback ...
0
votes
1answer
17 views

add_post_meta on subcription renewal

I'm able to add/edit custom fields after a user completes an order with the add_action('woocommerce_thankyou', 'function_name_here', 10, 1); hook. Does this also apply when a subscription auto renews ...
0
votes
1answer
33 views

WooCommerce add_to_cart

I'm creating a WooCommerce product programmatically (Create product via CRUD) and wants to add it to its cart. Code I'm using is marked as legacy (WC_Cart) $cart = new WC_Cart(); $cart->...
1
vote
2answers
46 views

Plugin vs Settings load order (woocommerce dependency)

I am developing a Woocommerce dependent plugin which works, and a settings page which behaves funky and throws a Class 'WC_Settings_Page' not found Fatal Error if ( !defined( 'ABSPATH' ) ) {exit;} ...
0
votes
1answer
60 views

Redirect woocommerce single-product page

My question conserns the Woocommerce plugin. As you know we can create a custom single-page.php within our theme provided it is inside woocommerce subfolder. What I need is the ability to have the ...
0
votes
0answers
16 views

Ajax Cross-sell optional extras below single product description

Screenshot below isn't Woocommerce, but id like to replicate the functionality of the "optional extras". What is the best way to accomplish this? Having a list form of "cross sell" products under ...
-1
votes
0answers
16 views

add_to_cart_url shortcode adding another product on refresh

I am currently displaying an 'Add To Cart' button in WooCommerce for a variation using a shortcode like this... [add_to_cart_url id="746"] This is working correctly, but now if the customer clicks ...
0
votes
0answers
16 views

Rich Snippets woocommerce

I have noticed that when searching for products on Google, a lot of results contain -pricing -Stock status -ratings etc... I have been trying to add this to my store and have tried different ...
-1
votes
0answers
29 views

How can I add a transaction type custom field to WooCommerce order?

I am developing a custom payment method for WooCommerce. My code is as follows: class WC_Gateway_Custom extends WC_Payment_Gateway { public $domain; /** * Constructor for the gateway. ...
0
votes
0answers
16 views

Woocommerce sort by dropdown menu not working on divi theme

I'm trying to add the default sorting menu to the shop pages on this site: www.trulybritishwants.com I'm using the Divi theme, which uses woocommerce. I tried to add the below in the functions.php ...
0
votes
0answers
20 views

Make variation stock quantity appear when clicked on dropdown

Currently this is what it shows in our site with the current code: enter image description here The current code shows all the stocks before even clicking on any of the variation/sizes. What our ...
0
votes
1answer
83 views

Remove “Choose An Option” on Product Variation & Auto Select Instead

I have a specific dropdown field on variable products on my WooCommerce site that only ever has one option available. Example: the customer chooses the item “type”, then “color”, and finally “part ...
0
votes
0answers
19 views

Woocommerce checkout field autocomplete and delivery by city

I am trying to implement a customized delivery option given by the city the user has chosen. In order to do so, I started with adding a basic js autocomplete on a closed list of cities, The problem ...
0
votes
0answers
21 views

Remove Addon amount on WooCommerce checkout - WC Gravity Forms Addon

I can not figure out how to remove price of variation from checkout review (and checkout ppage) on WooCommerce. I used Gravity Forms WC Product addon, and now I have something I don't want or need on ...
0
votes
0answers
17 views

Enable add to cart for specific category when the cart is not empty

By making use of the answers found in this post I managed to disable the "add to cart" button for my accessories product category. add_action('wp','disable_accessories'); function ...
0
votes
1answer
57 views

WooCommerce Template overriding not working with woocommerce.php

I am creating a custom theme with my own HTML. I am trying to override woocommerce template. I have created a template named with woocommerce.php but it still shows template with default structure. I ...
0
votes
1answer
29 views

How to neutralize a parent theme php template?

I use to work a basic theme with a child-theme. The parent theme contains the woocommerce.php template, which I would like to disable in the child theme. I already used several codes in the child ...
0
votes
0answers
25 views

Woocommerce Custom Search based on category not showing

Here i am explaining perfectly. I have created a custom search with category in woocommerce. It was working fine but has an issue. I am having a product which has two category. 1. Women 2. Accessory. ...