MultivendorX
-
AuthorPosts
-
-
April 8, 2023 at 7:27 PM #190549l.ganParticipant
Hello
Thanks for the great support!Please tell me, I’m using the code to transfer the tab from “More offers”.
How can I display the rating of the product itself instead of the store rating?
Thank you
add_action(‘woodmart_after_product_content’,’single_product_multi_vendor_single_product’);
function single_product_multi_vendor_single_product(){global $woocommerce, $MVX, $post, $wpdb;
$product = wc_get_product( $post->ID );
$more_product_array = $mapped_products = array();
$has_product_map_id = get_post_meta( $product->get_id(), ‘_mvx_spmv_map_id’, true );
if( $has_product_map_id ){
$products_map_data_ids = get_mvx_spmv_products_map_data( $has_product_map_id );
$mapped_products = array_diff( $products_map_data_ids, array( $product->get_id() ) );
$more_product_array = get_mvx_more_spmv_products( $product->get_id() );
}
$single_pro = $product;if(isset($more_product_array) && is_array($more_product_array) && count($more_product_array) > 0) {
foreach ($more_product_array as $more_product ) {
$_product = wc_get_product($more_product[‘product_id’]);
?>
<div class=”row rowbody”>
<div class=”rowsub “>
<div class=”vendor_name”>
” class=”mvx_seller_name”><?php echo esc_html($more_product[‘seller_name’]); ?>
<?php do_action(‘mvx_after_singleproductmultivendor_vendor_name’, $more_product[‘product_id’], $more_product);?>
</div><?php
if(isset($more_product[‘rating_data’]) && is_array($more_product[‘rating_data’]) && isset($more_product[‘rating_data’][‘avg_rating’]) && $more_product[‘rating_data’][‘avg_rating’]!=0 && $more_product[‘rating_data’][‘avg_rating’]!=”){
echo wp_kses_post(wc_get_rating_html( $more_product[‘rating_data’][‘avg_rating’] ));
}else {
echo “<div class=’star-rating’></div>”;
}
?></div>
<div class=”rowsub”>
<?php echo $_product->get_price_html(); ?>
</div>
<div class=”rowsub”>
<?php
// reset global $product variable
global $product;
$product = $_product;
woocommerce_template_loop_add_to_cart( array(
‘quantity’ => 1,
) );
?>
” class=”buttongap button” ><?php echo esc_html_e(‘Details’,’multivendorx’); ?>
</div>
<div style=”clear:both;”></div>
</div><?php
}
// reset again with global product
global $product;
$product = $single_pro;
}
} -
April 8, 2023 at 7:37 PM #190550l.ganParticipant
Also, tell me please, how can I add a product image there?
-
April 10, 2023 at 5:44 PM #190625promitaKeymaster
@l.gan kindly share a detailed video describing what customization you are looking for and where you want it to be displayed so that we can help you accordingly
-
April 10, 2023 at 6:22 PM #190626l.ganParticipantThis reply has been marked as private.
-
April 12, 2023 at 10:28 PM #190783NerdySupportExpert MoumitaKeymasterThis reply has been marked as private.
-
April 17, 2023 at 7:18 PM #190990NerdySupportExpert MoumitaKeymaster
Hi, can you share the page link so we can assist you further.
-
April 22, 2023 at 9:30 PM #191255l.ganParticipant
Hi, Please check your spam, it looks like my links (which you requested) ended up there
-
April 24, 2023 at 12:42 PM #190993l.ganParticipantThis reply has been marked as private.
-
April 24, 2023 at 1:54 PM #191307NerdySupportExpert MoumitaKeymasterThis reply has been marked as private.
-
July 8, 2023 at 6:19 PM #194213Sangita Support SquadKeymaster
Hope your query is solved. We are closing this thread as of now. If you need help or face issue in future please open a new thread.
-
-
AuthorPosts
The topic ‘More offers-display the rating of the product itself instead of the store rating’ is closed to new replies.