Muvka2018-01-27 09:32:03
Muvka, 2018-01-27 09:32:03

Any idea how to implement ajax loading of goods?

Hello. In the store, you need to do the loading of goods by pressing a button. I assembled the product card by hand. I have a question - how can I get data into a variable, for example, these functions?

<?php the_post_thumbnail('product_thumb', array(
    	'alt' => get_the_title()
    )); ?>
esc_url( $thumbnail[0] )

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Alexey Sklyarov, 2018-01-27

Ajax sends a normal request to some file in your template. In it, you create a normal wordpress loop with parameters. Each time you just need to send the category ID, offset (from which product to display the list) and other parameters at your discretion using ajax. That's all in general. In the file itself, since we have a wp loop, you can configure it to output anything at all, it works like any piece of your template (yes, you can also attach the woocommerce format there).

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question