smile7
Forum Replies Created
-
Hi,
You have to add the following code to my-account.php (dont’forget to copy the whole my-account.php in your child theme in folder ‘myaccount’ because you dont want to lose your changes after an update of WC):
<h2> Bought Products </h2>
<ul class=”products”>
<?php
$user_id = get_current_user_id();
$current_user= wp_get_current_user();
$customer_email = $current_user->email;
$args = array(
‘post_type’ => ‘product’,
‘posts_per_page’ => 12
);
$loop = new WP_Query( $args );
if ( $loop->have_posts() ) {
while ( $loop->have_posts() ) : $loop->the_post(); $_product = get_product( $loop->post->ID );
if (wc_customer_bought_product($customer_email, $user_id,$_product->id)){
woocommerce_get_template_part( ‘content’, ‘product’ );
}
endwhile;
} else {
echo __( ‘Все още нямате закупени продукти.’ );
}
wp_reset_postdata();
?>
<!–/.products–>It is working now, after the change I made to the code.
Thank you very much ??
The problem is with every category.
Here are the widget settings:
https://imagebin.ca/v/2ZzXAAfHPLDR
And the categories:
https://imagebin.ca/v/2ZzX17ISdxFbHere is the link to the website:
https://souvenir.trimata.guruThere are test categories only. To find out what I am talking about, you can check the last category on the sidebar as there are subcategories.