Skip to content

Commit

Permalink
Merge pull request #33 from codersaiful/5.9.1
Browse files Browse the repository at this point in the history
5.9.1
  • Loading branch information
codersaiful authored Jan 3, 2024
2 parents 8b4aa76 + 0321547 commit 4264287
Show file tree
Hide file tree
Showing 15 changed files with 350 additions and 81 deletions.
80 changes: 80 additions & 0 deletions admin/adm-inc/plugin-installer.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
<?php
namespace WC_MMQ\Admin\Adm_Inc;

class Plugin_Installer
{
public $plugin_zip_url;


/**
* Initializing static property for Class
* We will use this Trait acutally
*
* @var null|object
*/
public static $init;

/**
* Initializing method init()
* If we want to make any Class as Standalone
* then we have to use this trait
*
* @since 1.0.0.11
*
* @author Saiful Islam <[email protected]>
* @return null|object
*/
public static function init()
{
if( self::$init && self::$init instanceof self ) return self::$init;

self::$init = new self();

return self::$init;
}

public function run()
{
add_action('admin_init', [$this,'handle_install']);
}
public function set_plugin_zip_url( $url = '' )
{
$this->plugin_zip_url = $url;
}
public function handle_install()
{
if (isset($_POST['install_plugin']) && check_admin_referer('pssg_install_plugin_nonce', 'pssg_install_plugin_nonce')) {
// URL to the zip file of the custom plugin
$this->plugin_zip_url = 'https://example.com/path/to/your-plugin.zip';

// Install and activate the plugin
$result = $this->install_zip( $this->plugin_zip_url );
echo '<pre>';
var_dump($result);
echo '</pre>';
exit();
exit;
die();
die;
if (is_wp_error($result)) {
// Handle error, if any
echo 'Error installing the plugin: ' . esc_html($result->get_error_message());
} else {
// Redirect to your admin page menu
// wp_redirect(admin_url('admin.php?page=wcmmq-product-quick-edit'));
exit;
}
}
}
public function install_zip( $plugin_zip_url )
{
require_once ABSPATH . 'wp-admin/includes/file.php';
require_once ABSPATH . 'wp-admin/includes/plugin-install.php';
require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';

$upgrader = new \Plugin_Upgrader(new \Automatic_Upgrader_Skin());
$install_result = $upgrader->install( $plugin_zip_url );

return $install_result;
}
}
1 change: 1 addition & 0 deletions admin/admin-loader.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ public function __construct(){
// $settings->run();

// add_action('admin_init', [$this, 'admin_init']);

}

