<?php
if ( ! defined( 'ABSPATH' ) ) {
    exit; // Exit if accessed directly.
}
use Elementor\Widget_Base;
use Elementor\Utils;
use Elementor\Icons_Manager;
use Elementor\Controls_Manager;
use Elementor\Control_Media;
use \Elementor\Group_Control_Box_Shadow;
use Elementor\Core\Kits\Documents\Tabs\Global_Colors;
use Elementor\Core\Kits\Documents\Tabs\Global_Typography;
use Elementor\Group_Control_Border;
use Elementor\Group_Control_Text_Stroke;
use Elementor\Group_Control_Typography;
use \Elementor\Group_Control_Image_Size;
use \Elementor\Group_Control_Background;
use \Elementor\Group_Control_Text_Shadow;

class Rswpthemes_Awt_Book_Gallery extends \Elementor\Widget_Base {

    public function get_name() {
        return 'rswpthemes_awt_book_gallery';
    }

    public function get_title() {
        return __( 'AWT Books Gallery', 'author-website-templates' );
    }

    public function get_icon() {
        return 'fa fa-book';
    }

    public function get_categories() {
        return [ 'rswpthemes_awt_widgets' ];
    }

    public function get_style_depends() {
        return [ 'rswpthemes-awt-books-gallery' ];
    }

    private function get_taxonomy_options($taxonomy) {
        $terms = get_terms([
            'taxonomy' => $taxonomy,
            'hide_empty' => false,
        ]);

        $options = [];
        if (!is_wp_error($terms)) {
            foreach ($terms as $term) {
                $options[$term->term_id] = $term->name;
            }
        }
        return $options;
    }

    // Helper function to get book options (for include/exclude books)
    private function get_books_options() {
        $books = get_posts([
            'post_type' => 'book',
            'posts_per_page' => -1,
            'post_status' => 'publish',
        ]);

        $options = [];
        foreach ($books as $book) {
            $options[$book->ID] = $book->post_title;
        }
        return $options;
    }

