M
M
mihaguerrero2017-08-24 17:46:16
MySQL
mihaguerrero, 2017-08-24 17:46:16

Where are Woocommerce orders stored in the database?

It is necessary to make a public page on the site, which would display all orders, as in the Woocommerce->Orders admin menu item.
This is necessary for the admin who is on the phone. I don't want to give him access to WP.
How can this be implemented?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
W
WordPress WooCommerce, 2017-08-24
@maxxannik

Orders, like most entities, have a post type. You can get something like this: get_posts('post_type=order').
You can write a shortcode. Insert on a personal page available to a specific user. Should work.
There are dozens of other options for how to do this. But without the ability to code, it will be extremely difficult to solve such a problem.

A
Anastasia Kolesnikova, 2019-09-15
@Anastasia1999

You can withdraw in a similar way. I took the code from the output of the news.

<?php 
$args=array(
'post_type' => 'shop_order',
'posts_per_page' => -1,
);
$query = new WP_Query( $args );
global $wp_query; 
//$wp_query = $query;
while ( $query->have_posts() ) {
  $query->the_post();

  ?>
         
        <div class="col-md-3 centerA"> 
            <a href="<?php the_permalink();?>" class="pac-item">
                <span class="content">
                                <span class="img">
                <img alt="" src="<?php the_post_thumbnail_url() ?>">            </span>
            <p class="title"><?php the_title();?></p>
                </span>
            </a>
        </div>
            
                            
<?php 
}
    ?>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question