WOOT - WooCommerce Active Products Tables

How to create remote page with the products table

Remote page with the products table can be created on any another site, for example sites of your partners where they spread your shop products as referrals. Not depends on CMS and can be placed even on a simple HTML template page.

See inbuilt products table in simple HTML template here.

To create:

  • create page on your site and select template “WOOT Blank Page
  • place there WOOT shortcode, for example: [woot id=4]
  • you can give your partners next code:
    <div id='woot-remote-place-here' class="container"></div>
    <script src="https://YOUR_SITE.com/?woot-remote-page=my-remote-page&width=100%&height=1200px&anchor=woot-remote-place-here&woot_refferal=demo_ref"></script>
    • woot-remote-page: slug of the page you created
    • width:table width on the remote site, examples: 100%, 500px
    • height: table height on the remote site
    • anchor: ID of the <div> container where products table will be loaded on the remote site
    • woot_refferal: here should be placed referral nickname of your partner
  • Replace YOUR_SITE.com to domain of your WordPress site where WOOT is installed
  • For remote referrals should be created special column with the button inside by the next code:
    add_action('woot_profile_extend', function($profile, $action_name) {
    
        if ($action_name === 'woot_woocommerce_tables') {
            $profile['remote_refferals'] = [
                'title' => 'R-Refferal btn',
                'order' => FALSE,
                'action' => function($post_id) {
                    $refferal = 'xxx';
                    $link_data = WOOT_HELPER::get_link_data();
    
                    if (isset($link_data['woot_refferal'])) {
                        $refferal = $link_data['woot_refferal'];
                    }
    
                    return WOOT_HELPER::draw_html_item('a', [
                                'href' => "https://YOUR_SITE.com?ref={$refferal}&product_id={$post_id}",
                                'class' => 'woot-btn',
                                'target' => '_blank'
                                    ], 'Get it for free');
                }
            ];
    
        }
    
        return $profile;
    }, 10, 2);

To make remote table more quick:

  • download next file: woot-remote.php
  • unzip and upload file woot-remote.php to your WordPress site folder
  • in javascript link use: https://YOUR_SITE/woot-remote.php instead of https://YOUR_SITE