Changeset 1510641
- Timestamp:
- 10/08/2016 07:06:54 AM (9 years ago)
- Location:
- woocom-add-multiple-products
- Files:
-
- 64 added
- 3 edited
-
assets/screenshot-2.png (added)
-
assets/screenshot-3.png (added)
-
tags/1.0.9 (added)
-
tags/1.0.9/lang (added)
-
tags/1.0.9/lib (added)
-
tags/1.0.9/lib/class-main.php (added)
-
tags/1.0.9/lib/css (added)
-
tags/1.0.9/lib/css/chosen-sprite.png (added)
-
tags/1.0.9/lib/css/chosen-sprite@2x.png (added)
-
tags/1.0.9/lib/css/chosen.css (added)
-
tags/1.0.9/lib/css/chosen.min.css (added)
-
tags/1.0.9/lib/css/main.css (added)
-
tags/1.0.9/lib/img (added)
-
tags/1.0.9/lib/img/loading.gif (added)
-
tags/1.0.9/lib/js (added)
-
tags/1.0.9/lib/js/ajax.js (added)
-
tags/1.0.9/lib/js/main.js (added)
-
tags/1.0.9/uninstall.php (added)
-
tags/1.0.9/woocom-add-multiple-products.php (added)
-
trunk/admin (added)
-
trunk/admin/class-woocom-add-multiple-products-admin.php (added)
-
trunk/admin/css (added)
-
trunk/admin/css/woocom-add-multiple-products-admin.css (added)
-
trunk/admin/img (added)
-
trunk/admin/img/logo.png (added)
-
trunk/admin/img/sodathemes-typw.png (added)
-
trunk/admin/img/sodathemes-wamp.png (added)
-
trunk/admin/img/sodathemes-wsc.png (added)
-
trunk/admin/index.php (added)
-
trunk/admin/js (added)
-
trunk/admin/js/woocom-add-multiple-products-admin.js (added)
-
trunk/admin/partials (added)
-
trunk/admin/partials/html-admin-form.php (added)
-
trunk/admin/partials/index.php (added)
-
trunk/includes (added)
-
trunk/includes/class-woocom-add-multiple-products-activator.php (added)
-
trunk/includes/class-woocom-add-multiple-products-deactivator.php (added)
-
trunk/includes/class-woocom-add-multiple-products-i18n.php (added)
-
trunk/includes/class-woocom-add-multiple-products-loader.php (added)
-
trunk/includes/class-woocom-add-multiple-products.php (added)
-
trunk/includes/index.php (added)
-
trunk/index.php (added)
-
trunk/languages (added)
-
trunk/languages/woocom-add-multiple-products.pot (added)
-
trunk/public (added)
-
trunk/public/class-woocom-add-multiple-products-public.php (added)
-
trunk/public/css (added)
-
trunk/public/css/woocom-add-multiple-products-public.css (added)
-
trunk/public/img (added)
-
trunk/public/img/loading.gif (added)
-
trunk/public/index.php (added)
-
trunk/public/js (added)
-
trunk/public/js/woocom-add-multiple-products-public.js (added)
-
trunk/public/partials (added)
-
trunk/public/partials/html-public-input-field.php (added)
-
trunk/public/partials/html-public-shortcode-input-field.php (added)
-
trunk/public/partials/index.php (added)
-
trunk/readme.txt (modified) (3 diffs)
-
trunk/uninstall.php (modified) (1 diff)
-
trunk/widget (added)
-
trunk/widget/class-woocom-add-multiple-products-widget.php (added)
-
trunk/widget/index.php (added)
-
trunk/widget/partials (added)
-
trunk/widget/partials/html-admin-view.php (added)
-
trunk/widget/partials/html-public-view.php (added)
-
trunk/widget/partials/index.php (added)
-
trunk/woocom-add-multiple-products.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
woocom-add-multiple-products/trunk/readme.txt
r1357929 r1510641 16 16 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. Enjoy. 17 17 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 !!! 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 !!! 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. 19 30 20 31 = Shortcode = … … 37 48 = Is it use ajax for adding product to cart? = 38 49 39 Yes. It use ajax for adding product to cart. 50 Yes. 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 54 Yes. It has a widget. 40 55 41 56 = Can I use this outside cart? = … … 47 62 Yes. You can. 48 63 64 = Any user authentication system for the form ? = 65 66 Yes. Visit the plugins settings page. 67 49 68 == Screenshots == 50 69 51 70 1. Products input. 71 2. Settings page. You can change or set the necessary settings form this page. 72 3. Widget screenshot. 52 73 53 74 == Changelog == 54 75 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 55 88 = 1.0.0 = 56 89 * Initial version. -
woocom-add-multiple-products/trunk/uninstall.php
r1224703 r1510641 2 2 3 3 /** 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 5 26 */ 6 27 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. 29 if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) { 30 exit; 10 31 } 11 12 /* Place uninstall code below here. */ -
woocom-add-multiple-products/trunk/woocom-add-multiple-products.php
r1357929 r1510641 1 1 <?php 2 2 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 11 24 */ 12 25 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. 27 if ( ! defined( 'WPINC' ) ) { 28 die; 98 29 } 99 30 100 31 /** 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 */ 35 function 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 */ 44 function 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 49 register_activation_hook( __FILE__, 'activate_woocom_add_multiple_products' ); 50 register_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 */ 56 require 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 */ 67 function 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 102 76 **/ 103 77 if ( 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' ); 105 83 } 84 85 function 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.