    protected function _register_controls() {

        $this->start_controls_section(
            'section_title',
            [
                'label' => __( 'Section Title', 'author-website-templates' ),
                'tab' => \Elementor\Controls_Manager::TAB_CONTENT,
            ]
        );

        $this->add_control(
            'show_section_title',
            [
                'label' => __( 'Show Section Title', 'author-website-templates' ),
                'type' => \Elementor\Controls_Manager::SWITCHER,
                'label_on' => __( 'Show', 'author-website-templates' ),
                'label_off' => __( 'Hide', 'author-website-templates' ),
                'default' => 'yes',
                'classes' => 'pro-locked-control',
            ]
        );

        $this->add_control(
            'section_sub_heading',
            [
                'label' => __( 'Section Sub Heading', 'author-website-templates' ),
                'type' => \Elementor\Controls_Manager::TEXTAREA,
                'default' => __( 'Author’s All Book', 'author-website-templates' ),
            ]
        );

        $this->add_control(
            'section_heading',
            [
                'label' => __( 'Section Heading', 'author-website-templates' ),
                'type' => \Elementor\Controls_Manager::TEXTAREA,
                'default' => __( 'Discover the Best of Taylor Jenking Reid', 'author-website-templates' ),
            ]
        );

        $this->add_control(
            'section_description',
            [
                'label' => __( 'Section Description', 'author-website-templates' ),
                'type' => \Elementor\Controls_Manager::TEXTAREA,
                'default' => __( 'has written an extensive collection of books spanning multiple genres...', 'author-website-templates' ),
            ]
        );

        $this->end_controls_section();

        $this->start_controls_section(
            'layout_control',
            [
                'label' => __( 'Layout Control', 'author-website-templates' ),
                'tab' => \Elementor\Controls_Manager::TAB_CONTENT,
            ]
        );
        // Control for books per row
        $this->add_control(
            'books_per_row',
            [
                'label' => __( 'Books Per Row', 'author-website-templates' ),
                'type' => \Elementor\Controls_Manager::NUMBER,
                'default' => 4,
                'classes' => 'pro-locked-control',
            ]
        );

        // Control for showing book image
        $this->add_control(
            'show_book_image',
            [
                'label' => __( 'Show Book Image', 'author-website-templates' ),
                'type' => \Elementor\Controls_Manager::SWITCHER,
                'default' => 'yes',
            ]
        );

        // Control for book image type
        $this->add_control(
            'book_image_type',
            [
                'label' => __( 'Book Image Type', 'author-website-templates' ),
                'type' => \Elementor\Controls_Manager::SELECT,
                'options' => [
                    'book_cover' => __( 'Book Cover', 'author-website-templates' ),
                    'book_thumbnail' => __( 'Book Thumbnail', 'author-website-templates' ),
                ],
                'default' => 'book_cover',
                'condition' => [
                    'show_book_image' => 'yes',
                ],
            ]
        );

        // Control for showing book title
        $this->add_control(
            'show_book_title',
            [
                'label' => __( 'Show Book Title', 'author-website-templates' ),
                'type' => \Elementor\Controls_Manager::SWITCHER,
                'default' => 'yes',
            ]
        );

        // Control for book title type
        $this->add_control(
            'book_title_type',
            [
                'label' => __( 'Book Title Type', 'author-website-templates' ),
                'type' => \Elementor\Controls_Manager::SELECT,
                'options' => [
                    'title' => __( 'Title', 'author-website-templates' ),
                    'subtitle' => __( 'Subtitle', 'author-website-templates' ),
                ],
                'default' => 'title',
                'condition' => [
                    'show_book_title' => 'yes',
                ],
            ]
        );

        // Control for showing book author
        $this->add_control(
            'show_book_author',
            [
                'label' => __( 'Show Book Author', 'author-website-templates' ),
                'type' => \Elementor\Controls_Manager::SWITCHER,
                'default' => 'yes',
            ]
        );

        // Control for showing book price
        $this->add_control(
            'show_book_price',
            [
                'label' => __( 'Show Book Price', 'author-website-templates' ),
                'type' => \Elementor\Controls_Manager::SWITCHER,
                'default' => 'yes',
            ]
        );

        // Control for showing book excerpt
        $this->add_control(
            'show_book_excerpt',
            [
                'label' => __( 'Show Book Excerpt', 'author-website-templates' ),
                'type' => \Elementor\Controls_Manager::SWITCHER,
                'default' => 'yes',
            ]
        );

        // Control for book excerpt limit
        $this->add_control(
            'excerpt_limit',
            [
                'label' => __( 'Excerpt Limit', 'author-website-templates' ),
                'type' => \Elementor\Controls_Manager::NUMBER,
                'default' => 30,
                'condition' => [
                    'show_book_excerpt' => 'yes',
                ],
            ]
        );

        // Control for showing buy button
        $this->add_control(
            'show_buy_button',
            [
                'label' => __( 'Show Buy Button', 'author-website-templates' ),
                'type' => \Elementor\Controls_Manager::SWITCHER,
                'default' => 'yes',
            ]
        );

        $this->add_control(
            'show_add_to_cart_btn',
            [
                'label' => __( 'Show Add To Cart Button', 'author-website-templates' ),
                'type' => \Elementor\Controls_Manager::SWITCHER,
                'default' => 'yes',
                'classes' => 'pro-locked-control',
            ]
        );

        $this->end_controls_section();
        $this->start_controls_section(
            'query_section',
            [
                'label' => __( 'Query', 'author-website-templates' ),
                'tab' => \Elementor\Controls_Manager::TAB_CONTENT,
            ]
        );
        $this->add_control(
            'books_per_page',
            [
                'label' => __( 'Books Per Page', 'author-website-templates' ),
                'type' => \Elementor\Controls_Manager::NUMBER,
                'default' => 6,
            ]
        );
        // Control for include categories
        $this->add_control(
            'include_categories',
            [
                'label' => __( 'Include Categories', 'author-website-templates' ),
                'type' => \Elementor\Controls_Manager::SELECT2,
                'multiple'  =>   true,
                'label_block'  =>   true,
                'options'   => $this->get_taxonomy_options('book-category'),
            ]
        );

        // Control for exclude categories
        $this->add_control(
            'exclude_categories',
            [
                'label' => __( 'Exclude Categories', 'author-website-templates' ),
                'type' => \Elementor\Controls_Manager::SELECT2,
                'multiple'  =>   true,
                'label_block'  =>   true,
                'options'   => $this->get_taxonomy_options('book-category'),
            ]
        );

        // Control for include authors
        $this->add_control(
            'include_authors',
            [
                'label' => __( 'Include Authors', 'author-website-templates' ),
                'type' => \Elementor\Controls_Manager::SELECT2,
                'multiple'  =>   true,
                'label_block'  =>   true,
                'options'   => $this->get_taxonomy_options('book-author'),
            ]
        );

        // Control for exclude authors
        $this->add_control(
            'exclude_authors',
            [
                'label' => __( 'Exclude Authors', 'author-website-templates' ),
                'type' => \Elementor\Controls_Manager::SELECT2,
                'multiple'  =>   true,
                'label_block'  =>   true,
                'options'   => $this->get_taxonomy_options('book-author'),
            ]
        );

        // Control for excluding specific books
        $this->add_control(
            'exclude_books',
            [
                'label' => __( 'Exclude Books', 'author-website-templates' ),
                'type' => \Elementor\Controls_Manager::SELECT2,
                'options' => $this->get_books_options(),
                'multiple' => true,
                'label_block' => true,
            ]
        );

        // Control for book offset
        $this->add_control(
            'book_offset',
            [
                'label' => __( 'Book Offset', 'author-website-templates' ),
                'type' => \Elementor\Controls_Manager::NUMBER,
                'default' => 0,
            ]
        );

        // Control for order by
        $this->add_control(
            'order_by',
            [
                'label' => __( 'Order By', 'author-website-templates' ),
                'type' => \Elementor\Controls_Manager::SELECT,
                'options' => [
                    'default' => __( 'Default', 'author-website-templates' ),
                    'title' => __( 'Title', 'author-website-templates' ),
                    'author' => __( 'Author', 'author-website-templates' ),
                    'price' => __( 'Price', 'author-website-templates' ),
                ],
                'default' => 'default',
                'classes' => 'pro-locked-control',
            ]
        );

        // Control for order direction
        $this->add_control(
            'order',
            [
                'label' => __( 'Order', 'author-website-templates' ),
                'type' => \Elementor\Controls_Manager::SELECT,
                'options' => [
                    'ASC' => __( 'Ascending', 'author-website-templates' ),
                    'DESC' => __( 'Descending', 'author-website-templates' ),
                ],
                'default' => 'DESC',
                'classes' => 'pro-locked-control',
            ]
        );

        $this->end_controls_section();


         $this->start_controls_section(
            'awt_bg_section_subtitle_style',
            [
                'label' => __( 'Section Sub Title', 'author-website-templates' ),
                'tab' => \Elementor\Controls_Manager::TAB_STYLE,
            ]
        );
       $this->add_group_control(
            Group_Control_Typography::get_type(),
            [
                'name' => 'awt_bg_section_subtitle_typography',
                'selector' => '{{WRAPPER}} .section-title-container h4.section-title-label',
            ]
        );
       $this->add_control(
            'awt_bg_section_subtitle_color',
            [
                'label' => __( 'Color', 'author-website-templates' ),
                'separator' => 'before',
                'type' => \Elementor\Controls_Manager::COLOR,
                'selectors' => [
                    '{{WRAPPER}} .section-title-container h4.section-title-label' => 'color: {{VALUE}}',
                ],
            ]
        );
       $this->end_controls_section();
       $this->start_controls_section(
            'awt_bg_section_title_style',
            [
                'label' => __( 'Section Title', 'author-website-templates' ),
                'tab' => \Elementor\Controls_Manager::TAB_STYLE,
            ]
        );
       $this->add_group_control(
            Group_Control_Typography::get_type(),
            [
                'name' => 'awt_bg_section_title_typography',
                'selector' => '{{WRAPPER}} .section-title-container h2.section-title',
            ]
        );
       $this->add_control(
            'awt_bg_section_title_color',
            [
                'label' => __( 'Color', 'author-website-templates' ),
                'separator' => 'before',
                'type' => \Elementor\Controls_Manager::COLOR,
                'selectors' => [
                    '{{WRAPPER}} .section-title-container h2.section-title' => 'color: {{VALUE}}',
                ],
            ]
        );
       $this->end_controls_section();
       $this->start_controls_section(
            'awt_bg_section_description_style',
            [
                'label' => __( 'Section Description', 'author-website-templates' ),
                'tab' => \Elementor\Controls_Manager::TAB_STYLE,
            ]
        );
       $this->add_group_control(
            Group_Control_Typography::get_type(),
            [
                'name' => 'awt_bg_section_description_typography',
                'selector' => '{{WRAPPER}} .section-description-wrapper p',
            ]
        );
       $this->add_control(
            'awt_bg_section_description_color',
            [
                'label' => __( 'Color', 'author-website-templates' ),
                'separator' => 'before',
                'type' => \Elementor\Controls_Manager::COLOR,
                'selectors' => [
                    '{{WRAPPER}} .section-description-wrapper p' => 'color: {{VALUE}}',
                ],
            ]
        );
       $this->end_controls_section();

            $this->start_controls_section(
                'awt_bg_book_wrapper',
                [
                    'label' => __( 'Book Container', 'author-website-templates' ),
                    'tab'   => Controls_Manager::TAB_STYLE,
                ]
            );
            $this->start_controls_tabs(
                'awt_bg_book_container_style_tabs'
            );
            $this->start_controls_tab(
                'awt_bg_book_container_normal_tab',
                [
                    'label' => __( 'Normal', 'author-website-templates' ),
                ]
            );

            $this->add_group_control(
                Group_Control_Background::get_type(),
                [
                    'name' => 'awt_bg_book_container_background',
                    'separator' => 'before',
                    'label' => __( 'Box Background', 'author-website-templates' ),
                    'types' => [ 'classic', 'gradient' ],
                    'selector' => '{{WRAPPER}} .rswpbs-book-container, {{WRAPPER}} .rswpbs-book-loop-content-wrapper',
                ]
            );
            $this->add_group_control(
                Group_Control_Box_Shadow::get_type(),
                [
                    'name' => 'box_shadow',
                    'separator' => 'before',
                    'label' => __( 'Box Shadow', 'author-website-templates' ),
                    'selector' => '{{WRAPPER}} .rswpbs-book-container',
                ]
            );
            $this->add_responsive_control(
                'awt_bg_book_container_padding',
                [
                    'label' => __( 'Content Padding', 'author-website-templates' ),
                    'type' => Controls_Manager::DIMENSIONS,
                    'size_units' => [ 'px', 'em', '%' ],
                    'selectors' => [
                        '{{WRAPPER}} .rswpbs-book-loop-content-wrapper' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
                    ],
                    'separator' => 'before',
                ]
            );
            $this->add_responsive_control(
                'awt_bg_book_item_box_padding',
                [
                    'label' => __( 'Item Padding', 'author-website-templates' ),
                    'type' => Controls_Manager::DIMENSIONS,
                    'size_units' => [ 'px', 'em', '%' ],
                    'selectors' => [
                        '{{WRAPPER}} .rswpbs-book-container' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
                    ],
                    'separator' => 'before',
                ]
            );
            $this->add_responsive_control(
                'awt_bg_book_container_margin',
                [
                    'label' => __( 'Item Margin', 'author-website-templates' ),
                    'type' => Controls_Manager::DIMENSIONS,
                    'size_units' => [ 'px', 'em', '%' ],
                    'selectors' => [
                        '{{WRAPPER}} .rswpbs-book-container' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
                    ],
                    'separator' => 'before',
                ]
            );

            $this->add_group_control(
                Group_Control_Border::get_type(),
                [
                    'name' => 'awt_bg_book_container_border',
                    'selector' => '{{WRAPPER}} .rswpbs-book-container',
                    'separator' => 'before',
                ]
            );

            $this->add_control(
                'awt_bg_book_content_alignment',
                [
                    'label'     => __( 'Text AlignMent', 'author-website-templates' ),
                    'type'      => Controls_Manager::SELECT,
                    'default'   => 'center',
                    'options' => [
                        'left'  => __( 'Left', 'author-website-templates' ),
                        'center' => __( 'Center', 'author-website-templates' ),
                        'right' => __( 'Right', 'author-website-templates' ),
                    ],
                    'selectors' => [
                        '{{WRAPPER}} .rswpbs-book-loop-content-wrapper,{{WRAPPER}} .book-also-available-websites-wrapper h4, {{WRAPPER}} .rswpbs-book-loop-content-wrapper .book-title, {{WRAPPER}} .rswpbs-book-loop-content-wrapper .book-author, {{WRAPPER}} .rswpbs-book-loop-content-wrapper .book-desc, {{WRAPPER}} .rswpbs-book-loop-content-wrapper .book-buy-btn, {{WRAPPER}} .book-also-available-websites-wrapper .msl-title-inner' => 'text-align: {{VALUE}}',
                        '{{WRAPPER}} .rswpbs-book-loop-content-wrapper .book-price, {{WRAPPER}} .rswpbs-book-container.thumbnail-position-top .rswpbs-book-loop-image-a, {{WRAPPER}} .book-also-available-website-list, {{WRAPPER}} .eafe-book-multiple-sales-links .book-also-available-website-list .has-website-image a, {{WRAPPER}} .rswpbs-book-loop-content-wrapper .book-buy-btn, {{WRAPPER}} .rswpbs-book-loop-content-wrapper .rswpbs-book-buttons-wrapper' => 'justify-content: {{VALUE}}',
                    ]
                ]
            );
            $this->end_controls_tab();
            $this->start_controls_tab(
                'awt_bg_book_container_hover_tab',
                [
                    'label' => __( 'Hover', 'author-website-templates' ),
                ]
            );
            $this->add_group_control(
                Group_Control_Background::get_type(),
                [
                    'name' => 'awt_bg_book_container_hover_background',
                    'label' => __( 'Box Background', 'author-website-templates' ),
                    'types' => [ 'classic', 'gradient' ],
                    'selector' => '{{WRAPPER}} .rswpbs-book-container:hover',
                ]
            );
            $this->add_group_control(
                Group_Control_Box_Shadow::get_type(),
                [
                    'name' => 'awt_bg_book_container_hover_shadow',
                    'label' => __( 'Box Shadow', 'author-website-templates' ),
                    'selector' => '{{WRAPPER}} .rswpbs-book-container:hover',
                ]
            );
            $this->end_controls_tab();
            $this->end_controls_tabs();
            $this->end_controls_section();

            /**
             * Book Title Style
             */
            $this->start_controls_section(
                'awt_bg_book_title_style_section',
                [
                    'label' => __( 'Book Title', 'author-website-templates' ),
                    'tab'   => Controls_Manager::TAB_STYLE,
                ]
            );
            $this->start_controls_tabs(
                'awt_bg_book_title_style_tabs'
            );
            $this->start_controls_tab(
                'awt_bg_book_title_tab_normal',
                [
                    'label' => __( 'Normal', 'author-website-templates' ),
                ]
            );
            $this->add_group_control(
                Group_Control_Typography::get_type(),
                [
                    'name' => 'awt_bg_book_title_typography',
                    'selector' => '{{WRAPPER}} .rswpbs-book-loop-content-wrapper .book-title',
                ]
            );

            $this->add_control(
                'awt_bg_book_title_color',
                [
                    'label' => __( 'Title Color', 'author-website-templates' ),
                    'type' => Controls_Manager::COLOR,
                    'default' => '',
                    'selectors' => [
                        '{{WRAPPER}} .rswpbs-book-loop-content-wrapper .book-title a' => 'color: {{VALUE}};',
                    ],
                ]
            );
            $this->add_responsive_control(
                'awt_bg_book_title_padding',
                [
                    'label' => __( 'Padding', 'author-website-templates' ),
                    'type' => Controls_Manager::DIMENSIONS,
                    'size_units' => [ 'px', 'em', '%' ],
                    'selectors' => [
                        '{{WRAPPER}} .rswpbs-book-loop-content-wrapper .book-title' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
                    ],
                    'separator' => 'before',
                ]
            );
            $this->add_responsive_control(
                'awt_bg_book_title_margin',
                [
                    'label' => __( 'Margin', 'author-website-templates' ),
                    'type' => Controls_Manager::DIMENSIONS,
                    'size_units' => [ 'px', 'em', '%' ],
                    'selectors' => [
                        '{{WRAPPER}} .rswpbs-book-loop-content-wrapper .book-title' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
                    ],
                    'separator' => 'before',
                ]
            );

            $this->end_controls_tab();
            $this->start_controls_tab(
                'title_tab_hover',
                [
                    'label' => __( 'hover', 'author-website-templates' ),
                ]
            );
            $this->add_control(
                'awt_bg_book_title_hover_color',
                [
                    'label' => __( 'Title Hover Color', 'author-website-templates' ),
                    'type' => Controls_Manager::COLOR,
                    'default' => '',
                    'selectors' => [
                        '{{WRAPPER}} .rswpbs-book-loop-content-wrapper .book-title a:hover' => 'color: {{VALUE}};',
                    ],
                ]
            );
            $this->add_group_control(
                Group_Control_Text_Shadow::get_type(),
                [
                    'name' => 'awt_bg_book_title_text_hover_shadow',
                    'label' => __( 'Text Shadow', 'author-website-templates' ),
                    'selector' => '{{WRAPPER}} .rswpbs-book-loop-content-wrapper .book-title',
                ]
            );

            $this->add_control(
                'show_book_title_border',
                [
                    'label'        => __( 'Show Border?', 'author-website-templates' ),
                    'type'         => Controls_Manager::SWITCHER,
                    'label_on'     => __( 'Show', 'author-website-templates' ),
                    'label_off'    => __( 'Hide', 'author-website-templates' ),
                    'return_value' => 'true',
                    'default'      => 'true',

                ]
            );

            $this->add_control(
                'awt_bg_book_title_border_color',
                [
                    'label' => __( 'Border Color', 'author-website-templates' ),
                    'type' => Controls_Manager::COLOR,
                    'default' => '',
                    'condition' => [
                        'show_book_title_border' => 'true',
                    ],
                    'selectors' => [
                        '{{WRAPPER}} .rswpbs-book-loop-content-wrapper .book-title a.border_on_hover' => 'background-image: linear-gradient(to right, {{VALUE}} 0%, {{VALUE}} 100%);',
                    ],
                ]
            );
            $this->end_controls_tab();
            $this->end_controls_tabs();
            $this->end_controls_section();
            /**
             * Author Name Styles
             */
            $this->start_controls_section(
                'awt_bg_book_author_style',
                [
                    'label' => __( 'Book Author', 'author-website-templates' ),
                    'tab'   => Controls_Manager::TAB_STYLE,
                ]
            );
            $this->start_controls_tabs(
                'awt_bg_book_author_style_tabs',
            );
            $this->start_controls_tab(
                'awt_bg_book_author_style_normal_tab',
                [
                    'label' => __( 'Normal', 'author-website-templates' ),
                ]
            );

            $this->add_group_control(
                Group_Control_Typography::get_type(),
                [
                    'name' => 'awt_bg_book_author_prefix_typography',
                    'label' =>__( 'Prefix Typography', 'author-website-templates' ),
                    'selector' => '{{WRAPPER}} .rswpbs-book-loop-content-wrapper .book-author strong',
                ]
            );

            $this->add_control(
                'awt_bg_book_author_prefix_color',
                [
                    'label' => __( 'Prefix Color', 'author-website-templates' ),
                    'type' => Controls_Manager::COLOR,
                    'selectors' => [
                        '{{WRAPPER}} .rswpbs-book-loop-content-wrapper .book-author strong' => 'color: {{VALUE}};',
                    ],
                ]
            );
            $this->add_group_control(
                Group_Control_Typography::get_type(),
                [
                    'name' => 'awt_bg_book_author_name_typography',
                    'label' =>__( 'Author Name Typography', 'author-website-templates' ),
                    'selector' => '{{WRAPPER}} .rswpbs-book-loop-content-wrapper .book-author a',
                ]
            );
            $this->add_control(
                'awt_bg_book_author_name_color',
                [
                    'label' => __( 'Author Name Color', 'author-website-templates' ),
                    'type' => Controls_Manager::COLOR,
                    'default' => '',
                    'selectors' => [
                        '{{WRAPPER}} .rswpbs-book-loop-content-wrapper .book-author a' => 'color: {{VALUE}};',
                    ],
                ]
            );
            $this->end_controls_tab();
            $this->start_controls_tab(
                'awt_bg_book_author_style_hover_tab',
                [
                    'label' => __( 'Hover', 'author-website-templates' ),
                ]
            );
            $this->add_control(
                'awt_bg_book_author_name_hover_color',
                [
                    'label' => __( 'Author Name Hover Color', 'author-website-templates' ),
                    'type' => Controls_Manager::COLOR,
                    'default' => '',
                    'selectors' => [
                        '{{WRAPPER}} .rswpbs-book-loop-content-wrapper .book-author a:hover' => 'color: {{VALUE}};',
                    ],
                ]
            );
            $this->end_controls_tab();
            $this->end_controls_tabs();
            $this->add_responsive_control(
                'awt_bg_book_author_wrapper_padding',
                [
                    'label' => __( 'Padding', 'author-website-templates' ),
                    'type' => Controls_Manager::DIMENSIONS,
                    'size_units' => [ 'px', 'em', '%' ],
                    'selectors' => [
                        '{{WRAPPER}} .rswpbs-book-loop-content-wrapper .book-author' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
                    ],
                    'separator' => 'before',
                ]
            );
            $this->add_responsive_control(
                'awt_bg_book_author_wrapper_margin',
                [
                    'label' => __( 'Margin', 'author-website-templates' ),
                    'type' => Controls_Manager::DIMENSIONS,
                    'size_units' => [ 'px', 'em', '%' ],
                    'selectors' => [
                        '{{WRAPPER}} .rswpbs-book-loop-content-wrapper .book-author' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
                    ],
                    'separator' => 'before',
                ]
            );
            $this->end_controls_section();

            /**
             * Book Price Styles
             */
            $this->start_controls_section(
                'awt_bg_book_price_style',
                [
                    'label' => __( 'Book Price', 'author-website-templates' ),
                    'tab'   => Controls_Manager::TAB_STYLE,
                ]
            );

            $this->add_group_control(
                Group_Control_Typography::get_type(),
                [
                    'name' => 'awt_bg_book_price_typography',
                    'label' =>__( 'Regular Price Typography', 'author-website-templates' ),
                    'selector' => '{{WRAPPER}} .rswpbs-book-loop-content-wrapper .book-price .regular-price strong',
                ]
            );

            $this->add_control(
                'awt_bg_book_regular_price_color',
                [
                    'label' => __( 'Regular Price Color', 'author-website-templates' ),
                    'type' => Controls_Manager::COLOR,
                    'selectors' => [
                        '{{WRAPPER}} .rswpbs-book-loop-content-wrapper .book-price .regular-price strong' => 'color: {{VALUE}};',
                    ],
                ]
            );

            $this->add_group_control(
                Group_Control_Typography::get_type(),
                [
                    'name' => 'awt_bg_book_sale_price_typography',
                    'label' =>__( 'Sale Price Typography', 'author-website-templates' ),
                    'selector' => '{{WRAPPER}} .rswpbs-book-loop-content-wrapper .book-price .sale-price',
                ]
            );
            $this->add_control(
                'awt_bg_book_sale_price_color',
                [
                    'label' => __( 'Sale Price Color', 'author-website-templates' ),
                    'type' => Controls_Manager::COLOR,
                    'default' => '',
                    'selectors' => [
                        '{{WRAPPER}} .rswpbs-book-loop-content-wrapper .book-price .sale-price' => 'color: {{VALUE}};',
                    ],
                ]
            );

            $this->add_responsive_control(
                'awt_bg_book_price_wrapper_padding',
                [
                    'label' => __( 'Padding', 'author-website-templates' ),
                    'type' => Controls_Manager::DIMENSIONS,
                    'size_units' => [ 'px', 'em', '%' ],
                    'selectors' => [
                        '{{WRAPPER}} .rswpbs-book-loop-content-wrapper .book-price' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
                    ],
                    'separator' => 'before',
                ]
            );
            $this->add_responsive_control(
                'awt_bg_book_price_wrapper_margin',
                [
                    'label' => __( 'Margin', 'author-website-templates' ),
                    'type' => Controls_Manager::DIMENSIONS,
                    'size_units' => [ 'px', 'em', '%' ],
                    'selectors' => [
                        '{{WRAPPER}} .rswpbs-book-loop-content-wrapper .book-price' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
                    ],
                    'separator' => 'before',
                ]
            );
            $this->end_controls_section();

            /**
             * Description Text
             */
            $this->start_controls_section(
                'awt_bg_book_author_description_section',
                [
                    'label' => __( 'Book Description', 'author-website-templates' ),
                    'tab'   => Controls_Manager::TAB_STYLE,
                ]
            );
            $this->add_group_control(
                Group_Control_Typography::get_type(),
                [
                    'name' => 'awt_bg_book_description_typography',
                    'label' => __( 'Typography', 'author-website-templates' ),
                    'selector' => '{{WRAPPER}} .rswpbs-book-loop-content-wrapper .book-desc p',
                ]
            );
            $this->add_control(
                'awt_bg_book_description_color',
                [
                    'label' => __( 'Description Color', 'author-website-templates' ),
                    'type' => Controls_Manager::COLOR,
                    'default' => '',
                    'selectors' => [
                        '{{WRAPPER}} .rswpbs-book-loop-content-wrapper .book-desc p' => 'color: {{VALUE}};',
                    ],
                ]
            );
            $this->add_responsive_control(
                'awt_bg_book_description_padding',
                [
                    'label' => __( 'Padding', 'author-website-templates' ),
                    'type' => Controls_Manager::DIMENSIONS,
                    'size_units' => [ 'px', 'em', '%' ],
                    'selectors' => [
                        '{{WRAPPER}} .rswpbs-book-loop-content-wrapper .book-desc' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
                    ],
                    'separator' => 'before',
                ]
            );
            $this->add_responsive_control(
                'awt_bg_book_description_margin',
                [
                    'label' => __( 'Margin', 'author-website-templates' ),
                    'type' => Controls_Manager::DIMENSIONS,
                    'size_units' => [ 'px', 'em', '%' ],
                    'selectors' => [
                        '{{WRAPPER}} .rswpbs-book-loop-content-wrapper .book-desc' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
                    ],
                    'separator' => 'before',
                ]
            );
            $this->end_controls_section();
            /**
             * Book Button Style
             */
            $this->start_controls_section(
                'awt_bg_book_buy_btn_style_section',
                [
                    'label' => __( 'Buy Now Button', 'author-website-templates' ),
                    'tab'   => Controls_Manager::TAB_STYLE,
                ]
            );
            $this->start_controls_tabs(
                'awt_bg_book_buy_btn_style_tab'
            );
            $this->start_controls_tab(
                'awt_bg_book_buy_btn_normal_tab',
                [
                    'label' =>  __( 'Normal', 'author-website-templates' ),
                ]
            );
            $this->add_group_control(
                Group_Control_Typography::get_type(),
                [
                    'name' => 'awt_bg_book_buy_btn_typography',
                    'selector' => '{{WRAPPER}} .rswpbs-book-loop-content-wrapper .book-buy-btn a.rswpbs-book-buy-now-button',
                ]
            );
            $this->add_control(
                'awt_bg_book_buy_btn_color',
                [
                    'label' => __( 'Button Color', 'author-website-templates' ),
                    'type' => Controls_Manager::COLOR,
                    'default' => '',
                    'selectors' => [
                        '{{WRAPPER}} .rswpbs-book-loop-content-wrapper .book-buy-btn a.rswpbs-book-buy-now-button' => 'color: {{VALUE}};',
                    ],
                ]
            );

            $this->add_control(
                'awt_bg_book_buy_btn_bg_color',
                [
                    'label' => __( 'Button Background', 'author-website-templates' ),
                    'type' => Controls_Manager::COLOR,
                    'default' => '',
                    'selectors' => [
                        '{{WRAPPER}} .rswpbs-book-loop-content-wrapper .book-buy-btn a.rswpbs-book-buy-now-button' => 'background: {{VALUE}};',
                    ],
                ]
            );

            $this->add_group_control(
                Group_Control_Border::get_type(),
                [
                    'name' => 'awt_bg_book_buy_btn_border',
                    'selector' => '{{WRAPPER}} .rswpbs-book-loop-content-wrapper .book-buy-btn a.rswpbs-book-buy-now-button',
                    'separator' => 'before',
                ]
            );

            $this->add_control(
                'awt_bg_book_buy_btn_border_radius',
                [
                    'label' => __( 'Border Radius', 'author-website-templates' ),
                    'type' => Controls_Manager::DIMENSIONS,
                    'size_units' => [ 'px', '%' ],
                    'selectors' => [
                        '{{WRAPPER}} .rswpbs-book-loop-content-wrapper .book-buy-btn a.rswpbs-book-buy-now-button' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
                    ],
                ]
            );
            $this->add_group_control(
                Group_Control_Text_Shadow::get_type(),
                [
                    'name' => 'awt_bg_book_buy_btn_text_shadow',
                    'label' => __( 'Text Shadow', 'author-website-templates' ),
                    'selector' => '{{WRAPPER}} .rswpbs-book-loop-content-wrapper .book-buy-btn a.rswpbs-book-buy-now-button',
                ]
            );
            $this->end_controls_tab();
            $this->start_controls_tab(
                'awt_bg_book_buy_btn_hover_tab',
                [
                    'label' =>  __( 'Hover', 'author-website-templates' ),
                ]
            );
            $this->add_group_control(
                Group_Control_Typography::get_type(),
                [
                    'name' => 'awt_bg_book_buy_btn_hover_typography',
                    'selector' => '{{WRAPPER}} .rswpbs-book-loop-content-wrapper .book-buy-btn a.rswpbs-book-buy-now-button:hover',
                ]
            );
            $this->add_control(
                'awt_bg_book_buy_btn_hover_color',
                [
                    'label' => __( 'Button Color', 'author-website-templates' ),
                    'type' => Controls_Manager::COLOR,
                    'default' => '',
                    'selectors' => [
                        '{{WRAPPER}} .rswpbs-book-loop-content-wrapper .book-buy-btn a.rswpbs-book-buy-now-button:hover' => 'color: {{VALUE}};',
                    ],
                ]
            );
            $this->add_control(
                'awt_bg_book_buy_btn_bg_hover_color',
                [
                    'label' => __( 'Button Background', 'author-website-templates' ),
                    'type' => Controls_Manager::COLOR,
                    'default' => '',
                    'selectors' => [
                        '{{WRAPPER}} .rswpbs-book-loop-content-wrapper .book-buy-btn a.rswpbs-book-buy-now-button:hover' => 'background: {{VALUE}};',
                    ],
                ]
            );
            $this->add_group_control(
                Group_Control_Border::get_type(),
                [
                    'name' => 'awt_bg_book_buy_btn_hover_border',
                    'selector' => '{{WRAPPER}} .rswpbs-book-loop-content-wrapper .book-buy-btn a.rswpbs-book-buy-now-button:hover',
                    'separator' => 'before',
                ]
            );
            $this->add_control(
                'awt_bg_book_buy_btn_border_hover_radius',
                [
                    'label' => __( 'Border Radius', 'author-website-templates' ),
                    'type' => Controls_Manager::DIMENSIONS,
                    'size_units' => [ 'px', '%' ],
                    'selectors' => [
                        '{{WRAPPER}} .rswpbs-book-loop-content-wrapper .book-buy-btn a.rswpbs-book-buy-now-button:hover' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
                    ],
                ]
            );
            $this->add_group_control(
                Group_Control_Text_Shadow::get_type(),
                [
                    'name' => 'awt_bg_book_buy_btn_text_hover_shadow',
                    'label' => __( 'Text Shadow', 'author-website-templates' ),
                    'selector' => '{{WRAPPER}} .rswpbs-book-loop-content-wrapper .book-buy-btn a.rswpbs-book-buy-now-button:hover',
                ]
            );
            $this->end_controls_tab();
            $this->end_controls_tabs();
            $this->add_responsive_control(
                'awt_bg_book_buy_btn_padding',
                [
                    'label' => __( 'Padding', 'author-website-templates' ),
                    'type' => Controls_Manager::DIMENSIONS,
                    'size_units' => [ 'px', 'em', '%' ],
                    'selectors' => [
                        '{{WRAPPER}} .rswpbs-book-loop-content-wrapper .book-buy-btn a.rswpbs-book-buy-now-button' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
                    ],
                    'separator' => 'before',
                ]
            );
            $this->add_responsive_control(
                'awt_bg_book_buy_btn_margin',
                [
                    'label' => __( 'Margin', 'author-website-templates' ),
                    'type' => Controls_Manager::DIMENSIONS,
                    'size_units' => [ 'px', 'em', '%' ],
                    'selectors' => [
                        '{{WRAPPER}} .rswpbs-book-loop-content-wrapper .book-buy-btn' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
                    ],
                    'separator' => 'before',
                ]
            );
            $this->end_controls_section();
            /**
             * Book Add To Cart Button Style
             */
            $this->start_controls_section(
                'awt_bg_book_addtocart_style_section',
                [
                    'label' => __( 'Add To Cart Button', 'author-website-templates' ),
                    'tab'   => Controls_Manager::TAB_STYLE,
                ]
            );
            $this->start_controls_tabs(
                'awt_bg_book_addtocart_style_tab'
            );
            $this->start_controls_tab(
                'awt_bg_book_addtocart_normal_tab',
                [
                    'label' =>  __( 'Normal', 'author-website-templates' ),
                ]
            );
            $this->add_group_control(
                Group_Control_Typography::get_type(),
                [
                    'name' => 'awt_bg_book_addtocart_typography',
                    'selector' => '{{WRAPPER}} .rswpbs-book-buttons-wrapper .book-add-to-cart-btn button',
                ]
            );
            $this->add_control(
                'awt_bg_book_addtocart_color',
                [
                    'label' => __( 'Button Color', 'author-website-templates' ),
                    'type' => Controls_Manager::COLOR,
                    'default' => '',
                    'selectors' => [
                        '{{WRAPPER}} .rswpbs-book-buttons-wrapper .book-add-to-cart-btn button' => 'color: {{VALUE}};',
                    ],
                ]
            );

            $this->add_control(
                'awt_bg_book_addtocart_bg_color',
                [
                    'label' => __( 'Button Background', 'author-website-templates' ),
                    'type' => Controls_Manager::COLOR,
                    'default' => '',
                    'selectors' => [
                        '{{WRAPPER}} .rswpbs-book-buttons-wrapper .book-add-to-cart-btn button' => 'background: {{VALUE}};',
                    ],
                ]
            );

            $this->add_group_control(
                Group_Control_Border::get_type(),
                [
                    'name' => 'awt_bg_book_addtocart_border',
                    'selector' => '{{WRAPPER}} .rswpbs-book-buttons-wrapper .book-add-to-cart-btn button',
                    'separator' => 'before',
                ]
            );

            $this->add_control(
                'awt_bg_book_addtocart_border_radius',
                [
                    'label' => __( 'Border Radius', 'author-website-templates' ),
                    'type' => Controls_Manager::DIMENSIONS,
                    'size_units' => [ 'px', '%' ],
                    'selectors' => [
                        '{{WRAPPER}} .rswpbs-book-buttons-wrapper .book-add-to-cart-btn button' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
                    ],
                ]
            );
            $this->add_group_control(
                Group_Control_Text_Shadow::get_type(),
                [
                    'name' => 'awt_bg_book_addtocart_text_shadow',
                    'label' => __( 'Text Shadow', 'author-website-templates' ),
                    'selector' => '{{WRAPPER}} .rswpbs-book-buttons-wrapper .book-add-to-cart-btn button',
                ]
            );
            $this->end_controls_tab();
            $this->start_controls_tab(
                'awt_bg_book_addtocart_hover_tab',
                [
                    'label' =>  __( 'Hover', 'author-website-templates' ),
                ]
            );
            $this->add_group_control(
                Group_Control_Typography::get_type(),
                [
                    'name' => 'awt_bg_book_addtocart_hover_typography',
                    'selector' => '{{WRAPPER}} .rswpbs-book-buttons-wrapper .book-add-to-cart-btn button:hover',
                ]
            );
            $this->add_control(
                'awt_bg_book_addtocart_hover_color',
                [
                    'label' => __( 'Button Color', 'author-website-templates' ),
                    'type' => Controls_Manager::COLOR,
                    'default' => '',
                    'selectors' => [
                        '{{WRAPPER}} .rswpbs-book-buttons-wrapper .book-add-to-cart-btn button:hover' => 'color: {{VALUE}};',
                    ],
                ]
            );
            $this->add_control(
                'awt_bg_book_addtocart_bg_hover_color',
                [
                    'label' => __( 'Button Background', 'author-website-templates' ),
                    'type' => Controls_Manager::COLOR,
                    'default' => '',
                    'selectors' => [
                        '{{WRAPPER}} .rswpbs-book-buttons-wrapper .book-add-to-cart-btn button:hover' => 'background: {{VALUE}};',
                    ],
                ]
            );
            $this->add_group_control(
                Group_Control_Border::get_type(),
                [
                    'name' => 'awt_bg_book_addtocart_hover_border',
                    'selector' => '{{WRAPPER}} .rswpbs-book-buttons-wrapper .book-add-to-cart-btn button:hover',
                    'separator' => 'before',
                ]
            );
            $this->add_control(
                'awt_bg_book_addtocart_border_hover_radius',
                [
                    'label' => __( 'Border Radius', 'author-website-templates' ),
                    'type' => Controls_Manager::DIMENSIONS,
                    'size_units' => [ 'px', '%' ],
                    'selectors' => [
                        '{{WRAPPER}} .rswpbs-book-buttons-wrapper .book-add-to-cart-btn button:hover' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
                    ],
                ]
            );
            $this->add_group_control(
                Group_Control_Text_Shadow::get_type(),
                [
                    'name' => 'awt_bg_book_addtocart_text_hover_shadow',
                    'label' => __( 'Text Shadow', 'author-website-templates' ),
                    'selector' => '{{WRAPPER}} .rswpbs-book-buttons-wrapper .book-add-to-cart-btn button:hover',
                ]
            );
            $this->end_controls_tab();
            $this->end_controls_tabs();
            $this->add_responsive_control(
                'awt_bg_book_addtocart_padding',
                [
                    'label' => __( 'Padding', 'author-website-templates' ),
                    'type' => Controls_Manager::DIMENSIONS,
                    'size_units' => [ 'px', 'em', '%' ],
                    'selectors' => [
                        '{{WRAPPER}} .rswpbs-book-buttons-wrapper .book-add-to-cart-btn button' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
                    ],
                    'separator' => 'before',
                ]
            );
            $this->add_responsive_control(
                'awt_bg_book_addtocart_margin',
                [
                    'label' => __( 'Margin', 'author-website-templates' ),
                    'type' => Controls_Manager::DIMENSIONS,
                    'size_units' => [ 'px', 'em', '%' ],
                    'selectors' => [
                        '{{WRAPPER}} .rswpbs-book-loop-content-wrapper .book-buy-btn' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
                    ],
                    'separator' => 'before',
                ]
            );
            $this->end_controls_section();

    }

