Query child posts with tax query on parents

My solution to this ended up splitting this into 2 queries: Get the IDs of all the parent products I want to ignore Get all the variations that don’t a post_parent from that list of IDs $archived_products = wc_get_products( array( ‘type’ => array( ‘variable’, ‘variable-subscription’ ), ‘paginate’ => false, ‘limit’ => -1, ‘category’ => array( … Read more

How to customize product at cart page

use this function and edit cart page template /** * Display engraving text in the cart. * * @param array $item_data * @param array $cart_item * * @return array */ function iconic_display_engraving_text_cart( $item_data, $cart_item ) { if ( empty( $cart_item[‘iconic-engraving’] ) ) { return $item_data; } $item_data[] = array( ‘key’ => __( ‘Engraving’, ‘iconic’ ), … Read more

How to neutralize a parent theme php template?

I’m assuming that with ‘neutralize’ you mean de-register or remove, such that WC doesn’t see (or recognize) the file and functions as it would have without the woocommerce.php-file being there. This answer proposes a code in which your child theme (by code) physically deletes the parent theme file. There’s also a questions here that seems … Read more

Shortcodes in billing fields doesn’t work

The “official” answer is that you need to use do_shortcode() to process the shortcode as you can’t just simply apply a shortcode within the code. Here’s your original code with the “official” do_shortcode() way: add_filter( ‘woocommerce_checkout_fields’, ‘set_checkout_field_input_value_default’ ); function set_checkout_field_input_value_default($fields) { $fields[‘billing’][‘billing_city’][‘default’] = do_shortcode( ‘[geoip_detect2 property=”city”]’ ); $fields[‘billing’][‘billing_state’][‘default’] = do_shortcode( ‘[geoip_detect2 property=”mostSpecificSubdivision”]’ ); return $fields; … Read more