plugin development – query string into woocommerce order

I like to add a extra field from a web query string.
The field is already added with “Checkout Field Editor for WooCommerce”

Now i want to add the table with the following link. Is that possible?

so when the order is done i know where to deliver it.

Woocommerce Custom product fields need to be editable after purchase in View Orders Page

I am Using answer code, which works fine.

I want to display that checkout custom fields on My Account > View Order Pages, to allow customer to edit its value after purchase, so Customers can change and save the custom field value.

Any help?

MaxHost – Web Hosting, WHMCS and Corporate Business WordPress Theme with WooCommerce

Admin submitted a new resource:

MaxHost – Web Hosting, WHMCS and Corporate Business WordPress Theme with WooCommerce – MaxHost – Web Hosting, WHMCS and Corporate Business WordPress Theme with WooCommerce

View attachment 13826


Our custom WHMCS template is compatible…

Read more


Woocommerce categories disable

I want to disable the ability for someone to pick a category when he uploads a product .
Hint : I want only to disable the option to pick a… | Read the rest of

How to access product’s meta data when deleting a WooCommerce product?

`add_action(‘before_delete_post’, ‘removeCheckDetail’, 99, 2 );
function removeCheckDetail( $order_id ) {

global $woocommerce;
global $wpdb;

// $order = new WC_Order($order_id);
$order = wc_get_order( $order_id ); // This Works
error_log(“Starting ” .$order->get_id());

$order_items = $order->get_items();
error_log(“Count: ” .count($order_items)); // Returns 0

// Loop through order line items
foreach( $order_items as $item_id => $item ) {
error_log(“CartItemKey: ” .$item->get_name());


woocommerce offtopic – I need help with storefront theme shop page

I know I might be asking for a huge request and I would appreciate it if anyone can help me with my storefront theme on woocommerce.

I am planning to have a shop page similar to

my current page is (it’s a mess)

so what I actually want is to be able to access the HTML file and add a few divs and grids for the product title and price.

from this

to this

could anyone please help me. I can give you access to the site if needed. Thanks

woocommerce offtopic – Product Variations with Quantity and Add to Cart Buttonns

I am attempting to add an additional section to the content-single-product.php page that displays a table of the possible variations of the product. I am running into an issue with the quantity and add to cart button functionality. Is there a function or action that I can utilize that will allow for me to add the add to cart button with the quantity for each of the product variations? Thank you and advance

  action="<?php echo esc_url(get_permalink($product->ID)).'?add-to-cart='.$id.'&variation_id='.$prod_id.'$attribute_pa_size='.$prod_slug.'$quanitiy='.$_GET('qty'); ?>"  

  <input type='number' inputmode="numeric" class="qty" name="qty" value="1" />
  <button type="submit" class="btn btn--primary ajax_add_to_cart" name="go" value="Add To Cart" />
  <?php echo __('Add To Cart'); ?></button>

wp query – WooCommerce get all products with SKU

I want to get a list of products with sku and post id with this code, everything seems fine and ok with this code :

$statuses = array('publish', 'draft');

// Args on the main query for WC_Product_Query
$args = (
    'status'    => $statuses,
    'orderby'   => 'name',
    'order'     => 'ASC',
    'limit'     => -1,

$vendor_products = wc_get_products($args);

$list_array = array();

foreach ($vendor_products as $key => $product) {

    if ($product->get_type() == "variable") {

        // Args on product variations query for a variable product using a WP_Query
        $args2 = array( 
            'post_parent' => $product->get_id(), 
            'post_type'   => 'product_variation', 
            'orderby'     => array( 'menu_order' => 'ASC', 'ID' => 'ASC' ), 
            'fields'      => 'ids', 
            'numberposts' => -1, 

        foreach ( get_posts( $args2 ) as $child_id ) {
            // get an instance of the WC_Variation_product Object
            $variation = wc_get_product( $child_id ); 

            if ( ! $variation || ! $variation->exists() ) {

            $list_array() = array(
                'sku'      => $variation->get_sku(),
                'postid'   => $variation->get_id()

    } else {

        $list_array() = array(
            'sku'      => $product->get_sku(),
            'postid'   => $product->get_id()


I have total 1660 (470 published and 1,190 drafted) products but it’s just returns 501 products and i don’t know why!

this is my products in woocommerce:
this is my products in woocommerce

this is the final result of query :
enter image description here

php – Woocommerce sale flash badge not showing in products page

the problem that I have is this. I am just helping someone with their woocommerce/wordpress website, I am not very experienced with it but they need some urgent help. Basically, they want to show a badge whenever a product is on sale. I just found the way to do it and it is working fine, but only in the single product page. In the page of a single product, in the related products it shows the badge in the discounted products. But in the general products page it does not show anything.
This is the code I got for the single product pages:

function sales_badge( $text, $post, $product ) {
        return $tagType = '<span class="onsale"><img style="max-width: 150px;" src="sale.jpg"></span>';
add_filter('woocommerce_sale_flash', 'sales_badge', 99, 3 );

For the theme we are using: Astra and Elementor. I have tried everything and in google but could not find anything related with this. FYI: we are not using any plugin for this and we do not plan to.