WordPress plugin called “YITH WooCommerce Questions and Answers Premium”, Its data is not showing in REST API’s

I am using a plugin to add questions and answers to Woocomerce products, it works fine on webiste but when I try to get data through API those questions and answers are not in cluded in API. And this plugin is not using any post type so we can get data separately. What i can do now?

WooCommerce – New Product Backend Template for Vendors/Employees

I will be running an online store where employees will need to add new variable products to the store regularly. The variable products would all have the exact same variations and pricing values so I am looking to make this process a little easier on my employees.

Is there any way to have a preset template with variations and prices already entered on the backend when employees go to add a new product?

Woocommerce get_term_by() in transition_post_status hook doesn’t works

Im having this code

$  concours_termine_cat = get_term_by('slug' , 'concours-termine' , 'product_cat'); 

get_term_by is returning false, after debugging the get_term_by function

taxonomy_exists( 'product_cat');  

is returning false.

So I checked in taxonomy_exists function and looks like into $ wp_taxonomies product_cat doesn’t exist at this time of execution.

I call this hook like this add_action('transition_post_status' , 'vince_function_post_update' , 10 , 3);

WooCommerce mini cart fragments click event

I’m trying to add click event to the WooCommerce cart icon. However it doesn’t work I guess because of the WooCommerce Ajax fragments. I want to keep Ajax fragments active and just add click event on the icon.


if ( ! function_exists( 'arendelle_woo_cart_icon' ) ) {     function arendelle_woo_cart_icon() {          if ( ! arendelle_is_woocommerce_activated() ) {             return;         }          $  count = WC()->cart->get_cart_contents_count();         ?>          <div class="arendelle-menu-cart woocommerce">             <a class="arendelle-menu-cart__url arendelle-offcanvas-js-trigger" href="<?php echo esc_url( wc_get_cart_url() ); ?>" title="<?php echo esc_attr__( 'View my shopping cart', 'arendelle' ); ?>">                 <span class="arendelle-menu-cart__icon-holder">                     <i class="arendelle-icon-cart arendelle-menu-cart__icon"></i>                     <?php if ( 0 < $  count ) : ?>                         <span class="arendelle-menu-cart__count"><?php echo esc_html( $  count ); ?></span>                     <?php endif; ?>                 </span>             </a>              <?php if ( 0 < $  count ) {                 echo '<div class="arendelle-offcanvas">';                     echo '<div class="arendelle-offcanvas__panel">';                         woocommerce_mini_cart();                     echo '</div>';                     echo '<div class="arendelle-offcanvas__overlay elementor-clickable"></div>';                 echo '</div>';             } ?>         </div>         <?php      } } 


    cartOffcanvas: function() {         let trigger = document.querySelector('.arendelle-offcanvas-js-trigger');         let panel = document.querySelector('.arendelle-offcanvas__panel');         let overlay = document.querySelector('.arendelle-offcanvas__overlay');           console.log(trigger);          trigger.addEventListener('click', function(e) {             e.preventDefault();             e.stopImmediatePropagation();              console.log('clicked');             panel.classList.add('arendelle-offcanvas__panel--is-open');                  });      }, 

WordPress (not woocommerce) Request A Quote functionality

I’ve seen plugins for WooCommerce that provide Request A Quote functionality (turning their cart into a quote request) as well as plugins that are glorified forms (allowing you to select multiple products while ON the form) to submit a request for.

What would be the best solution (coded or plugin) to allow customers to click a button on item pages (custom post types currently) that would add that item’s data to the main contact form (We’re using Gravity Forms currently)?

I’ve looked through the GF docs and they have ways to programmatically add data to the fields.. but I need it to persist while the customer is browsing other pages on the site.


Ex: Customer goes to four different pages, clicks the ‘Request A Quote’ button (we’ll show an alert after they do, that directs them to the Request Form or allows them to keep browsing). Once the customer is navigated to the Request Form, they see the info for the items (we can scrape the title, item #, etc from the post they click the button on) within the main forms Textarea.

Woocommerce custom script ajax post form data fails to be captured in backend

I am using woocommerce and I wanna customize admin page’s coupon section.

So I use the following code snippet such that I can write my own codes in my_script.js.

add_action('admin_enqueue_scripts', 'add_custom_js_file_to_admin'); function add_custom_js_file_to_admin($  hook) {     $  screen = get_current_screen();     if ( 'shop_coupon' === $  screen->id ) {         wp_enqueue_script('my_script', plugin_dir_url(__FILE__) . 'js/my_script.js');     } } 

I am successful to create a new custom field: Taxonomy as shown in the pic below. And ajax post request’s header indicates that the data should be sent correctly (the red box in the pic). I am

However, my backend code snippet below fails to retrieve the data from the post request ( eg: $ tax below is null):

add_action('woocommerce_coupon_options_save', 'save_coupon_text_field', 10, 2); function save_coupon_text_field($  post_id, $  coupon)     {       $  tax = $  _POST['wc_sc_taxonomy_restrictions[0][tax]'];       $  coupon->update_meta_data('taxonomy_tax', $  _POST['wc_sc_taxonomy_restrictions[0][tax]']);       $  coupon->update_meta_data('taxonomy_op', $  _POST['wc_sc_taxonomy_restrictions[0][op]']);       $  coupon->save();     } 

I got 2 questions:

(1) Can someone kindly share any idea on what’s wrong with my codes above?

(2) In the custom script my_script.js, I wanna call an api which serves to retrieve data from my database; the data will then be used as the options available for the taxonomy’s drop-down select box. Can anyone tell me how I can do so in my_script.js? Normally in my BE php file, I wrote sth like below, yet I don’t know how I can perform sth similar in my custom script:

 global $  wpdb;  $  result = $  wpdb->get_results('some sql here'); 

Change billing fullname with a custom field in Woocommerce emails

I using Checkout Field Editor for WooCommerce to make 25 custom field. I have problem billing_fullname not show in customer details but show in billing address. So i have thinking about a solution that i create another Name custom field.

I will hide my Name custom field using css in the frontend but i wondering how can i copy value in the billing_fullname into my custom field billing_name in the backend

Beside how can i hide billing details in Emails

I try remove some code in admin-new-order.php But when remove customer details remove too

enter image description here

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

I am Using https://stackoverflow.com/questions/46612499/display-a-custom-field-value-in-woocommerce-orders-edit-view/#answer-46615303 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?

Woocommerce sale flash badge not showing in products page [closed]

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.

How to get sale product first on category listing page woocommerce?

I want to sort product on category listing page. Want to display sale product first and remaning product after sale product. I have used woocommerce_get_catalog_ordering_args hook for sorting but not working.

My code looks like this

function catalog_ordering_args( $  args ) {     if( !is_product_category() ){         return $  args;     }      $  args['orderby'] = 'meta_value_num';     $  args['order'] = 'ASC';     $  args['meta_key'] = '_sale_price';      return $  args; } add_filter( 'woocommerce_get_catalog_ordering_args', 'catalog_ordering_args', 20, 1 ); 

It should also work for variation products