public function admin_init(){
Expand Down
36 changes: 36 additions & 0 deletions admin/page-loader.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

use WC_MMQ\Core\Base;
use WC_MMQ\Modules\Module_Controller;
use WC_MMQ\Includes\Min_Max_Controller;;

class Page_Loader extends Base
{
Expand Down Expand Up @@ -58,6 +59,40 @@ public function module_page_html()
include $this->module_controller->dir . '/module-page.php';
}

/**
* Connectivity with Product Stock Sync with Google Sheet for WooCommerce
*
*
* @since 5.9.0
* @return void
*
* @author Saiful Islam <[email protected]>
*/
public function product_quick_edit()
{
add_filter( 'pssg_products_columns', [$this,'handle_columns'] );
$this->topbar_sub_title = __( 'Min Max Quick Edit','wcmmq' );
include $this->topbar_file;
include $this->page_folder_dir . '/product-quick-edit.php';
}

public function handle_columns( $columns )
{
if( ! class_exists('PSSG_Init') ) $columns;

$new_columns = [];
$new_columns['title'] = $columns['title'];


$controller = new Min_Max_Controller();
$new_columns[$controller->min_quantity] = $columns[$controller->min_quantity];
$new_columns[$controller->max_quantity] = $columns[$controller->max_quantity];
$new_columns[$controller->product_step] = $columns[$controller->product_step];

$new_columns['stock'] = $columns['stock'];
return $new_columns;
}

public function browse_plugins_html()
{
add_filter( 'plugins_api_result', [$this, 'plugins_api_result'], 1, 3 );
Expand Down Expand Up @@ -110,6 +145,7 @@ public function admin_menu()
//Module page adding
add_submenu_page( $this->main_slug, $this->module_controller->menu_title . $proString, $this->module_controller->menu_title, $capability, 'wcmmq_modules', [$this, 'module_page_html'] );

add_submenu_page( $this->main_slug, esc_html__( 'Min Max Bulk Edit', 'wcmmq' ) . $proString, __( 'Min Max Bulk Edit', 'wcmmq' ), $capability, 'wcmmq-product-quick-edit', [$this, 'product_quick_edit'] );
add_submenu_page( $this->main_slug, esc_html__( 'Browse Plugins', 'wcmmq' ) . $proString, __( 'Browse Plugins', 'wcmmq' ), $capability, 'wcmmq-browse-plugins', [$this, 'browse_plugins_html'] );
add_submenu_page( $this->main_slug, esc_html__( 'Addons', 'wcmmq' ) . $proString, __( 'Addons', 'wcmmq' ), $capability, 'wcmmq-addons-list', [$this, 'addons_list_html'] );

Expand Down
4 changes: 2 additions & 2 deletions admin/page/main-page/premium-link-header.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
$coupon_Code = 'BLACKFRIDAY2023';
$coupon_Code = 'CHRISTMAS2023';

?>
<div class="wrap wcmmq_wrap wcmmq-content">
Expand All @@ -15,7 +15,7 @@
</a>
</div>
<div class="col-lg-4">
<h2>BLACK FRIDAY</h2>
<h2>Incredible</h2>
<p>Checkout our Offer.</p>
</div>
<div class="col-lg-6">
Expand Down
64 changes: 64 additions & 0 deletions admin/page/product-quick-edit.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
<?php
use Product_Stock_Sync\App\Handle\Quick_Table;

?>
<div class="wrap wcmmq_wrap wcmmq-content">

<h1 class="wp-heading "></h1>
<div class="fieldwrap">

<?php
if( class_exists( 'Product_Stock_Sync\App\Handle\Quick_Table' ) ){
?>
<p class="wcmmq-quick-table-header-topbar">
To update All content. <a class="wcmmq-other-link" href="<?php echo esc_url( admin_url( 'admin.php?page=pssg-quick-edit' ) ); ?>" target="_blank">Click Here</a>

<span>For min, max and step - Only able to edit/update for single product.</span>
</p>
<?php
$Quick_Table = Quick_Table::init();
$Quick_Table->display_table_full();
}else{



/**
* ekhane amra debo jate
* install na thakle free version install dite pare
*/
$image_url = $this->assets_url . 'images/features/Qucck-Edit-Table.jpg';
?>
<div class="wcmmq-section-panel no-background wcmmq-clearfix">
<div class="wcmmq-section-panel no-background quick-edit-section-wrapper">
<div class="wcmmq-section-panel wcmmq-quick-edit-section" id="wcmmq-quick-edit-section" data-icon="wcmmq_icon-home">

<div class="wcmmq-qes-wrapper">
<div class="free-plugin-install-info-wrapper">
<div style="float: left;">
<h3>Need a plugin [Product Stock Sync with Google Sheet for WooCommerce]</h3>
<p><b>Free Download</b>, Install and Activate to get following table. <a href="https://codeastrology.com/downloads/product-stock-sync-with-google-sheet-for-woocommerce/">https://codeastrology.com/downloads/product-stock-sync...</a></p>
<p class="premium-version-wrapper">
Get Premium Version. Just Click on - <a href="https://codeastrology.com/downloads/product-sync-master-sheet-premium/" target="_blank" class="wcmmq-btn wcmmq-btn small wcmmq-btn-small btn-small">Purchase Now</a>
</p>
</div>
<iframe style="text-align: right;float:right;" width="560" height="315"
src="https://www.youtube-nocookie.com/embed/fJWAnMvpBQk?si=REPvxfE4UnElPLxD&amp;start=6"
title="YouTube video player" frameborder="0"
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
allowfullscreen></iframe>
</div>
<img src="<?php echo esc_attr( $image_url ); ?>" alt="Quick Edit Table Image" style="opacity: 0.6;">

</div>

</div>
</div>
</div>
<?php
}

?>


</div>
</div>
64 changes: 52 additions & 12 deletions assets/css/admin.css
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,6 @@ ul.wcmmq_each_terms_header small {
height: 75px;
width: 75px;
border: 3px solid #ffffff;
box-shadow: 4px 4px 14px 9px #00000014;
width: auto !important;
}
.anywhere-notice.ca-notice .ca-notice-dismiss{display: none !important;}
Expand Down Expand Up @@ -535,7 +534,7 @@ form#wcmmq-main-configuration-form #stick_on_scroll-on {
border-radius: unset;
z-index: 99999;
display: none;
top: 145px;
top: 450px;
left: unset;
margin: 0;
opacity: 1;
Expand Down Expand Up @@ -727,9 +726,12 @@ p.wcmmq-input-decimal-msg-free,
.wcmmq-free-pro-notice-message p.wcmmq-input-decimal-msg-pro, .wcmmq-free-pro-notice-message p.wcmmq-input-decimal-msg-free {
color: #fffbfb;
background: #F44336;
padding: 3px 11px;
padding: 4px 10px;
border-radius: 20px;
margin: 0;
}


.wcmmq-free-pro-notice-message p.wcmmq-input-decimal-msg-pro{
color: black;
background: #ffeb3b57;
Expand Down Expand Up @@ -771,7 +773,41 @@ tr.user_can_not_edit>td:last-child:after {
tr.user_can_not_edit>td {
position: relative;
}
.wcmmq-quick-table-header-topbar{
margin-bottom: -30px;
margin-top: 30px;
color: #000000;
font-size: 15px;
}
.free-plugin-install-info-wrapper {
padding: 20px;
}

.free-plugin-install-info-wrapper h3 {
color: #3F51B5;
font-size: 23px;
font-weight: normal;
}

.free-plugin-install-info-wrapper p {
font-size: 16px;
}

.free-plugin-install-info-wrapper p b {
color: green;
}
.wcmmq-quick-table-header-topbar:hover{
color: #ff09c1;
}
.wcmmq-quick-table-header-topbar a{
font-weight: bold;
text-decoration: none;
}
.wcmmq-quick-table-header-topbar:hover span,
.wcmmq-quick-table-header-topbar span,
.wcmmq-quick-table-header-topbar span:hover{
color: gray;
}

/********Configure Tab Area Start*********/
.wcmmq-configure-tab-wrapper.wcmmq-section-panel a {
Expand Down Expand Up @@ -808,24 +844,28 @@ tr.user_can_not_edit>td {


/* black Friday offer */
.notice.ca-notice.notice-offer[data-notice_id="wcmmq_BLACKFRIDAY2023_offer"] {background: black;color: #607D8B;}
.notice.ca-notice.notice-offer[data-notice_id="wcmmq_BLACKFRIDAY2023_offer"] a.ca-logo-link img,
.notice.ca-notice.notice-offer[data-notice_id="wcmmq_BLACKFRIDAY2023_offer"] a.ca-logo-link img,
.notice.ca-notice.notice-offer[data-notice_id="wcmmq_BLACKFRIDAY2023_offer"] img,
.notice.ca-notice.notice-offer[data-notice_id="wcmmq_BLACKFRIDAY2023_offer"] a {
.notice.ca-notice.notice-offer[data-notice_id="wcmmq_CHRISTMAS2023_offer"] {
background: #ffffff8f;
color: #6e6e6e;
box-shadow: 1px -1px 30px #0000000a;
}
.notice.ca-notice.notice-offer[data-notice_id="wcmmq_CHRISTMAS2023_offer"] a.ca-logo-link img,
.notice.ca-notice.notice-offer[data-notice_id="wcmmq_CHRISTMAS2023_offer"] a.ca-logo-link img,
.notice.ca-notice.notice-offer[data-notice_id="wcmmq_CHRISTMAS2023_offer"] img,
.notice.ca-notice.notice-offer[data-notice_id="wcmmq_CHRISTMAS2023_offer"] a {
border: 0 none !important;
}
.notice.ca-notice.notice-offer[data-notice_id="wcmmq_BLACKFRIDAY2023_offer"] .ca-msg-text h1 {
.notice.ca-notice.notice-offer[data-notice_id="wcmmq_CHRISTMAS2023_offer"] .ca-msg-text h1 {
color: #ff0000;
font-size: 19px;
}
.notice.ca-notice.notice-offer[data-notice_id="wcmmq_BLACKFRIDAY2023_offer"] .ca-msg-text p>b:last-child {
.notice.ca-notice.notice-offer[data-notice_id="wcmmq_CHRISTMAS2023_offer"] .ca-msg-text p>b:last-child {
color: red;
}
.notice.ca-notice.notice-offer[data-notice_id="wcmmq_BLACKFRIDAY2023_offer"] .ca-msg-text p>b>i {
.notice.ca-notice.notice-offer[data-notice_id="wcmmq_CHRISTMAS2023_offer"] .ca-msg-text p>b>i {
color: #4CAF50;
}
.notice.ca-notice.notice-offer[data-notice_id="wcmmq_BLACKFRIDAY2023_offer"] .ca-msg-text p {
.notice.ca-notice.notice-offer[data-notice_id="wcmmq_CHRISTMAS2023_offer"] .ca-msg-text p {
padding-bottom: 5px;
}

Expand Down
Binary file added assets/images/features/Qucck-Edit-Table.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 1 addition & 2 deletions assets/js/admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
});

$(document.body).on('click','.wcmmq-premium',function(){
// alert(45454);

var img_link = $(this).find('img').attr('src');
var link = 'https://codeastrology.com/min-max-quantity/pricing/';
window.open(img_link,'_blank');
Expand Down Expand Up @@ -153,7 +153,6 @@
tabArea.html(tabHtml);
}

console.log(tabArray);
$(document.body).on('click','.wcmmq-configure-tab-wrapper a.tab-button',function(e){
e.preventDefault();
$('.wcmmq-configure-tab-wrapper a').removeClass('active');
Expand Down
Loading

0 comments on commit 4264287

Please sign in to comment.