• Join the Best Wordpress and Elementor Support forum

    Provide or get advice on everything Elementor and Wordpress, ask questions, gain confirmation or just become apart of a friendly, like minded community who love Wordpress and Elementor


    Join us!

Question changing global widget settings from backend

L

lightx

New Member
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:

PHP:
$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)

product page link for example: sfwp .lightx. co. il/shop/item
 
Last edited:

Latest Resources

Other Elementor Resources

elementor official

Still stuck? Ask the forum

Post your question with a screenshot and a link if you can, and a member will usually reply within a day. Free to join, no sales pitch.

Create a free account
Top