Plugin Directory

Changeset 1510641


Ignore:
Timestamp:
10/08/2016 07:06:54 AM (9 years ago)
Author:
rnaby
Message:

Version 2.0.0 Release.

Location:
woocom-add-multiple-products
Files:
64 added
3 edited

Legend:

Unmodified
Added
Removed
  • woocom-add-multiple-products/trunk/readme.txt

    r1357929 r1510641  
    1616This plugin adds the functionality to add bulk products from one input. It adds an input field at the end of cart page. From this input field you can add multiple products to cart by Ajax request. Enjoy.
    1717
    18 And you also can use shortcode to use the plugin other places. Just place the shortcode where you wanna put the input form and it's done !!!
     18And you also can use shortcode to use the plugin other places. Just place the shortcode where you wanna put the input form and it's done !!!
     19
     20= Features =
     21
     22*   Add multiple products from one input box.
     23*   Select product by SKU or name.
     24*   Product category restriction option.
     25*   Multiple product categories select option.
     26*   User auhtentication option.
     27*   User role based authentication.
     28*   Shortcode for showing the form elsewhere.
     29*   Widget for placing the form in any kind of sidebar.
    1930
    2031= Shortcode =
     
    3748= Is it use ajax for adding product to cart? =
    3849
    39 Yes. It use ajax for adding product to cart.
     50Yes. It use ajax for adding product to cart. But for showing the update it reloads the page.
     51
     52= Does it has any widget to place the form in sidebar?
     53
     54Yes. It has a widget.
    4055
    4156= Can I use this outside cart? =
     
    4762Yes. You can.
    4863
     64= Any user authentication system for the form ? =
     65
     66Yes. Visit the plugins settings page.
     67
    4968== Screenshots ==
    5069
    51701. Products input.
     712. Settings page. You can change or set the necessary settings form this page.
     723. Widget screenshot.
    5273
    5374== Changelog ==
    5475
     76= 2.0.0 =
     77* Some bug fixed.
     78* Full plugin code refactored.
     79* Widget added.
     80* Settings page added.
     81* User authentication added.
     82* User role based authentication added.
     83* Support for product category filter added.
     84
     85= 1.0.9 =
     86* Some bug fixed.
     87
    5588= 1.0.0 =
    5689* Initial version.
  • woocom-add-multiple-products/trunk/uninstall.php

    r1224703 r1510641  
    22
    33/**
    4  * The code in this file runs when a plugin is uninstalled from the WordPress dashboard.
     4 * Fired when the plugin is uninstalled.
     5 *
     6 * When populating this file, consider the following flow
     7 * of control:
     8 *
     9 * - This method should be static
     10 * - Check if the $_REQUEST content actually is the plugin name
     11 * - Run an admin referrer check to make sure it goes through authentication
     12 * - Verify the output of $_GET makes sense
     13 * - Repeat with other user roles. Best directly by using the links/query string parameters.
     14 * - Repeat things for multisite. Once for a single site in the network, once sitewide.
     15 *
     16 * This file may be updated more in future version of the Boilerplate; however, this is the
     17 * general skeleton and outline for how the file should work.
     18 *
     19 * For more information, see the following discussion:
     20 * https://github.com/tommcfarlin/WordPress-Plugin-Boilerplate/pull/123#issuecomment-28541913
     21 *
     22 * @link       https://bd.linkedin.com/in/rnaby
     23 * @since      2.0.0
     24 *
     25 * @package    Woocom_Add_Multiple_Products
    526 */
    627
    7 /* If uninstall is not called from WordPress exit. */
    8 if ( !defined( 'WP_UNINSTALL_PLUGIN' ) ) {
    9     exit ();
     28// If uninstall not called from WordPress, then exit.
     29if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) {
     30    exit;
    1031}
    11 
    12 /* Place uninstall code below here. */
  • woocom-add-multiple-products/trunk/woocom-add-multiple-products.php

    r1357929 r1510641  
    11<?php
    22
    3 /*
    4   Plugin Name: WooCom Add Multiple Products
    5   Plugin URI: https://sodathemes.com
    6   Description: A plugin for adding multiple product to cart.
    7   Version: 1.0.9
    8   Author: Khan Mohammad Rashedun-Naby
    9   Author URI: http://bd.linkedin.com/in/rnaby
    10   License: GPL V3
     3/**
     4 * The plugin bootstrap file
     5 *
     6 * This file is read by WordPress to generate the plugin information in the plugin
     7 * admin area. This file also includes all of the dependencies used by the plugin,
     8 * registers the activation and deactivation functions, and defines a function
     9 * that starts the plugin.
     10 *
     11 * @link              https://bd.linkedin.com/in/rnaby
     12 * @since             2.0.0
     13 * @package           Woocom_Add_Multiple_Products
     14 *
     15 * @wordpress-plugin
     16 * Plugin Name:       WooCom Add Multiple Products
     17 * Plugin URI:        https://github.com/rnaby
     18 * Description:       This plugin adds the functionality to add bulk products from one input. It adds an input field at the end of cart page. From this input field you can add multiple products to cart by Ajax request
     19 * Version:           2.0.0
     20 * Author:            SodaThemes
     21 * Author URI:        https://bd.linkedin.com/in/rnaby
     22 * Text Domain:       woocom-add-multiple-products
     23 * Domain Path:       /languages
    1124 */
    1225
    13 if ( ! defined( 'ABSPATH' ) ) {
    14     exit; // Exit if accessed directly
    15 }
    16 
    17 class WooCom_Add_Multiple_Products {
    18     private static $instance = null;
    19     private $plugin_path;
    20     private $plugin_url;
    21     private $text_domain = '';
    22 
    23     /**
    24      * Creates or returns an instance of this class.
    25      */
    26     public static function get_instance() {
    27         // If an instance hasn't been created and set to $instance create an instance and set it to $instance.
    28         if ( null == self::$instance ) {
    29             self::$instance = new self;
    30         }
    31 
    32         return self::$instance;
    33     }
    34 
    35     /**
    36      * Initializes the plugin by setting localization, hooks, filters, and administrative functions.
    37      */
    38     private function __construct() {
    39         $this->plugin_path = plugin_dir_path( __FILE__ );
    40         $this->plugin_url  = plugin_dir_url( __FILE__ );
    41 
    42         load_plugin_textdomain( $this->text_domain, false, $this->plugin_path . '\lang' );
    43 
    44         add_action( 'admin_enqueue_scripts', array( $this, 'register_scripts' ) );
    45         add_action( 'admin_enqueue_scripts', array( $this, 'register_styles' ) );
    46 
    47         add_action( 'wp_enqueue_scripts', array( $this, 'register_scripts' ) );
    48         add_action( 'wp_enqueue_scripts', array( $this, 'register_styles' ) );
    49 
    50         register_activation_hook( __FILE__, array( $this, 'activation' ) );
    51         register_deactivation_hook( __FILE__, array( $this, 'deactivation' ) );
    52 
    53         $this->run_plugin();
    54     }
    55 
    56     public function get_plugin_url() {
    57         return $this->plugin_url;
    58     }
    59 
    60     public function get_plugin_path() {
    61         return $this->plugin_path;
    62     }
    63 
    64     /**
    65      * Plugin activation code.
    66      */
    67     public function activation() {
    68 
    69     }
    70 
    71     /**
    72      * Plugin deactivation code.
    73      */
    74     public function deactivation() {
    75 
    76     }
    77 
    78     /**
    79      * Enqueue and register JavaScript files.
    80      */
    81     public function register_scripts() {
    82 
    83     }
    84     /**
    85      * Enqueue and register CSS files.
    86      */
    87     public function register_styles() {
    88        
    89     }
    90 
    91     /**
    92      * Functionality.
    93      */
    94     private function run_plugin() {
    95         require 'lib/class-main.php';
    96         new WooCom_Add_Multiple_Products_Main;
    97     }
     26// If this file is called directly, abort.
     27if ( ! defined( 'WPINC' ) ) {
     28    die;
    9829}
    9930
    10031/**
    101  * If WooCommerce is active.
     32 * The code that runs during plugin activation.
     33 * This action is documented in includes/class-woocom-add-multiple-products-activator.php
     34 */
     35function activate_woocom_add_multiple_products() {
     36    require_once plugin_dir_path( __FILE__ ) . 'includes/class-woocom-add-multiple-products-activator.php';
     37    Woocom_Add_Multiple_Products_Activator::activate();
     38}
     39
     40/**
     41 * The code that runs during plugin deactivation.
     42 * This action is documented in includes/class-woocom-add-multiple-products-deactivator.php
     43 */
     44function deactivate_woocom_add_multiple_products() {
     45    require_once plugin_dir_path( __FILE__ ) . 'includes/class-woocom-add-multiple-products-deactivator.php';
     46    Woocom_Add_Multiple_Products_Deactivator::deactivate();
     47}
     48
     49register_activation_hook( __FILE__, 'activate_woocom_add_multiple_products' );
     50register_deactivation_hook( __FILE__, 'deactivate_woocom_add_multiple_products' );
     51
     52/**
     53 * The core plugin class that is used to define internationalization,
     54 * admin-specific hooks, and public-facing site hooks.
     55 */
     56require plugin_dir_path( __FILE__ ) . 'includes/class-woocom-add-multiple-products.php';
     57
     58/**
     59 * Begins execution of the plugin.
     60 *
     61 * Since everything within the plugin is registered via hooks,
     62 * then kicking off the plugin from this point in the file does
     63 * not affect the page life cycle.
     64 *
     65 * @since    2.0.0
     66 */
     67function run_woocom_add_multiple_products() {
     68
     69    $plugin = new Woocom_Add_Multiple_Products();
     70    $plugin->run();
     71
     72}
     73
     74/**
     75 * Check if WooCommerce is active
    10276 **/
    10377if ( in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ) {
    104     WooCom_Add_Multiple_Products::get_instance();
     78    run_woocom_add_multiple_products();
     79} else {
     80    require_once( ABSPATH . 'wp-admin/includes/plugin.php' );
     81    deactivate_plugins( plugin_basename( __FILE__ ) );
     82    add_action( 'admin_notices', 'sodathemes_wamp_admin_notice__error' );
    10583}
     84
     85function sodathemes_wamp_admin_notice__error() {
     86    $class = 'notice notice-error';
     87    $message = __( 'You don\'t have WooCommerce activated. Please Activate <b>WooCommerce</b> and then try to activate again <b>WooCom Add Multiple Products</b>.', 'sodathemes' );
     88
     89    printf( '<div class="%1$s"><p>%2$s</p></div>', $class, $message );
     90}
Note: See TracChangeset for help on using the changeset viewer.