Plugin Directory

Changeset 2376567


Ignore:
Timestamp:
09/07/2020 02:03:03 PM (6 years ago)
Author:
devbunch
Message:

comments & pagination

Location:
master-elements/trunk
Files:
2 added
5 edited

Legend:

Unmodified
Added
Removed
  • master-elements/trunk/addons/widgets.php

    r2376549 r2376567  
    323323                'woo-product-archive' =>[
    324324
    325                    
    326 
    327325                    'name' => 'MW: Archive Products',
    328326
    329 
    330 
    331327                    'id' => 'me_woo_product_archive',
    332328
    333 
    334 
    335329                    'item' => 'woo-product-archive',
    336330
     
    344338
    345339                    'item' => 'woo-product-stock',
     340                ],
     341
     342                'woo-product-comments' => [
     343
     344                    'name' => 'MW: Product Comments',
     345
     346                    'id' => 'me_woo_product_comments',
     347
     348                    'item' => 'woo-product-comments',
    346349                ],
    347350
  • master-elements/trunk/addons/widgets/woo-next-prev-button/woo-next-prev-button.php

    r2376549 r2376567  
    6868    }
    6969
    70     function bbloomer_prev_next_product(){
     70    protected function _register_controls(){
     71
     72        $this->start_controls_section(
     73            'me_pagination_button',
     74            [
     75                'label' => __( 'Pagination Button', 'masterelements' ),
     76                'tab' => Controls_Manager::TAB_CONTENT,
     77            ]
     78        );
     79
     80        $this->add_control(
     81            'me_pagination_button_before',
     82            [
     83                'label' => __('Show Button Before Product', 'masterelements'),
     84                'type' => Controls_Manager::SWITCHER,
     85                'return_value' => 'true',
     86                'default' => '',
     87            ]
     88        );
     89
     90        $this->add_control(
     91            'me_pagination_button_after',
     92            [
     93                'label' => __('Show Button After Product', 'masterelements'),
     94                'type' => Controls_Manager::SWITCHER,
     95                'return_value' => 'true',
     96                'default' => '',
     97            ]
     98        );
     99
     100        $this->end_controls_section();
     101
     102        $this->start_controls_section(
     103            'me_pagination_button_text',
     104            [
     105                'label' => __( 'Previous/Next Style', 'masterelements' ),
     106                'tab' => Controls_Manager::TAB_STYLE,
     107            ]
     108        );
     109        $this->start_controls_tabs('me_pagination_button_style_tabs');
     110
     111        // Start Normal Submit button tab
     112        $this->start_controls_tab(
     113            'me_pagination_button_normal_tab',
     114            [
     115                'label' => __( 'Normal', 'masterelements' ),
     116            ]
     117        );
     118        $this->add_control(
     119            'me_pagination_button_text_color',
     120            [
     121                'label'     => __( 'Text Color', 'masterelements' ),
     122                'type'      => Controls_Manager::COLOR,
     123                'selectors' => [
     124                    '{{WRAPPER}} .prev_next_buttons a[rel="next"]'   => 'color: {{VALUE}};',
     125                ],
     126            ]
     127        );
     128        $this->add_control(
     129            'me_pagination_button_bg_color',
     130            [
     131                'label' => __('Background Color', 'masterelements'),
     132                'type' => Controls_Manager::COLOR,
     133                'selectors' => [
     134                    '{{WRAPPER}} .prev_next_buttons a[rel="next"]' => 'background-color: {{VALUE}}',
     135                ],
     136            ]
     137        );
     138        $this->add_group_control(
     139            Group_Control_Border::get_type(),
     140            [
     141                'name' => 'me_pagination_button_border',
     142                'label' => __( 'Border', 'masterelements' ),
     143                'selector' => '{{WRAPPER}} .prev_next_buttons a[rel="next"]',
     144                'separator' =>'before',
     145            ]
     146        );
     147
     148        $this->add_responsive_control(
     149            'me_pagination_button_border_radius',
     150            [
     151                'label' => esc_html__( 'Border Radius', 'masterelements' ),
     152                'type' => Controls_Manager::DIMENSIONS,
     153                'selectors' => [
     154                    '{{WRAPPER}} .prev_next_buttons a[rel="next"]' => 'border-radius: {{TOP}}px {{RIGHT}}px {{BOTTOM}}px {{LEFT}}px;',
     155                ],
     156            ]
     157        );
     158        $this->add_responsive_control(
     159            'me_pagination_button_margin',
     160            [
     161                'label' => esc_html__( 'Margin', 'masterelements' ),
     162                'type' => Controls_Manager::DIMENSIONS,
     163                'size_units' => [ 'px', 'em' ],
     164                'selectors' => [
     165                    '{{WRAPPER}} .prev_next_buttons a[rel="next"]' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
     166                ],
     167                'separator' => 'before',
     168            ]
     169        );
     170        $this->end_controls_tab();
     171
     172        $this->start_controls_tab(
     173            'me_pagination_button_hover_tab',
     174            [
     175                'label' => __( 'Hover', 'masterelements' ),
     176            ]
     177        );
     178        $this->add_control(
     179            'me_pagination_button_text_color_hover',
     180            [
     181                'label'     => __( 'Text Color', 'masterelements' ),
     182                'type'      => Controls_Manager::COLOR,
     183                'selectors' => [
     184                    '{{WRAPPER}} .prev_next_buttons a[rel="next"]:hover'   => 'color: {{VALUE}};',
     185                ],
     186            ]
     187        );
     188        $this->add_control(
     189            'me_pagination_button_bg_color_hover',
     190            [
     191                'label' => __('Background Color', 'masterelements'),
     192                'type' => Controls_Manager::COLOR,
     193                'selectors' => [
     194                    '{{WRAPPER}} .prev_next_buttons a[rel="next"]:hover' => 'background-color: {{VALUE}}',
     195                ],
     196            ]
     197        );
     198        $this->add_group_control(
     199            Group_Control_Border::get_type(),
     200            [
     201                'name' => 'me_pagination_button_border_hover',
     202                'label' => __( 'Border', 'masterelements' ),
     203                'selector' => '{{WRAPPER}} .prev_next_buttons a[rel="next"]:hover',
     204                'separator' =>'before',
     205            ]
     206        );
     207
     208        $this->add_responsive_control(
     209            'me_pagination_button_border_radius_hover',
     210            [
     211                'label' => esc_html__( 'Border Radius', 'masterelements' ),
     212                'type' => Controls_Manager::DIMENSIONS,
     213                'selectors' => [
     214                    '{{WRAPPER}} .prev_next_buttons a[rel="next"]:hover' => 'border-radius: {{TOP}}px {{RIGHT}}px {{BOTTOM}}px {{LEFT}}px;',
     215                ],
     216            ]
     217        );
     218        $this->end_controls_tab();
     219
     220        $this->end_controls_tabs();
     221
     222        $this->end_controls_section();
     223    }
     224
     225    function master_prev_next_product(){
    71226
    72227        echo '<div class="prev_next_buttons">';
    73228
    74         // 'product_cat' will make sure to return next/prev from current category
    75229        $previous = next_post_link('%link', '&larr; PREVIOUS', TRUE, ' ', 'product_cat');
    76230        $next = previous_post_link('%link', 'NEXT &rarr;', TRUE, ' ', 'product_cat');
     
    82236
    83237    }
     238
    84239    protected function render()
    85240    {
    86         add_action('woocommerce_before_single_product', array($this, 'bbloomer_prev_next_product'));
    87 
    88 // and if you also want them at the bottom...
    89         add_action('woocommerce_after_single_product', array($this, 'bbloomer_prev_next_product'));
     241        $settings = $this->get_settings_for_display();
     242        $master_button = new Master_Woocommerce_Functions();
     243        if ( $master_button :: mw_is_is_edit_mode() ) {
     244
     245            echo "Previous and Next Button will be shown on the page this addon is applied on.";
     246        }
     247        else{
     248
     249            if( $settings['me_pagination_button_before'] == 'true')
     250            {
     251                add_action('woocommerce_before_single_product', array($this, 'master_prev_next_product'));
     252                do_action( 'woocommerce_before_single_product', array($this, 'master_prev_next_product') );
     253            }
     254           elseif($settings['me_pagination_button_after'] == 'true'){
     255               add_action('woocommerce_after_single_product', array($this, 'master_prev_next_product'));
     256               do_action( 'woocommerce_after_single_product', array($this, 'master_prev_next_product') );
     257           }
     258
     259        }
    90260
    91261    }
  • master-elements/trunk/changelog.txt

    r2376549 r2376567  
     107/09/2020
     2
     3Version 4.4
     4
     5    [New] pagination addon
     6    [New] Comment addon
     7
    1807/09/2020
    29
  • master-elements/trunk/masterelements.php

    r2376549 r2376567  
    1010 * Plugin URI: https://akdesigner.com/
    1111 * Author: TeamDevBunch
    12  * Version: 4.3
     12 * Version: 4.4
    1313 * Tested up to: 5.5
    1414 * Author URI: https://devbunch.com/
  • master-elements/trunk/readme.txt

    r2376549 r2376567  
    6464
    6565== Changelog ==
     66= 07/09/2020 Version 4.4 =
     67*  [New] pagination addon
     68*  [New] Comment addon
     69
    6670= 07/09/2020 Version 4.3 =
    6771*  [Fix] item css fix
Note: See TracChangeset for help on using the changeset viewer.