Tag Info

New answers tagged

0

The CSS is coming from Owl Slider :- http://owlgraphic.com/owlcarousel/ You can create a Owl-Theme CSS and use the CSS to override default Owl CSS.You will need to enque your Owl CSS file after Owl Theme CSS is getting loaded.Hope that solves the problem. :)


0

I was able to solve this by using below code. Maybe for some one it is helpful. // Values to be updated $in_stock = '1,5'; $out_of_stock = '20,30'; $in_stock_s = '5'; $out_of_stock_s = '30'; //FOR VARIATIONS // Get variations $args = array( 'post_type' => 'product_variation', ...


1

I finally tried using var_dump() on $item and $_product, which are both used in the email-order-items.php template. $_product revealed a post object, which itself has a post_excerpt property, which looks like it holds the contents of the "Product Short Description" from the WooCommerce product form. So, to add the description beneath the item name, I added ...


0

You can try this $mailer = WC()->mailer(); $mails = $mailer->get_emails(); if ( ! empty( $mails ) ) { foreach ( $mails as $mail ) { if ( $mail->id == 'customer_completed_order' ) { $mail->trigger( $order->id ); } } }


0

First Question: Solved by copying and modifying the "archive-product.php" template file. if(is_product_tag(array('audio'))) : include 'archive-product-audio.php'; // includes custom loop else: // default archive loop endif; Second Question: Solved by simply filtering the Recent Products shortcode via "function.php". ...


0

Would the owner really be ordering/cancelling oders that often? If not just trigger the notification on every cancellation. You could add a check against current user info and so long as its not the owners id - send the notification. Maybe start with this: wp_get_current_user() Or use: global $current_user; Directly. It should not be too hard to ...


1

Another option would be to use the current_screen hook add_action( 'current_screen', 'my_admin_listing_custom_styles' ); function my_admin_listing_custom_styles() { $current_screen = get_current_screen(); if( 'edit' == $current_screen->base && 'product' == $current_screen->post_type) { // Run some code, only on the admin ...


0

You can use the admin_print_styles hook to output custom CSS - in this case I've used the suffix -edit.php (which is the unique hook for the posts table screen). I also check the current post type is product, otherwise the CSS would output for pages, posts etc. function wpse_184211_edit_products_style() { if ( get_current_screen()->post_type === ...


1

I just made it for a client, you'll have to do it on the pre_get_posts action. That means you will add parameters to the Wordpress query before it returns the posts. Add this to functions.php: // advanced search functionality function advanced_search_query($query) { if($query->is_search()) { // category terms search. if ...


0

The b in the serialized string means boolean. So you need to use true instead of one. And serializing it results in double serialization which explains "s:25:" in the beginning. Try this: update_user_meta(46, 'wp_capabilities', array('employer'=>true));


0

Just use the $product parameter to get the custom field value, and determine what to return: function custom_price_html( $price, $product ) { if ( ( int ) get_post_meta( $product->id, 'price_per_person', true ) ) $price .= ' per person'; elseif ( ( int ) get_post_meta( $product->id, 'price_per_group', true ) ) $price .= ' per ...


0

You're creating a string representation of an array, when you need an actual array! $blogusers = get_users(); $options = array(); foreach ( $blogusers as $user ) { $options[ $user->user_email ] = $user->user_email; // No need to pass through __(), don't translate emails! } And then pass it to your options argument: $this->form_fields = ...


1

It's on the Tax settings page and is wp_options.woocommerce_price_display_suffix in the database. Please use the official site for WooCommerce and third-party plugin support, rather than StackExchange.


0

This was happening because of a woocommerce.php file in theme's root folder, that was overriding a lot of stuff, including single-product.php, via woocommerce_content() function. As redelshaap and woocommerce's documentation say, this is not the best way to implement theme compatibility and customization... ...


1

Not sure what the WC_Email class does exactly, but if the $headers argument is an array of headers, then you're almost there. To interpolate a variable value into a string in PHP you don't have to do the <?php ... stuff because it'll be rendered as is. Instead, you can use: $headers = array( "Reply-To: {$order->billing_email}" ); Or: $headers = ...


0

Finally i used the following code and i add category from my plug in. class MyPluginClass { public function __construct() { add_action( 'init', array( $this, 'sample_insert_category') ); } public function sample_insert_category() { if(!term_exists('Test','product_cat')) { wp_insert_term( 'Test', ...


0

Themes can override WooCommerce default template pages, to customize the appearance of those pages easily. There should be a folder within your theme folder called woocommerce. WooCommerce checks for template files within that folder first. If a file doesn't exist there, it loads it's own template file. Edit: If you want to customize those pages, check out ...


1

The syntax for adding an action in WordPress WITHIN a class is somewhat different. Your code will have to look somewhat more like the following... class MyPluginClass { public function __construct() { add_action( 'init', array( $this, 'sample_insert_category') ); } public function sample_insert_category() { ...


0

wc_enqueue_js is not method of $woocommerce object. Just call the function. wc_enqueue_js( file_get_contents( WOO_CK_PATH . 'panel.js' ) );



Top 50 recent answers are included