How to Get Product Id for especific Producer

asdriel

Member
Apr 26, 2019
198
17
18
www.bantu-2rsn.com
Hello, I have this code and would like to get the product id, so I can pick up the specific products from a producer.

for the solution we are looking for, we think it is better to take a second image every time a product is published, and this image will change according to percentage figures. any help with this solution?


add_action( 'woocommerce_after_single_product_summary' , 'bbloomer_add_below_prod_gallery', 5 );

function bbloomer_add_below_prod_gallery() {
if ( has_post_thumbnail( $product->id ) ) {

echo $product->get_image_id();
}
else{
echo '<span>It's doesn't work</span>';
}


}

with this i can take image, but it's appear for all products and producer

echo '<div class="woocommerce-product-gallery" style="background: #fdfd5a; padding: 1em 2em">';
echo '<span>THIS IS A TEST. YOU CAN ADD TEXT, IMAGES AND ANY HTML</span>';
echo'<img src="http://localhost/meumerkado/wp-content/uploads/2019/06/cesta_background.jpg"';
echo '</div>';
 

About us

  • Our community has been around for many years and pride ourselves on offering unbiased, critical discussion among people of all different backgrounds. We are working every day to make sure our community is one of the best.

Quick Navigation

User Menu