    protected function render() {
        $settings = $this->get_settings_for_display();

        // Collect the settings and pass them as shortcode attributes

        $show_section_title = $settings['show_section_title'] == 'yes' ? 'true' : 'false';
        $section_sub_heading = $settings['section_sub_heading'];
        $section_heading = $settings['section_heading'];
        $section_description = $settings['section_description'];

        $books_per_page = $settings['books_per_page'];
        $books_per_row = $settings['books_per_row'];
        $show_book_image = $settings['show_book_image'] === 'yes' ? 'true' : 'false';
        $book_image_type = $settings['book_image_type'];
        $show_book_title = $settings['show_book_title'] === 'yes' ? 'true' : 'false';
        $book_title_type = $settings['book_title_type'];
        $show_book_author = $settings['show_book_author'] === 'yes' ? 'true' : 'false';
        $show_book_price = $settings['show_book_price'] === 'yes' ? 'true' : 'false';
        $show_book_excerpt = $settings['show_book_excerpt'] === 'yes' ? 'true' : 'false';
        $excerpt_limit = $settings['excerpt_limit'];
        $show_buy_button = $settings['show_buy_button'] === 'yes' ? 'true' : 'false';
        $showAddToCartBtn = $settings['show_add_to_cart_btn'] === 'yes' ? 'true' : 'false';
        $include_categories = !empty($settings['include_categories']) ? implode(',', $settings['include_categories']) : '';
        $exclude_categories = !empty($settings['exclude_categories']) ? implode(',', $settings['exclude_categories']) : '';
        $include_authors = !empty($settings['include_authors']) ? implode(',', $settings['include_authors']) : '';
        $exclude_authors = !empty($settings['exclude_authors']) ? implode(',', $settings['exclude_authors']) : '';
        $include_books = !empty($settings['include_books']) ? implode(',', $settings['include_books']) : '';
        $exclude_books = !empty($settings['exclude_books']) ? implode(',', $settings['exclude_books']) : '';
        $book_offset = $settings['book_offset'];
        $order_by = $settings['order_by'];
        $order = $settings['order'];

        ?>
        <div class="awt-book-gallery-all-books-area">
            <?php if ( $show_section_title === 'true' ) : ?>
                <div class="container section-title-container">
                    <div class="row">
                        <?php if ( !empty($section_sub_heading) || !empty($section_heading) ) : ?>
                            <div class="col-md-6">
                                <div class="section-title-wrapper">
                                    <?php if ( !empty($section_sub_heading) ) : ?>
                                        <h4 class="section-title-label"><?php echo esc_html( $section_sub_heading ); ?></h4>
                                    <?php endif; ?>
                                    <?php if ( !empty($section_heading) ) : ?>
                                        <h2 class="section-title"><?php echo esc_html( $section_heading ); ?></h2>
                                    <?php endif; ?>
                                </div>
                            </div>
                        <?php endif; ?>
                        <div class="col-md-6">
                            <div class="section-description-wrapper">
                                <p><?php echo esc_html( $section_description ); ?></p>
                            </div>
                        </div>
                    </div>
                </div>
            <?php endif;
            ?>
            <div class="container">
                <div class="container-inner">
                    <?php
                    echo do_shortcode( "[rswpbs_book_gallery books_per_page=\"$books_per_page\" books_per_row=\"$books_per_row\" categories_include=\"$include_categories\" categories_exclude=\"$exclude_categories\" authors_include=\"$include_authors\" authors_exclude=\"$exclude_authors\" exclude_books=\"$exclude_books\" order=\"$order\" orderby=\"$order_by\" show_pagination=\"false\" show_author=\"$show_book_author\" show_title=\"$show_book_title\" title_type=\"$book_title_type\" show_image=\"$show_book_image\" image_type=\"$book_image_type\" image_position=\"top\" show_excerpt=\"$show_book_excerpt\" excerpt_type=\"excerpt\" excerpt_limit=\"$excerpt_limit\" show_price=\"$show_book_price\" show_add_to_cart_btn=\"$showAddToCartBtn\" show_buy_button=\"$show_buy_button\" show_msl=\"false\" msl_title_align=\"center\" content_align=\"center\" show_search_form=\"false\" show_sorting_form=\"false\" book_offset=\"$book_offset\"]" );
                    ?>
                </div>
            </div>
        </div>
    <?php
    }
}
