<?php
$add_ons = [
    'premium' => [
        'label' => esc_html__('Pro Version', 'rnb-lite'),
        'title' => esc_html__('RnB Pro Version', 'rnb-lite'),
        'items' => [
            [
                'title'             => esc_html__('RnB - WooCommerce Booking & Rental Plugin', 'rnb-lite'),
                'buy_url'           => 'https://1.envato.market/vYx3v',
                'image_url'         => 'https://s3.amazonaws.com/redqteam.com/TF/seasonal-pricing-addons-banner.png',
                'subtitle'          => __('Extension of <strong>WooCommerce Rental & Booking Plugin</strong>', 'rnb-lite'),
                'description'       => __('WooCommerce Booking and Rental Plugin help you to build your booking business, it’s super easy to install and setup. You will able to rent like cars, bike, dress, tools, gadgets, etc. This is one of the best selling WooCommerce Booking Plugin. This allows you to add unlimited rental products, gives you the option to set your own pricing along with maintaining & blocking calendar. It has “request for quote” section too.', 'rnb-lite'),
                'demo_url'          => 'https://1.envato.market/vYx3v',
                'documentation'     => 'https://rnb-doc.vercel.app/',
                'video_tutorial'    => 'https://www.youtube.com/watch?v=fgAE-x--Uh4&t=1s',
            ]
        ]
    ],
    'addons' => [
        'label' => esc_html__('Addons', 'rnb-lite'),
        'title' => esc_html__('RnB Addons', 'rnb-lite'),
        'items' => [
            [
                'title'             => esc_html__('RnB Seasonal Pricing (Add-ons)', 'rnb-lite'),
                'buy_url'           => 'https://1.envato.market/RXrPX',
                'image_url'         => 'https://s3.amazonaws.com/redqteam.com/rnb-lite/rnb-seasonal-pricing.png',
                'subtitle'          => __('Extension of <strong>WooCommerce Rental & Booking Plugin</strong>', 'rnb-lite'),
                'description'       => __('The Seasonal pricing add-on allows you to charge promotional/seasonal pricing for specific date range of any rental product. This enables admin to configure pricing very easily based on different criteria. This is a simple and easy to use add-on perfect for your business if your price changes for peak and off-peak season.', 'rnb-lite'),
                'demo_url'          => 'https://redqteam.com/rnb/shop/seasonal-pricing/',
                'documentation'     => 'https://redq.io/blog/seasonal-pricing-rnb-plugin-addon',
                'video_tutorial'    => 'https://youtu.be/z157zJp4X1U',
            ],
            [
                'title'             => esc_html__('RnB Backend Booking (Add-ons)', 'rnb-lite'),
                'buy_url'           => 'https://1.envato.market/ORnzaK',
                'image_url'         => 'https://s3.amazonaws.com/redqteam.com/rnb-lite/rnb-backend-booking.png',
                'subtitle'          => __('Extension of <strong>WooCommerce Rental & Booking Plugin</strong>', 'rnb-lite'),
                'description'       => __('R&B Backend Booking is an extension of WooCommerce and WooCommerce Rental & Booking plugin. It allows admin to create a rental order from WordPress admin. It provides all the features that is available in RnB front-end booking plugin. This plugin will help admin to create both online and offline booking business.', 'rnb-lite'),
                'demo_url'          => 'https://preview.redq.io/rnb/rnb-backend-booking/',
                'documentation'     => 'https://rnb-backend-booking-docs.vercel.app/',
                'video_tutorial'    => 'https://www.youtube.com/watch?v=JxAHt24Ohqs&ab_channel=RedQTeam',
            ],
            [
                'title'             => esc_html__('RnB Extend Order (Add-on)', 'rnb-lite'),
                'buy_url'           => 'https://1.envato.market/NKoZbN',
                'image_url'         => 'https://s3.amazonaws.com/redqteam.com/rnb-lite/rnb-extend-order.png',
                'subtitle'          => __('Extension of <strong>WooCommerce Rental & Booking Plugin</strong>', 'rnb-lite'),
                'description'       => __('R&B extend order plugin is an extension of WooCommerce and WooCommerce Rental & Booking plugin . It allows customer to extend a rental order from wooCommerce my account page. This plugin will help customer to extend their existing booking depending on its availability, it’s super easy to install and setup. Customer will able to extend a rental order for cars, bike, dress, tools, gadgets, etc.', 'rnb-lite'),
                'demo_url'          => 'https://preview.redq.io/rnb/rnb-extend-order/',
                'documentation'     => 'https://rnb-extend-order-doc.vercel.app/',
                'video_tutorial'    => 'https://www.youtube.com/watch?v=4biL9UdJVYM',
            ],
            [
                'title'             => esc_html__('Inspect - RNB Search & Filter (Add-ons)', 'rnb-lite'),
                'buy_url'           => 'https://1.envato.market/B0Pkd9',
                'image_url'         => 'https://s3.amazonaws.com/redqteam.com/rnb-lite/rnb-inspect-builder.png',
                'subtitle'          => __('Extension of <strong>WooCommerce Rental & Booking Plugin</strong>', 'rnb-lite'),
                'description'       => __('Inspect is an Add-ons of WooCommerce and WooCommerce Rental & Booking plugin. Inspect is a user-friendly search and filter extension for your Rental and Booking site. It works as an extension for RnB – WooCommerce plugin. Inspect allows you to generate shortcodes for advanced search forms and filters. It comes with the following options: Generate Search Form shortcode Generate Listing (Search Result) Shortcode.', 'rnb-lite'),
                'demo_url'          => 'https://redqmainsite.vercel.app/landing/rnb-inspect',
                'documentation'     => 'https://rnb-inspect-doc.vercel.app/',
                'video_tutorial'    => 'https://youtube.com/watch?v=-v9KzdmY32s',
            ],
            [
                'title'             => esc_html__('RnB - Extra Product Options (Add-on)
                ', 'rnb-lite'),
                'buy_url'           => 'https://1.envato.market/4PWNVr',
                'image_url'         => 'https://s3.amazonaws.com/redqteam.com/rnb-lite/rnb-extra-option.png',
                'subtitle'          => __('Extension of <strong>WooCommerce Rental & Booking Plugin</strong>', 'rnb-lite'),
                'description'       => __('RnB extra product options is an extension of WooCommerce and WooCommerce Rental & Booking plugin. It allows customer to add extra fields fields in booking & rental form. Before installing this plugin, please make sure you’ve installed required plugins. Otherwise this plugin will not work and you’ll get warning message in WordPress admin area.', 'rnb-lite'),
                'demo_url'          => 'https://cartsy.redq.io/inspect/product/bmw-x7-facelift/',
                'documentation'     => 'https://rnb-extra-product-doc.vercel.app/',
                'video_tutorial'    => 'https://www.youtube.com/watch?v=A6vg1gMpQxU&feature=youtu.be&ab_channel=RedQTeam',
            ],
            [
                'title'             => esc_html__('Rental Invoice - PDF Invoice For RnB & WooCommerce', 'rnb-lite'),
                'buy_url'           => 'https://1.envato.market/g1G5X5',
                'image_url'         => 'https://s3.amazonaws.com/redqteam.com/rnb-lite/rnb-invoice.png',
                'subtitle'          => __('Extension of <strong>WooCommerce Rental & Booking Plugin</strong>', 'rnb-lite'),
                'description'       => __('Rental Invoice – PDF Invoice for RnB & wooCommerce is an extension for RnB and wooCommerce plugin that can be useful for businesses that need to provide customers with a printable invoice for their purchases or bookings. With this extension, you can generate PDF invoices from both the back-end (admin area) and front-end (customer area) of your website, which can help streamline the invoicing process and improve customer experience. When a customer places an order, the invoice is also sent as an email attachment.', 'rnb-lite'),
                'demo_url'          => 'https://preview.redq.io/rnb/shop/daily-midtown-manhattan-studio/',
                'documentation'     => 'https://rnb-rental-pdf-doc.vercel.app/',
                'video_tutorial'    => 'https://youtu.be/ccYqZgy2FCg',
            ],
            [
                'title'             => esc_html__('RnB Builder - Product Single Page Builder for RnB (Add-on)', 'rnb-lite'),
                'buy_url'           => 'https://1.envato.market/VmNdDR',
                'image_url'         => 'https://s3.amazonaws.com/redqteam.com/rnb-lite/rnb-builder.png',
                'subtitle'          => __('Extension of <strong>WooCommerce Rental & Booking Plugin</strong>', 'rnb-lite'),
                'description'       => __('RnB Builder is an extension of WooCommerce and WooCommerce Rental & Booking plugins . It allows a customer to build any product single page without headache. It’s very easy to use and comes with a lot of powerful design control and animations. We have provided support for some of the most popular website builders in the market today like Elementor Pro Builder, Gutenberg Builder, Divi Builder, and Oxygen Builder with that. The  RnB Builder add-on ensures that businesses can customize their website easily and quickly, without having to spend time on coding or hiring a developer.', 'rnb-lite'),
                'demo_url'          => 'https://preview.redq.io/rnb/shop/daily-midtown-manhattan-studio/',
                'documentation'     => 'https://rnb-builder-doc.vercel.app//',
                'video_tutorial'    => 'https://www.youtube.com/watch?v=0BCoee4fnsY&list=PLUT1MYLrVpA--VuMase2R80XrgJTl1aHl',
            ]
        ]
    ],
    'themes' => [
        'label' => esc_html__('Themes', 'rnb-lite'),
        'title' => esc_html__('RnB Compatible Themes', 'rnb-lite'),
        'items' => [
            [
                'title'             => esc_html__('Cartsy - WooCommerce WordPress Theme', 'rnb-lite'),
                'buy_url'           => 'https://redq.io/cartsy#pricing',
                'image_url'         => 'https://s3.amazonaws.com/redqteam.com/rnb-lite/cartsy-wp-theme.png',
                'subtitle'          => __('WordPress Theme build on the top of <strong>WooCommerce</strong>', 'rnb-lite'),
                'description'       => __('Create your online shop with our fully functional WordPress E-commerce. Cartsy is a highly intuitive WooCommerce theme that will handle all your online business needs. Start selling anything and everything today.', 'rnb-lite'),
                'demo_url'          => 'https://redq.io/cartsy',
                'documentation'     => 'https://cartsy-doc.vercel.app/',
                'video_tutorial'    => 'https://www.youtube.com/watch?v=C6P21idUAdQ&ab_channel=RedQTeam'
            ],
            [
                'title'             => esc_html__('Turbo - WooCommerce Rental & Booking Theme', 'rnb-lite'),
                'buy_url'           => 'https://1.envato.market/NKzXeP',
                'image_url'         => 'https://s3.amazonaws.com/redqteam.com/rnb-lite/turbo-wp-theme.png',
                'subtitle'          => __('WordPress Theme Build on the top of <strong>WooCommerce Rental & Booking Plugin', 'rnb-lite'),
                'description'       => __('Turbo is an user-friendly car booking WordPress theme alternatively, car rental WordPress theme crafted with , WooCommerce booking plugin, visual composer, and multilingual.This theme allows you to book or rent your date-based or time-based car booking. It creates a new product type to your WooCommerce site. Perfect for those wanting to offer rental or booking.', 'rnb-lite'),
                'demo_url'          => 'https://1.envato.market/NKzXeP',
                'documentation'     => 'https://wordpress-rental-booking-doc.vercel.app/',
                'video_tutorial'    => 'https://www.youtube.com/playlist?list=PLUT1MYLrVpA-cdyoKUDaWXhiQmcERvmwe',
            ]
        ]
    ]
];
?>

<div class="wrap woocommerce wc_addons_wrap rnb_addons_wrap">
    <div class="addons-banner-block">
        <h1><?php echo esc_html__('Extend your booking features with RnB products.', 'rnb-lite'); ?></h1>
        <p></p>

        <!-- Tab Menu START -->
        <div class="redq-tab-menus">
            <?php
            $i = 0;
            if(!empty($add_ons) && count($add_ons) > 0) : foreach ($add_ons as $key => $add_on) : ?>
                <button class="redq-tab-menu-item button <?php echo esc_attr($i == 0 ? 'button-primary' : ''); ?>" id="<?php echo esc_attr($key); ?>"><?php echo esc_html($add_on['label']); ?></button>
                <?php $i++; ?>
            <?php endforeach; endif; ?>
        </div>
        <!-- Tab Menu END -->

        <!-- Tab Content Body START -->
        <div class="redq-tab-content-wrapper">
            <?php
            if(!empty($add_ons) && count($add_ons) > 0) : foreach ($add_ons as $key => $add_on) : 
                $items = !empty($add_on['items']) ? $add_on['items'] : [];
                ?>
                <div id="<?php echo esc_attr($key); ?>Content" class="redq-tab-content">
                    <h2><?php echo esc_html($add_on['title']); ?></h2>
                    <!-- Addon items START -->
                    <div class="addons-banner-block-items">
                        <?php if(!empty($items) && count($items) > 0) : foreach ($items as $key => $item) : ?>
                            <div class="storefront rnb-addon rnb-addon-<?php echo esc_attr($key + 1); ?>">
                                <a href="<?php echo esc_url($item['buy_url']); ?>" target="_blank">
                                    <img src="<?php echo esc_url($item['image_url']); ?>" alt="<?php esc_attr_e('RnB Seasonal Pricing', 'rnb-lite'); ?>">
                                </a>
                                <h2><?php echo wp_kses($item['title'], wp_kses_allowed_html()); ?></h2>
                                <p class="subtitle"><?php echo wp_kses($item['subtitle'], wp_kses_allowed_html()); ?></p>
                                <p><?php echo wp_kses($item['description'], wp_kses_allowed_html()); ?></p>
                                <p>
                                    <a href="<?php echo esc_url($item['buy_url']); ?>" target="_blank" class="button"><?php echo esc_html__('Live Preview', 'rnb-lite'); ?></a>
                                    <a href="<?php echo esc_url($item['documentation']); ?>" target="_blank" class="button"><?php echo esc_html__('Documentation', 'rnb-lite'); ?></a>
                                    <a href="<?php echo esc_url($item['video_tutorial']); ?>" target="_blank" class="button"><?php echo esc_html__('Video Tutorial', 'rnb-lite'); ?></a>
                                    <!-- <a href="<?php echo esc_url($item['buy_url']); ?>" target="_blank" class="button button-primary"><?php echo esc_html__('Buy Now', 'rnb-lite'); ?></a> -->
                                </p>
                            </div>
                        <?php endforeach; endif; ?>
                    </div>
                    <!-- Addon items END -->
                </div>
            <?php endforeach; endif; ?>
        </div>
        <!-- Tab Content Body END -->
    </div>
</div>