last day (14 days later) » 

1:19 PM
0
A: Wordpress Woocommerce product shortcodes

Spiky ChathuBelow code will get the 10 products which are in grammer category and status is published. May be this will help. <?php $args = array( 'post_status' => 'publish', 'post_type' => 'product',, 'meta_value' => 'yes', 'posts_per_page' => 10 'product_cat' => 'grammar' );...

 
so how will that show any of the product information?
 
I thought you are already in a woocommerce product loop. I think what you need is to retrieve some products from specific category and display it with description where ever you want. I will update the answer
 
Thanks man, unfortunately not, this is a little advanced for me its the first time iv worked with woo commerce. If you could update the answer that would be fab.
It's telling me there are syntax errors on that script you have provided :(
 
In which line you get the error?
 
echo apply_filters( 'woocommerce_short_description', $post->post_excerpt ) // product short description echo the_title(); //product title
 
1:19 PM
Answer updated. checked and its working fine
 
I am getting loads of errors now, i will update my question and show you.
 
Strange. Tell me did you change 'product_cat' => 'grammar' to your own category name? Also are you trying to get featured products?
 
I did indeed. you see in my updated question, I am placing you php where its saying 'Item description to go here!!!!'
 
Do me a favour. juse add print_r(product) after $product = get_product( $product_query->post->ID ); and check whether data is in the array
 
im getting this 'product151' in a long string reoccurring so it isn't stopping
My only product I have is ID: 15 which im testing this against form that category.
 
1:19 PM
ok can you give me the long string which you got. so that I can check little bit deep.
 
It is jusr this 'product151product151product151product151' reoccurring
 
ok. I think we need to debug it little bit.
 
Hey
 
hi
ok. I think we need to debug it little bit. add print_r($product_query); after $product_query = new WP_Query( $args ); and tell me the result
 

last day (14 days later) »