# booktics/1.0.21/core/shortcode/customer-shortcode.php

Booktics – Appointment Booking Calendar for Service Businesses, version 1.0.21. 48 lines.

- Page: https://pluginprobe.com/plugins/booktics/1.0.21/code/core/shortcode/customer-shortcode.php
- Raw: https://pluginprobe.com/plugins/booktics/1.0.21/raw/core/shortcode/customer-shortcode.php
- Modified: 2025-07-31T12:01:50+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/booktics/1.0.21/code/core/shortcode/customer-shortcode.php#L10-L20`.

```php
<?php

namespace Booktics\Shortcode;

/**
 * Customer shortcode class
 */
class Customer_Shortcode {
    /**
     * Constructor for customer shortcode
     *
     * @return  void
     */
    public function __construct() {
        add_shortcode( 'booktics_customer_panel', array( $this, 'render_customer_panel' ) );
    }

    /**
     * Render customer panel
     *
     * @param   array  $attributes
     *
     * @return  string
     */
    public function render_customer_panel( $attributes ) {

        wp_enqueue_style( 'booktics-vendor' );
        wp_enqueue_style( 'booktics-frontend' );

        wp_enqueue_script( 'booktics-packages' );
        wp_enqueue_script( 'booktics-frontend-scripts' );
        
             // Check if user is logged in
             if ( ! is_user_logged_in() ) {
                $login_url = wp_login_url( get_permalink() );
                return '<div class="booktics-login-required">
                            <h3>Customer Portal Access</h3>
                            <p>Please login to access your booking history.</p>
                            <a href="' . esc_url( $login_url ) . '" class="booktics-login-btn">Login</a>
                        </div>';
            }
    
            // Return container for React app
            return '<div id="booktics-customer-dashboard" 
                         data-user-id="' . get_current_user_id() . '">
                    </div>';
    }
}
```
