Plugin Directory

Changeset 2709540


Ignore:
Timestamp:
04/14/2022 05:30:30 AM (4 years ago)
Author:
mahfuz01
Message:

Tagging version trunk

Location:
product-quotation-for-woocommerce/trunk
Files:
49 added
11 deleted
9 edited

Legend:

Unmodified
Added
Removed
  • product-quotation-for-woocommerce/trunk/README.txt

    r2661996 r2709540  
    33Tags: product, quotation, woocommerce, contact form, mail
    44Requires at least: 4.0
    5 Tested up to: 5.8.3
    6 Stable tag: 1.1.0
     5Tested up to: 5.6
     6Stable tag: 1.2.0
    77License: GPLv3 or later
    88License URI: http://www.gnu.org/licenses/gpl-3.0.html
     
    6868== Changelog ==
    6969
     70= 1.2.0 - 14-04-2022 =
     71* Rewrite the whole plugin features
     72* Added new settings options.
     73* Small bug fixes
     74
    7075= 1.0.0 - 18-12-2020 =
    7176
    7277* Initial release
    7378
    74 
    75 == Upgrade Notice ==
    76 
  • product-quotation-for-woocommerce/trunk/assets/css/pqfw-admin.css

    r2445332 r2709540  
    9797    position: relative;
    9898    display: inline-block;
    99     width: 60px;
    100     height: 34px;
     99    width: 50px;
     100    height: 22px;
    101101}
    102102
     
    124124    position: absolute;
    125125    content: "";
    126     height: 26px;
    127     width: 26px;
     126    height: 16px;
     127    width: 16px;
    128128    left: 4px;
    129     bottom: 4px;
     129    bottom: 3px;
    130130    background-color: white;
    131131    transition: 0.4s;
  • product-quotation-for-woocommerce/trunk/assets/css/pqfw-frontend.css

    r2445332 r2709540  
    66 * @version 1.0.0
    77 */
     8
     9
     10#pqfw-frontend-form-wrap {
     11    display: none;
     12}
    813
    914.use-pqfw-form-default-design ul.pqfw-frontend-form {
     
    5964    width: 16px;
    6065    height: 16px;
    61     background: url('../images/wpspin_light.gif') no-repeat;
     66    background: url('../images/loader.gif') no-repeat;
    6267    display: inline-block;
    6368}
  • product-quotation-for-woocommerce/trunk/assets/js/pqfw-frontend.js

    r2445332 r2709540  
    88
    99jQuery(function ( $ ) {
     10
     11    var PQFW = {
     12        init : function() {
     13            $(document)
     14                .on('click', '.pqfw-add-to-quotation-single', function (ev) {
     15                ev.preventDefault();
     16                PQFW.sendData(this);
     17            });
     18        },
     19
     20        sendData : function(button) {
     21            console.log($(button).data('id'));
     22            var data = {
     23                productID        : $(button).data('id'),
     24                action           : PQFW_OBJECT.actions.addToQuotations,
     25                variationID      : PQFW.getVariationID(),
     26                variationDetails : PQFW.getVariationDetails(),
     27                quantity         : PQFW.getQuantity()
     28            };
     29
     30            if( PQFW.variationAlert() ) {
     31                PQFW.setLoading(button);
     32
     33                $.post( PQFW_OBJECT.ajaxurl, data,
     34                    function (response) {
     35                        PQFW.addToQuotationCart(button);
     36                    }
     37                );
     38            }
     39        },
     40        addToQuotationCart : function (button) {
     41            $(button).removeClass('loading');
     42            $(button).addClass('added');
     43            PQFW.viewQuotationCart(button);
     44        },
     45        viewQuotationCart : function (button) {
     46            var url = PQFW_OBJECT.cartPageUrl;
     47            if (url != false) {
     48                $(".pqfw-view-quotation-cart").remove();
     49                $(button).after('<a class="pqfw-view-quotation-cart"  href="' + url + '">' + PQFW_OBJECT.ViewCartLabel + '</a>');
     50            }
     51        },
     52        setLoading : function (button) {
     53            $(button).addClass('loading');
     54        },
     55        getVariationID : function () {
     56            var variation = $("form.variations_form input[name='variation_id']").val();
     57            return typeof variation != "undefined" && variation != 0 ? parseInt(variation) : 0;
     58        },
     59        getVariationDetails : function () {
     60            var variation
     61                = $("form.variations_form input[name='variation_id']").val(),
     62                details = {};
     63
     64            if (typeof variation != "undefined" && variation != 0) {
     65                jQuery('select[name^=attribute_]').each(function (ind, obj) {
     66                    details[jQuery(this).attr('name')] = jQuery(this).val();
     67                });
     68            }
     69
     70            if ($.isEmptyObject(details)) {
     71                return 0;
     72            }
     73
     74            return details;
     75        },
     76        getQuantity : function (id) {
     77            var quantity = $('form.cart input[name="quantity"]').val();
     78            return typeof quantity != "undefined" ? quantity : 1;
     79        },
     80        variationAlert : function () {
     81            if ( jQuery('.variation_id').length > 0 && jQuery('.variation_id').val() == '' || jQuery('.variation_id').val() == 0 ) {
     82                alert('Variation not selected');
     83                return false;
     84            }
     85            return true;
     86        },
     87    }
     88
     89    PQFW.init();
    1090
    1191    $( document )
     
    27107
    28108                var t = $( this ),
    29                     fragments = t.data( 'fragments' ),
    30109                    nonce = f.find( 'input[name="pqfw_form_nonce_field"]').val(),
    31110                    loader = t.next('.loading-spinner');
     
    93172
    94173                    if ( ! $.isEmptyObject( data ) ) {
    95                         //loading the product fragments and action.
    96                         data['fragments']   = fragments;
    97                         data['action']      = PQFW_OBJECT.actions.insert_entry;
     174                        data['action']      = 'pqfw_quotation_submission';
    98175                        data['nonce']       = nonce;
    99176
     
    101178                            type: 'POST',
    102179                            url: PQFW_OBJECT.ajaxurl,
    103                             // dataType: "json",
    104180                            data: data,
    105181                            beforeSend: function() {
     
    123199                                    });
    124200
     201                                    setTimeout(function() {
     202                                        window.pqfwCart.initialize();
     203                                    }, 2000);
     204
    125205                                }else {
    126206                                    resposneStatus.removeClass('success');
     
    149229        })
    150230        .trigger("pqfw_init");
    151 
    152231});
  • product-quotation-for-woocommerce/trunk/autoload.php

    r2445332 r2709540  
    11<?php
    2 
    32/**
    43 * Handling plugin spl autoloader golobally
    5  *
    6  * @since 1.0.0
     4 *
     5 * @since   1.2.0
     6 * @package PQFW
    77 */
    88
    9 spl_autoload_register( function ( $class ) {
    10     // project-specific namespace prefix
    11     $prefix = 'PQFW\\';
     9// if direct access than exit the file.
     10defined( 'ABSPATH' ) || exit;
    1211
    13     // base directory for the namespace prefix
    14     $base_dir = PQFW_PLUGIN_PATH . '/includes/';
     12spl_autoload_register(function ( $class ) {
     13    $prefix   = 'PQFW\\';
     14    $base_dir = PQFW_PLUGIN_PATH . 'includes/';
     15    $len      = strlen( $prefix );
    1516
    16     // does the class use the namespace prefix?
    17     $len = strlen( $prefix );
    18     if ( strncmp( $prefix, $class, $len ) !== 0 ) {
    19         // no, move to the next registered autoloader
    20         return;
    21     }
     17    if ( strncmp( $prefix, $class, $len ) !== 0 ) {
     18        return;
     19    }
    2220
    23     // get the relative class name
    24     $relative_class = substr( $class, $len );
     21    $class = substr( $class, $len );
     22    $arr           = explode( '\\', $class );
     23    $index         = absint( count( $arr ) - 1 );
     24    $fileName      = strtolower( $arr[ $index ] );
     25    $fileName      = str_replace( '_', '-', $fileName );
     26    $fileName      = 'class-' . $fileName;
     27    $arr[ $index ] = $fileName;
    2528
    26     // replace the namespace prefix with the base directory, replace namespace
    27     // separators with directory separators in the relative class name, append
    28     // with .php
    29     $file = $base_dir . str_replace( '\\', '/', $relative_class)  . '.php';
     29    $class = join( '\\', $arr );
     30    $file  = $base_dir . str_replace( '\\', '/', $class ) . '.php';
    3031
    31     // if the file exists, require it
    32     if ( file_exists( $file ) ) {
    33         require $file;
    34     }
    35 } );
     32    if ( file_exists( $file ) ) {
     33        require $file;
     34    }
     35});
  • product-quotation-for-woocommerce/trunk/includes/Views/layout.php

    r2445332 r2709540  
    55 *
    66 * @since   1.0.0
     7 * @package PQFW
    78 */
    89
    910use \PQFW\Database\Utils;
    1011
    11 if ( ! defined( 'ABSPATH' ) ) {
    12     exit;
    13 } // Exit if accessed directly
     12// if direct access than exit the file.
     13defined( 'ABSPATH' ) || exit;
    1414
    1515/**
     
    1919 * @since 1.0.0
    2020 */
    21 if ( isset( $_REQUEST['action'] ) && $_REQUEST['action'] === 'delete' ) {
     21if ( isset( $_REQUEST['action'] ) && 'delete' === $_REQUEST['action'] ) {
    2222
    2323    if ( ! isset( $_REQUEST['_wpnonce'] ) && ! wp_verify_nonce( $_REQUEST['_wpnonce'], 'pqfw_admin_nonce_action' ) ) {
    24         die( __( 'Unauthorized Operation', 'pqfw' ) );
     24        die( esc_html__( 'Unauthorized Operation', 'pqfw' ) );
    2525    }
    2626
     
    3232     */
    3333    if ( ! isset( $_REQUEST['pqfw-entries'] ) && isset( $_REQUEST['post'] ) && ! empty( $_REQUEST['post'] ) ) {
    34         foreach ( $_REQUEST['post'] as $post ) {
    35             Utils::soft_delete( (int) $post );
     34        foreach ( $_REQUEST['post'] as $singlePost ) {
     35            pqfw()->utils->soft_delete( (int) $singlePost );
    3636        }
    3737    }
     
    4646     */
    4747    if ( isset( $_REQUEST['pqfw-entry'] ) && ! empty( $_REQUEST['pqfw-entry'] ) ) {
    48         Utils::soft_delete( (int) $_REQUEST['pqfw-entry'] );
    49         wp_safe_redirect( \PQFW\Bootstrap::get_url_with_nonce() );
     48        pqfw()->utils->soft_delete( (int) $_REQUEST['pqfw-entry'] );
     49        wp_safe_redirect( pqfw()->get_url_with_nonce() );
    5050    }
    5151
     
    5858    if ( isset( $_REQUEST['pqfw-entries'] ) && $_REQUEST['pqfw-entries'] === 'trash' && isset( $_REQUEST['post'] ) && ! empty( $_REQUEST['post'] ) ) {
    5959        foreach ( $_REQUEST['post'] as $post ) {
    60             Utils::delete( (int) $post );
     60            pqfw()->utils->delete( (int) $post );
    6161        }
    6262
    63         wp_safe_redirect( \PQFW\Bootstrap::get_url_with_nonce( '?page=pqfw-entries-page&pqfw-entries=trash' ) );
     63        wp_safe_redirect( pqfw()->get_url_with_nonce( '?page=pqfw-entries-page&pqfw-entries=trash' ) );
    6464    }
    65 
    6665}
    6766
     
    7574
    7675    if ( ! isset( $_REQUEST['_wpnonce'] ) && ! wp_verify_nonce( $_REQUEST['_wpnonce'], 'pqfw_admin_nonce_action' ) ) {
    77         die( __( 'Unauthorized Operation', 'pqfw' ) );
     76        die( esc_html__( 'Unauthorized Operation', 'pqfw' ) );
    7877    }
    7978
     
    8786    if ( isset( $_REQUEST['action'] ) && $_REQUEST['action'] === 'restore' && isset( $_REQUEST['post'] ) && ! empty( $_REQUEST['post'] ) ) {
    8887        foreach ( $_REQUEST['post'] as $post ) {
    89             Utils::restore( (int) $post );
     88            pqfw()->utils->restore( (int) $post );
    9089        }
    9190
    92         wp_safe_redirect( \PQFW\Bootstrap::get_url_with_nonce() );
     91        wp_safe_redirect( pqfw()->get_url_with_nonce() );
    9392    }
    9493
     
    10099     */
    101100    if ( isset( $_REQUEST['pqfw-delete-entry'] ) && ! empty( $_REQUEST['pqfw-delete-entry'] ) ) {
    102         Utils::delete( (int) $_REQUEST['pqfw-delete-entry'] );
    103         wp_safe_redirect( \PQFW\Bootstrap::get_url_with_nonce( '?page=pqfw-entries-page&pqfw-entries=trash' ) );
     101        pqfw()->utils->delete( (int) $_REQUEST['pqfw-delete-entry'] );
     102        wp_safe_redirect( pqfw()->get_url_with_nonce( '?page=pqfw-entries-page&pqfw-entries=trash' ) );
    104103    }
    105104
     
    108107     * Get entry ID and pass it to the restore.
    109108     *
    110      * after performing operation redirect to entries page.
     109     * After performing operation redirect to entries page.
    111110     *
    112111     * @since 1.0.0
    113112     */
    114113    if ( isset( $_REQUEST['pqfw-restore-entry'] ) && ! empty( $_REQUEST['pqfw-restore-entry'] ) ) {
    115         Utils::restore( (int) $_REQUEST['pqfw-restore-entry'] );
    116         wp_safe_redirect( \PQFW\Bootstrap::get_url_with_nonce() );
     114        pqfw()->utils->restore( (int) $_REQUEST['pqfw-restore-entry'] );
     115        wp_safe_redirect( pqfw()->get_url_with_nonce() );
    117116    }
    118 
    119117}
    120118
     
    124122    include PQFW_PLUGIN_VIEWS . 'partials/entries.php';
    125123}
    126 
  • product-quotation-for-woocommerce/trunk/includes/Views/partials/entries.php

    r2445332 r2709540  
    44 *
    55 * @since 1.0.0
     6 * @package PQFW
    67 */
    78
     
    1011} // Exit if accessed directly
    1112
    12 use \PQFW\Database\Utils;
    13 use \PQFW\Classes\Entries_Table;
    14 use \PQFW\Bootstrap;
    15 
    16 $entries_list_table = new Entries_Table();
    17 
    18 $entries = Utils::fetch_entries(
    19     $entries_list_table->get_per_page(),
    20     $entries_list_table->get_offset(),
    21     Utils::get_status( $_REQUEST )
     13$entries = pqfw()->utils->fetch_entries(
     14    pqfw()->table->get_per_page(),
     15    pqfw()->table->get_offset(),
     16    pqfw()->utils->get_status( $_REQUEST )
    2217);
    2318
    2419?>
    2520
     21<div class="pqfw-deprecation-notice" style="background-color: azure;border: 1px solid azure; padding: 10px 20px; margin-top: 20px; max-width: 95%;">
     22    <p style="margin: 0; color: red">
     23        <?php
     24            _e( '<strong>Warning:</strong> Since, This plugin introduced new way to list the Quotaions. So, these old quotations will be removed in the next version <strong>2.0.0</strong> of release. Please backup these manually.', 'pqfw' );
     25        ?>
     26    </p>
     27</div>
     28
    2629<div class="pqfw-entries-wrapper wrap">
    27     <h1 class="screen-reader-text"><?php esc_html__( 'Product Quotation For WooCommerce', 'pqfw' ); ?></h1>
     30    <h1 class="screen-reader-text"><?php esc_html__( 'Product Quotation For WooCommerce', 'pqfw' ); ?></h1>
    2831
    29     <form method="POST">
    30         <div class="pqfw-form-entries">
     32    <form method="POST">
     33        <div class="pqfw-form-entries">
    3134
    32             <?php $entries_list_table->display( 'top' ); ?>
     35        <?php pqfw()->table->display( 'top' ); ?>
    3336
    34             <table class="wp-list-table widefat fixed striped">
    35                 <thead>
    36                 <tr>
    37                     <td id="cb" class="manage-column column-cb check-column">
    38                         <input type="checkbox">
    39                     </td>
    40                     <th class="col-entry-id"><?php _e( 'ID', 'pqfw' ); ?></th>
    41                     <th><?php _e( 'Name', 'pqfw' ); ?></th>
    42                     <th><?php _e( 'Email Address', 'pqfw' ); ?></th>
    43                     <th><?php _e( 'Actions', 'pqfw' ); ?></th>
    44                 </tr>
    45                 </thead>
     37            <table class="wp-list-table widefat fixed striped">
     38                <thead>
     39                    <tr>
     40                        <td id="cb" class="manage-column column-cb check-column">
     41                            <input type="checkbox">
     42                        </td>
     43                        <th class="col-entry-id"><?php _e( 'ID', 'pqfw' ); ?></th>
     44                        <th><?php _e( 'Name', 'pqfw' ); ?></th>
     45                        <th><?php _e( 'Email Address', 'pqfw' ); ?></th>
     46                        <th><?php _e( 'Actions', 'pqfw' ); ?></th>
     47                    </tr>
     48                </thead>
    4649
    47                 <tfoot>
    48                 <tr>
    49                     <td id="cb" class="manage-column column-cb check-column">
    50                         <input type="checkbox">
    51                     </td>
    52                     <th class="col-entry-id"><?php _e( 'ID', 'pqfw' ); ?></th>
    53                     <th><?php _e( 'Name', 'pqfw' ); ?></th>
    54                     <th><?php _e( 'Email Address', 'pqfw' ); ?></th>
    55                     <th><?php _e( 'Actions', 'pqfw' ); ?></th>
    56                 </tr>
    57                 </tfoot>
     50                <tfoot>
     51                    <tr>
     52                        <td id="cb" class="manage-column column-cb check-column">
     53                            <input type="checkbox">
     54                        </td>
     55                        <th class="col-entry-id"><?php _e( 'ID', 'pqfw' ); ?></th>
     56                        <th><?php _e( 'Name', 'pqfw' ); ?></th>
     57                        <th><?php _e( 'Email Address', 'pqfw' ); ?></th>
     58                        <th><?php _e( 'Actions', 'pqfw' ); ?></th>
     59                    </tr>
     60                </tfoot>
    5861
    59                 <tbody>
     62                <tbody>
    6063                <?php
    6164                if ( $entries ) {
    6265                    foreach ( $entries as $entry ) {
    6366                        ?>
    64                         <tr>
    65                             <th scope="row" class="check-column"><input type="checkbox" name="post[]" value="<?php echo esc_attr( $entry->ID ); ?>">
    66                             </th>
    67                             <th class="col-entry-id">
    68                                 <?php if ( Utils::get_status( $_REQUEST ) === 'trash' ) : ?>
    69                                     <span>#<?php echo esc_attr( $entry->ID ); ?></span>
     67                        <tr>
     68                            <th scope="row" class="check-column"><input type="checkbox" name="post[]" value="<?php echo esc_attr( $entry->ID ); ?>">
     69                            </th>
     70
     71                            <th class="col-entry-id">
     72                                <?php if ( 'trash' === pqfw()->utils->get_status( $_REQUEST ) ) : ?>
     73                                <span>#<?php echo esc_attr( $entry->ID ); ?></span>
    7074                                <?php else : ?>
    71                                     <a href="<?php echo Bootstrap::get_url_with_nonce( '?page=pqfw-entries-page&pqfw-entry=' . esc_attr( $entry->ID ) ); ?>"
    72                                        class="">#<?php echo esc_attr( $entry->ID ); ?></a>
     75                                <a href="<?php echo esc_url( pqfw()->get_url_with_nonce( 'edit.php?post_type=pqfw_quotations&page=pqfw-entries-page&pqfw-entry=' . esc_attr( $entry->ID ) ) ); ?>"
     76                                class="">#<?php echo esc_attr( $entry->ID ); ?></a>
    7377                                <?php endif; ?>
    74                             </th>
    75                             <td><span><?php echo esc_attr( $entry->fullname ); ?></span></td>
    76                             <td><span><?php echo esc_attr( $entry->email ); ?></span></td>
    77                             <th class="col-entry-details">
    78                                 <?php if ( Utils::get_status( $_REQUEST ) === 'trash' ) : ?>
    79                                     <a href="<?php echo Bootstrap::get_url_with_nonce( '?page=pqfw-entries-page&pqfw-entries=trash&pqfw-restore-entry=' . esc_attr( $entry->ID ) ); ?>">
    80                                         <?php _e( 'Restore', 'pqfw' ); ?>
    81                                     </a>
    82                                     <span style="color: rgb(221, 221, 221);">|</span>
    83                                     <a href="<?php echo Bootstrap::get_url_with_nonce( '?page=pqfw-entries-page&pqfw-entries=trash&pqfw-delete-entry=' . esc_attr( $entry->ID ) ); ?>">
    84                                         <?php _e( 'Delete Permanently', 'pqfw' ); ?>
    85                                     </a>
     78                            </th>
     79                            <td><span><?php echo esc_attr( $entry->fullname ); ?></span></td>
     80                            <td><span><?php echo esc_attr( $entry->email ); ?></span></td>
     81                            <th class="col-entry-details">
     82                                <?php if ( pqfw()->utils->get_status( $_REQUEST ) === 'trash' ) : ?>
     83                                    <a href="<?php echo esc_url( pqfw()->get_url_with_nonce( 'edit.php?post_type=pqfw_quotations&page=pqfw-entries-page&pqfw-entries=trash&pqfw-restore-entry=' . esc_attr( $entry->ID ) ) ); ?>">
     84                                        <?php esc_html_e( 'Restore', 'pqfw' ); ?>
     85                                    </a>
     86                                    <span style="color: rgb(221, 221, 221);">|</span>
     87                                    <a href="<?php echo esc_url( pqfw()->get_url_with_nonce( 'edit.php?post_type=pqfw_quotations&page=pqfw-entries-page&pqfw-entries=trash&pqfw-delete-entry=' . esc_attr( $entry->ID ) ) ); ?>">
     88                                        <?php esc_html_e( 'Delete Permanently', 'pqfw' ); ?>
     89                                    </a>
    8690                                <?php else : ?>
    87                                     <a href="<?php echo Bootstrap::get_url_with_nonce( '?page=pqfw-entries-page&pqfw-entry=' . esc_attr( $entry->ID ) ); ?>"
    88                                        class=""><?php _e( 'Details', 'pqfw' ); ?></a>
     91                                    <a href="<?php echo esc_url( pqfw()->get_url_with_nonce( 'edit.php?post_type=pqfw_quotations&page=pqfw-entries-page&pqfw-entry=' . esc_attr( $entry->ID ) ) ); ?>"
     92                                    class=""><?php esc_html_e( 'Details', 'pqfw' ); ?></a>
    8993                                <?php endif; ?>
    90                             </th>
    91                         </tr>
     94                            </th>
     95                        </tr>
    9296                        <?php
    9397                    }
    9498                } else {
    9599                    ?>
    96                     <tr>
    97                         <th></th>
    98                         <td>
    99                             <span><?php _e( 'No entries found.', 'pqfw' ); ?></span>
    100                         </td>
    101                     </tr>
     100                    <tr>
     101                        <th></th>
     102                        <td>
     103                            <span><?php esc_html_e( 'No entries found.', 'pqfw' ); ?></span>
     104                        </td>
     105                    </tr>
    102106                    <?php
    103107                }
    104108                ?>
    105                 </tbody>
    106 
    107             </table>
    108 
    109             <?php //$entries_list_table->display( 'bottom' ); ?>
    110 
    111         </div>
    112     </form>
     109                </tbody>
     110            </table>
     111        </div>
     112    </form>
    113113</div>
  • product-quotation-for-woocommerce/trunk/includes/Views/partials/entry-details.php

    r2445332 r2709540  
    1010} // Exit if accessed directly
    1111
    12 use \PQFW\Database\Utils;
    13 use \PQFW\Bootstrap;
    1412
    15 $entry = Utils::fetch_entry( absint( $_REQUEST['pqfw-entry'] ) );
     13$entry = pqfw()->utils->fetch_entry( absint( $_REQUEST['pqfw-entry'] ) );
    1614
    1715?>
     
    3331
    3432                <h1 class="wp-heading-inline"><?php _e( 'Entry Details', 'pqfw' ); ?></h1>
    35                 <a href="<?php echo Bootstrap::get_url_with_nonce(); ?>"
     33                <a href="<?php echo esc_url( pqfw()->get_url_with_nonce( 'edit.php?post_type=pqfw_quotations&page=pqfw-entries-page' ) ); ?>"
    3634                   class="page-title-action"><?php _e( 'Back to Entries', 'pqfw' ); ?></a>
    3735                <form method="POST">
  • product-quotation-for-woocommerce/trunk/product-quotation-for-woocommerce.php

    r2445332 r2709540  
    44 * Plugin URI: https://github.com/mahafuz/product-quotation-for-woocommerce
    55 * Description: Removes the 'Add to cart' button from WooCommerce and adds a simple 'Request for quotation' form on all product pages instead of it.
    6  * Version: 1.0
     6 * Version: 1.2.0
    77 * Author: Mahafuz <m.mahfuz.me@gmail.com>
    88 * Author URI: https://github.com/mahafuz/
    99 * Text Domain: pqfw
    1010 * Domain Path: /languages
     11 *
     12 * @package PQFW
    1113 */
    1214
    13 if ( ! defined( 'ABSPATH' ) ) {
    14     exit;
    15 } // Exit if accessed directly
     15// if direct access than exit the file.
     16defined( 'ABSPATH' ) || exit;
    1617
    1718/**
    1819 * Defining plugin constans
    1920 *
    20  * @since 1.0.0
     21 * @since 1.2.0
    2122 */
    2223define( 'PQFW_PLUGIN_FILE', __FILE__ );
     
    2526define( 'PQFW_PLUGIN_VIEWS', trailingslashit( plugin_dir_path( __FILE__ ) . 'includes/Views' ) );
    2627define( 'PQFW_PLUGIN_URL', trailingslashit( plugins_url( '/', __FILE__ ) ) );
    27 define( 'PQFW_PLUGIN_VERSION', '1.0.0' );
    28 
    29 /**
    30  * Including spl autoloader globally.
    31  *
    32  * @since 1.0.0
    33  */
    34 require PQFW_PLUGIN_PATH . 'autoload.php';
    35 
    36 /**
    37  * Run the plugin after all other plugins.
    38  *
    39  * @since 1.0.0
    40  */
    41 add_action( 'plugins_loaded', function () {
    42     \PQFW\Bootstrap::instance();
    43 } );
     28define( 'PQFW_PLUGIN_VERSION', '1.2.0' );
    4429
    4530/**
     
    4833 * @since 1.0.0
    4934 */
    50 register_activation_hook( __FILE__, function () {
    51     $migration = new \PQFW\Database\Migration();
    52     $migration->run();
    53 } );
     35register_activation_hook(__FILE__, function () {
     36    pqfw()->migration->run();
     37});
     38
     39require PQFW_PLUGIN_PATH . 'includes/PQFW.php';
     40
     41add_action( 'plugins_loaded', function() {
     42    pqfw();
     43});
     44
     45require __DIR__ . '/vendor/autoload.php';
     46
     47/**
     48 * Initialize the plugin tracker
     49 *
     50 * @since 1.2.0
     51 * @return void
     52 */
     53function appsero_init_tracker_product_quotation_for_woocommerce() {
     54    if ( ! class_exists( 'Appsero\Client' ) ) {
     55        require_once __DIR__ . '/appsero/src/Client.php';
     56    }
     57
     58    $client = new Appsero\Client( 'e806fe7d-f314-425d-8be4-9f62fdaf71cf', 'Product Quotation &#8211; Product Quotation For WooCommerce', __FILE__ );
     59
     60    // Active insights.
     61    $client->insights()->init();
     62}
     63appsero_init_tracker_product_quotation_for_woocommerce();
Note: See TracChangeset for help on using the changeset viewer.