WooCommerce subcategories help

<div class=”col-sm-3 col-sm-pull-9 sidebar”> <div class=”list-group products box”> <h4>Product Range</h4> <?php $terms = get_the_terms( $post->ID, ‘product_cat’ ); foreach ( $terms as $term ){ $category_name = $term->name; $parent_category_id = $term->term_id; $categories=get_categories(array( ‘parent’ => $category_id )); $children = get_terms( ‘product_cat’, array( ‘parent’ => $parent_category_id, ‘hide_empty’ => false ) ); foreach( $children as $subcat ){ ?> <a href=”https://wordpress.stackexchange.com/questions/315072/<?php … Read more

How can I add another row to the total field in WooCoommerce cart, checkout and recipe mail?

Its too late but it can still help to others who are looking for the same : Copy “plugins\woocommerce\templates\cart\cart-totals.php” to “your-theme\woocommerce\templates\cart\cart-totals.php” Open “your-theme\woocommerce\templates\cart\cart-totals.php” and add the following line inside the table tag <?php do_action( ‘woocommerce_cart_totals_custom_text’ ); ?> Then open your function.php and add the following: add_action( ‘woocommerce_cart_totals_custom_text’, ‘action_woocommerce_cart_totals_before_shipping’, 10, 0 ); function action_woocommerce_cart_totals_before_shipping( ) { … Read more

How to echo a PHP code into WooCommerce variation product?

I solved the issue, what i was missing is to convert the API return to string, here is the code hopefully it helps someone. <?php add_filter( ‘woocommerce_available_variation’, ‘custom_load_variation_settings_products_fields’ ); function custom_load_variation_settings_products_fields( $variations ) { // duplicate the line for each field $variations[‘wccaf_de_asin_var’] = get_post_meta( $variations[ ‘variation_id’ ], ‘wccaf_de_asin_var’, true ); $variations[‘wccaf_uk_asin_var’] = get_post_meta( $variations[ ‘variation_id’ … Read more