Hiding Short Description in Shop Page, WooCommerce

Try using one of the available shop loop item actions and remove call to WooCommerce template function woocommerce_template_single_excerpt using remove_action(). woocommerce_before_shop_loop_item (before thumbnail) woocommerce_before_shop_loop_item_title (before title) woocommerce_shop_loop_item_title (before price) woocommerce_after_shop_loop_item_title (before “Add to cart” button) woocommerce_after_shop_loop_item (after “Add to cart” button) These actions are called in woocommerce/templates/content-product.php. E. g. remove_action( ‘woocommerce_shop_loop_item_title’, ‘woocommerce_template_single_excerpt’ );. Make sure … Read more

Cart page displays the price and amount as zero regardless of price entered [closed]

That’s maybe not really the right anwser, but the way to test if prices are pulled into the cart and the way to recalculate cart totals. add_action(‘template_redirect’, ‘test_cart_values’); function test_cart_values(){ $cart_items = WC()->cart->get_cart(); if(is_cart() || is_checkout() ){ var_dump($cart); foreach($cart_items as $item){ if($item[‘line_subtotal’] == ” or $item[‘line_subtotal’] == 0){ $calculate_once_again = true; } } if($calculate_once_again == … Read more

Add attribute taxonomy through code don’t appear in admin product page

the solution is: foreach ($attributes as $attr => $value) { $attr=”pa_”.$attr; wp_set_object_terms($post_ID, $value, $attr); $thedata[sanitize_title($attr)] = Array( ‘name’ => wc_clean($attr), ‘value’ => $value, ‘postion’ => ‘0’, ‘is_visible’ => ‘1’, ‘is_variation’ => ‘1’, ‘is_taxonomy’ => ‘1’ ); } update_post_meta($post_ID, ‘_product_attributes’, $thedata);

Show product information on right side [closed]

You have to chave line number 12557 in your style.css. Go to your style.css file and search for the code bellow and delete it. .woocommerce #content div.product div.images, .woocommerce div.product div.images, .woocommerce-page #content div.product div.images, .woocommerce-page div.product div.images { width: 50% !important; } Is your theme really responsive? I think your theme have a big … Read more

Delay a function, any function!

You could solve this via WP Cron using wp_schedule_single_event(). However, for this to properly work, you’d need to disable the standard cron (which is run by a user visiting the site) and instead use a proper cronjob/crontab. EasyEngine has a good tutorial on disabling wp-cron and using cronjob instead. An alternative would be solve this … Read more

Is it possible to automatically publish a post once a woo-commerce product is published?

WC products are posts themselves, so you could use: add_action(‘publish_post’, ‘wpse_publish_post_with_product’); Within the new function, you’d have a check for post_type. If the post_type that was just published is a WC product, then grab the image and description from that post, and use wp_insert_post() to publish a Post with the same info. Side note: I’m … Read more