product

Add content in between product rows in WooCommerce archives

∥☆過路亽.° 提交于 2020-07-13 07:21:00
问题 I want to show some content after the third product (and maybe the sixth, ninth...) of a product category. Not every category has that extra content or the same amount of it. So it should be flexible. I found an example which uses the following code : <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> <?php get_template_part( 'template-parts/content' ); ?> <?php if ( $wp_query->current_post == 1 ) { ?> <div>Put Ad Here</div> <?php } ?> <?php endwhile; endif; ?> I added that

Add content in between product rows in WooCommerce archives

感情迁移 提交于 2020-07-13 07:16:21
问题 I want to show some content after the third product (and maybe the sixth, ninth...) of a product category. Not every category has that extra content or the same amount of it. So it should be flexible. I found an example which uses the following code : <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> <?php get_template_part( 'template-parts/content' ); ?> <?php if ( $wp_query->current_post == 1 ) { ?> <div>Put Ad Here</div> <?php } ?> <?php endwhile; endif; ?> I added that

Add content in between product rows in WooCommerce archives

大憨熊 提交于 2020-07-13 07:13:58
问题 I want to show some content after the third product (and maybe the sixth, ninth...) of a product category. Not every category has that extra content or the same amount of it. So it should be flexible. I found an example which uses the following code : <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> <?php get_template_part( 'template-parts/content' ); ?> <?php if ( $wp_query->current_post == 1 ) { ?> <div>Put Ad Here</div> <?php } ?> <?php endwhile; endif; ?> I added that

Change the product type of an existing product in WooCommerce 3+

偶尔善良 提交于 2020-07-09 05:24:43
问题 I need to change the woocommerce product type after creation with a function in my child theme i have tried this : wp_set_object_terms($product_id, 'variable', 'product_type', true); My method is triggered after creation but the type still unchanged ? 回答1: Since WooCommerce 3, to change the product type from an existing product, you can use the following: /** * Change product type. * * @param int $product_id - The product id. * @param string $new_product_type - The new product type */ // Get

Change product category once the order status get completed

ⅰ亾dé卋堺 提交于 2020-07-07 15:01:11
问题 I want to apply new category to product once the order status get "completed" in WooCommerce. Let's say that the Product is in (category A) and I want to apply (category B) on order status "completed". Is there any way to do this? I found couple of tutorials but don't know how to combine them: https://wordpress.org/support/topic/automatically-add-posts-to-a-category-conditionally https://wordpress.org/support/topic/woocommerce-on-order-complete-insert-quantity-data-into-custom-database-table

Change product category once the order status get completed

懵懂的女人 提交于 2020-07-07 14:55:51
问题 I want to apply new category to product once the order status get "completed" in WooCommerce. Let's say that the Product is in (category A) and I want to apply (category B) on order status "completed". Is there any way to do this? I found couple of tutorials but don't know how to combine them: https://wordpress.org/support/topic/automatically-add-posts-to-a-category-conditionally https://wordpress.org/support/topic/woocommerce-on-order-complete-insert-quantity-data-into-custom-database-table

Change product category once the order status get completed

僤鯓⒐⒋嵵緔 提交于 2020-07-07 14:55:09
问题 I want to apply new category to product once the order status get "completed" in WooCommerce. Let's say that the Product is in (category A) and I want to apply (category B) on order status "completed". Is there any way to do this? I found couple of tutorials but don't know how to combine them: https://wordpress.org/support/topic/automatically-add-posts-to-a-category-conditionally https://wordpress.org/support/topic/woocommerce-on-order-complete-insert-quantity-data-into-custom-database-table

How to show all images in WooCommerce product description

蹲街弑〆低调 提交于 2020-07-07 05:09:51
问题 I want to replace my product description by my description + all product images (include variation product images) in single product page. I can do that with Magento but now when change to Woocommerce I can not. After research I tried with filter hook but not success. I can add text to product decscription but I am stucking how to using functions wp_get_attachment_image_url() or wp_get_attachment_image() . Sample code for display image as I know: echo wp_get_attachment_image( get_the_ID(),

How to show all images in WooCommerce product description

瘦欲@ 提交于 2020-07-07 05:08:28
问题 I want to replace my product description by my description + all product images (include variation product images) in single product page. I can do that with Magento but now when change to Woocommerce I can not. After research I tried with filter hook but not success. I can add text to product decscription but I am stucking how to using functions wp_get_attachment_image_url() or wp_get_attachment_image() . Sample code for display image as I know: echo wp_get_attachment_image( get_the_ID(),

How to show all images in WooCommerce product description

元气小坏坏 提交于 2020-07-07 05:08:18
问题 I want to replace my product description by my description + all product images (include variation product images) in single product page. I can do that with Magento but now when change to Woocommerce I can not. After research I tried with filter hook but not success. I can add text to product decscription but I am stucking how to using functions wp_get_attachment_image_url() or wp_get_attachment_image() . Sample code for display image as I know: echo wp_get_attachment_image( get_the_ID(),