WooCommerce single product edit flexslider settings

After a little digging through the source I found there is a filter called woocommerce_single_product_carousel_options that can be used to modify the flex slider options for example: function my_product_carousel_options($options) { $options[‘animation’] = ‘fade’; return $options; } add_filter(“woocommerce_single_product_carousel_options”, “my_product_carousel_options”, 10);

Move payment options at checkout in WooCommerce [closed]

You can customize the checkout page using hooks. To remove the payment options add the following code to your (child)theme’s functions.php: remove_action( ‘woocommerce_checkout_order_review’, ‘woocommerce_checkout_payment’, 20 ); To add it after the order notes use this hook: add_action( ‘woocommerce_after_order_notes’, ‘woocommerce_checkout_payment’, 20 );

WP_Query for WooCommerce Products

<ul class=”products”> <?php $args = array( ‘post_type’ => ‘product’, ‘posts_per_page’ => 12 ); $loop = new WP_Query( $args ); if ( $loop->have_posts() ) { while ( $loop->have_posts() ) : $loop->the_post(); wc_get_template_part( ‘content’, ‘product’ ); endwhile; } else { echo __( ‘No products found’ ); } wp_reset_postdata(); ?> </ul><!–/.products–>

Correct function to get the user’s latest Woocommerce Subscription?

use this code $users_subscriptions = wcs_get_users_subscriptions($user_id); retrieve the data using foreach foreach ($users_subscriptions as $subscription){ if ($subscription->has_status(array(‘active’))) { echo $subscription->get_id(); } } There is some function to access subscription data. like get_id(),get_date(‘end’) (to get last date of subscription ). I hope its help you well.

wc_get_template_part( ‘content’, ‘product’ ) | Where is this file located?

As mentioned in the comments, wc_get_template_part() tries to locate and load the requested template file. These template files could be ether in the /woocommerce/ sub-directory of a child-theme, or defined in another third party plugin (with the help of woocommerce_locate_template filter hook). If none of these exists, WC loads the default template file from /plugins/woocommerce/templates/ … Read more

Query WooCommerce orders grouped by several order statuses

The documentation on wc_get_orders and WC_Order_Query is poor… Now regarding the order status in a WC_Order_Query, you can pass an array of order statuses: // Display “completed” orders count $statuses = [‘completed’]; $orders = wc_get_orders( [‘limit’ => -1, ‘status’ => $statuses] ); echo ‘<p>’ . sprintf( __(‘Count of “%s” orders: %s’), implode(‘”, “‘, $statuses), count($orders) … Read more

Remove Woocommerce product link

The way I’ve done this was to take a copy of content-product.php and paste it into the root of your theme folder. Comment out do_action( ‘woocommerce_before_shop_loop_item_title’ ); and do_action( ‘woocommerce_after_shop_loop_item’ ); Quick and dirty, but it worked for me.

Is it possible to add custom fields to a WooCommerce attribute term? [closed]

Yes, it is possible. And there’s an easy guide here. Below is a working code you can add to the theme’s main functions.php file: // Adds a custom rule type. add_filter( ‘acf/location/rule_types’, function( $choices ){ $choices[ __(“Other”,’acf’) ][‘wc_prod_attr’] = ‘WC Product Attribute’; return $choices; } ); // Adds custom rule values. add_filter( ‘acf/location/rule_values/wc_prod_attr’, function( $choices … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)