• Resolved lightxservices

    (@lightxservices)


    hey everyone,
    i am creating a ajax pagination plugin for the woocommerce products widget,
    so when the user clicks the next page button, a request is sent to the backend and then queries the database for product posts:

    $loop = new WP_Query( $products_args );
    
    if ( $loop->have_posts() ) {
    
       echo "<ul class='products'>";
    
       while ( $loop->have_posts() ) : $loop->the_post();
    
            wc_get_template_part( 'content', 'product' );
    
        endwhile;
    
        echo "</ul>";
    
    }

    then as you can see, prints the template part content product.
    but instead i would like to get a global widget i created with the right css and settings, with the queried posts.
    i thought to output the shortcode of the global widget, but i don’t know how to change the query or posts inside.

    thanks for the help.
    (in the attached link you can see at the suggested products above the price a pagination on the left side, test it and see what is happening to the products. i need them to be as they where at the first place)

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘change global widget settings’ is closed to new replies.