Skip to content

Commit

Permalink
Merge pull request #39 from codersaiful/6.4.0
Browse files Browse the repository at this point in the history
6.4.0
  • Loading branch information
codersaiful authored May 20, 2024
2 parents 4264287 + 1a59119 commit 0125579
Show file tree
Hide file tree
Showing 16 changed files with 780 additions and 70 deletions.
17 changes: 17 additions & 0 deletions admin/add_options_admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,23 @@
* @link https://docs.woocommerce.com/wc-apidocs/source-function-woocommerce_wp_text_input.html#14-79 Details of woocommerce_wp_text_input() from WooCommerce
*/
function wcmmq_add_field_in_panel(){
$current_lang = apply_filters( 'wpml_current_language', NULL );
$lang = apply_filters('wpml_default_language', NULL );
if(!empty($current_lang) && !empty($lang) && $current_lang != $lang){
$message = __( 'You have to input Min max and step value in your default language product.', 'wcmmq' );
if( function_exists( 'woocommerce_wp_note' ) ){
woocommerce_wp_note([
'id' => 'wcmmq_note_for_wpml',
'class' => 'wcmmq_note_for_wpml',
'message' => $message,
'type' => 'warning',
'label' => __( 'Important:', 'wcmmq' ),

]);
}
return;
}

$is_pro = defined('WC_MMQ_PRO_VERSION');
$data_type = 'decimal';
$tip_color = 'wcmmq-tips-note';
Expand Down
54 changes: 48 additions & 6 deletions admin/page-loader.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public function handle_columns( $columns )
$new_columns['title'] = $columns['title'];


$controller = new Min_Max_Controller();
$controller = Min_Max_Controller::init();
$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];
Expand Down Expand Up @@ -146,8 +146,11 @@ public function admin_menu()
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'] );
add_submenu_page( $this->main_slug, esc_html__( 'Temp Pro Demo', 'wcmmq' ), esc_html__( 'Temp Pro Demo', 'wcmmq' ), 'read', 'https://codeastro.live/?site=wcmmq&utm=PluginDashboard' );


add_submenu_page( $this->main_slug, esc_html__( 'Browse Plugins', 'wcmmq' ) . $proString, __( 'Browse Plugins', 'wcmmq' ), 'read', 'wcmmq-browse-plugins', [$this, 'browse_plugins_html'] );
add_submenu_page( $this->main_slug, esc_html__( 'Addons', 'wcmmq' ) . $proString, __( 'Addons', 'wcmmq' ), 'read', 'wcmmq-addons-list', [$this, 'addons_list_html'] );

add_submenu_page($this->main_slug, 'Documentation' . $proString, 'Documentation', 'read','https://codeastrology.com/min-max-quantity/documentation/');
if($this->is_pro){
Expand All @@ -163,6 +166,45 @@ public function admin_menu()
}
}

/**
* This is specially for WPML page
*
* Redirects the user to the default language version of the current URL if the 'lang' parameter is not set or is different from the default language.
*
* @return void
*/
public function redirect_wpml() {
$default_lang = apply_filters('wpml_default_language', NULL);
if ( empty( $default_lang ) ) return;
// Get the current URL
$current_url = $_SERVER['REQUEST_URI'];

// Parse the URL to get its components
$parsed_url = parse_url($current_url);

// Parse the query string into an associative array
$query_params = [];
if (isset($parsed_url['query'])) {
parse_str($parsed_url['query'], $query_params);
}

// Check if the 'lang' parameter is set
if (!isset($query_params['lang']) || ( isset($query_params['lang'] ) && $query_params['lang'] != $default_lang ) ) {
// If not set, add the 'lang' parameter with 'en' as its value
$query_params['lang'] = $default_lang;

// Build the new query string
$new_query_string = http_build_query($query_params);

// Construct the new URL
$new_url = $parsed_url['path'] . '?' . $new_query_string;

// Redirect to the new URL
wp_redirect($new_url);
exit;
}
return;
}
public function admin_enqueue_scripts()
{
global $current_screen;
Expand Down Expand Up @@ -395,9 +437,9 @@ public function renew_license_notice()
$message = esc_html__( ' Renew it to get latest update.', 'wpt_pro' ) . '</strong>';
ob_start();
?>
<div class="error wpt-renew-license-notice">
<div class="wpt-license-notice-inside">
<img src="<?php echo esc_url( $wpt_logo ); ?>" class="wpt-license-brand-logo">
<div class="error wcmmq-renew-license-notice">
<div class="wcmmq-license-notice-inside">
<img src="<?php echo esc_url( $wpt_logo ); ?>" class="wcmmq-license-brand-logo">
Your License of <strong>Min Max Control pro</strong> has been expired at <span style="color: #d00;font-weight:bold;"><?php echo esc_html( $expired_date ); ?></span>
%1$s <a href="%2$s" target="_blank">%3$s</a>
</div>
Expand Down
3 changes: 2 additions & 1 deletion admin/page/main-page/supported-terms.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,8 @@
return empty(strpos($parenttt, 'attributes'));
});
$supported_terms = isset( $saved_data['supported_terms'] ) ?$saved_data['supported_terms'] : array( 'product_cat' );
$ourTermList = $select_option = false;
$select_option = false;
$ourTermList = [];
if( is_array( $term_lists ) && count( $term_lists ) > 0 ){
foreach( $term_lists as $trm_key => $trm_object ){
// var_dump($trm_object->labels->back_to_items);
Expand Down
7 changes: 4 additions & 3 deletions admin/page/product-quick-edit.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
use Product_Stock_Sync\App\Handle\Quick_Table;
use PSSG_Sync_Sheet\App\Handle\Quick_Table;

?>
<div class="wrap wcmmq_wrap wcmmq-content">
Expand All @@ -8,7 +8,7 @@
<div class="fieldwrap">

<?php
if( class_exists( 'Product_Stock_Sync\App\Handle\Quick_Table' ) ){
if( class_exists( 'PSSG_Sync_Sheet\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>
Expand Down Expand Up @@ -38,7 +38,8 @@
<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>
<a href="https://codeastrology.com/downloads/product-stock-sync-with-google-sheet-for-woocommerce/" target="_blank" class="wcmmq-btn wcmmq-btn small wcmmq-btn-small btn-small">Free Download</a><br>
Just Install and Activate. No need to integrate with Google Sheet for Min max Edit.
</p>
</div>
<iframe style="text-align: right;float:right;" width="560" height="315"
Expand Down
2 changes: 1 addition & 1 deletion admin/page/topbar.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
$min_max_img = WC_MMQ_BASE_URL . 'assets/images/brand/social/min-max.png';

$this->redirect_wpml();
/**
* This following part actually
* for our both version
Expand Down
2 changes: 1 addition & 1 deletion admin/product_panel.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ function wcmmq_product_edit_tab( $product_data_tab){
$my_tab['wcmmq_min_max_step'] = array(
'label' => __('Min Max & Step','wcmmq'),
'target' => 'wcmmq_min_max_step', //This is targetted div's id
'class' => array( 'hide_if_downloadable','hide_if_grouped' ), //'hide_if_grouped',
'class' => array( 'hide_if_grouped' ), //'hide_if_grouped',//'hide_if_downloadable',
);

$position = 1; // Change this for desire position
Expand Down
79 changes: 79 additions & 0 deletions assets/bakup/cart-page-block-code.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
<!-- wp:woocommerce/cart -->
<div class="wp-block-woocommerce-cart alignwide is-loading"><!-- wp:woocommerce/filled-cart-block -->
<div class="wp-block-woocommerce-filled-cart-block"><!-- wp:woocommerce/cart-items-block -->
<div class="wp-block-woocommerce-cart-items-block"><!-- wp:woocommerce/cart-line-items-block -->
<div class="wp-block-woocommerce-cart-line-items-block"></div>
<!-- /wp:woocommerce/cart-line-items-block -->

<!-- wp:woocommerce/cart-cross-sells-block -->
<div class="wp-block-woocommerce-cart-cross-sells-block"><!-- wp:heading {"fontSize":"large"} -->
<h2 class="wp-block-heading has-large-font-size">You may be interested in…</h2>
<!-- /wp:heading -->

<!-- wp:woocommerce/cart-cross-sells-products-block -->
<div class="wp-block-woocommerce-cart-cross-sells-products-block"></div>
<!-- /wp:woocommerce/cart-cross-sells-products-block --></div>
<!-- /wp:woocommerce/cart-cross-sells-block --></div>
<!-- /wp:woocommerce/cart-items-block -->

<!-- wp:woocommerce/cart-totals-block -->
<div class="wp-block-woocommerce-cart-totals-block"><!-- wp:woocommerce/cart-order-summary-block -->
<div class="wp-block-woocommerce-cart-order-summary-block"><!-- wp:woocommerce/cart-order-summary-heading-block -->
<div class="wp-block-woocommerce-cart-order-summary-heading-block"></div>
<!-- /wp:woocommerce/cart-order-summary-heading-block -->

<!-- wp:woocommerce/cart-order-summary-coupon-form-block -->
<div class="wp-block-woocommerce-cart-order-summary-coupon-form-block"></div>
<!-- /wp:woocommerce/cart-order-summary-coupon-form-block -->

<!-- wp:woocommerce/cart-order-summary-subtotal-block -->
<div class="wp-block-woocommerce-cart-order-summary-subtotal-block"></div>
<!-- /wp:woocommerce/cart-order-summary-subtotal-block -->

<!-- wp:woocommerce/cart-order-summary-fee-block -->
<div class="wp-block-woocommerce-cart-order-summary-fee-block"></div>
<!-- /wp:woocommerce/cart-order-summary-fee-block -->

<!-- wp:woocommerce/cart-order-summary-discount-block -->
<div class="wp-block-woocommerce-cart-order-summary-discount-block"></div>
<!-- /wp:woocommerce/cart-order-summary-discount-block -->

<!-- wp:woocommerce/cart-order-summary-shipping-block -->
<div class="wp-block-woocommerce-cart-order-summary-shipping-block"></div>
<!-- /wp:woocommerce/cart-order-summary-shipping-block -->

<!-- wp:woocommerce/cart-order-summary-taxes-block -->
<div class="wp-block-woocommerce-cart-order-summary-taxes-block"></div>
<!-- /wp:woocommerce/cart-order-summary-taxes-block --></div>
<!-- /wp:woocommerce/cart-order-summary-block -->

<!-- wp:woocommerce/cart-express-payment-block -->
<div class="wp-block-woocommerce-cart-express-payment-block"></div>
<!-- /wp:woocommerce/cart-express-payment-block -->

<!-- wp:woocommerce/proceed-to-checkout-block -->
<div class="wp-block-woocommerce-proceed-to-checkout-block"></div>
<!-- /wp:woocommerce/proceed-to-checkout-block -->

<!-- wp:woocommerce/cart-accepted-payment-methods-block -->
<div class="wp-block-woocommerce-cart-accepted-payment-methods-block"></div>
<!-- /wp:woocommerce/cart-accepted-payment-methods-block --></div>
<!-- /wp:woocommerce/cart-totals-block --></div>
<!-- /wp:woocommerce/filled-cart-block -->

<!-- wp:woocommerce/empty-cart-block -->
<div class="wp-block-woocommerce-empty-cart-block"><!-- wp:heading {"textAlign":"center","className":"with-empty-cart-icon wc-block-cart__empty-cart__title"} -->
<h2 class="wp-block-heading has-text-align-center with-empty-cart-icon wc-block-cart__empty-cart__title">Your cart is currently empty!</h2>
<!-- /wp:heading -->

<!-- wp:separator {"className":"is-style-dots"} -->
<hr class="wp-block-separator has-alpha-channel-opacity is-style-dots" />
<!-- /wp:separator -->

<!-- wp:heading {"textAlign":"center"} -->
<h2 class="wp-block-heading has-text-align-center">New in store</h2>
<!-- /wp:heading -->

<!-- wp:woocommerce/product-new {"columns":4,"rows":1} /--></div>
<!-- /wp:woocommerce/empty-cart-block --></div>
<!-- /wp:woocommerce/cart -->
79 changes: 79 additions & 0 deletions assets/bakup/checkout-page-block-code.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
<!-- wp:woocommerce/checkout -->
<div class="wp-block-woocommerce-checkout alignwide wc-block-checkout is-loading"><!-- wp:woocommerce/checkout-fields-block -->
<div class="wp-block-woocommerce-checkout-fields-block"><!-- wp:woocommerce/checkout-express-payment-block -->
<div class="wp-block-woocommerce-checkout-express-payment-block"></div>
<!-- /wp:woocommerce/checkout-express-payment-block -->

<!-- wp:woocommerce/checkout-contact-information-block -->
<div class="wp-block-woocommerce-checkout-contact-information-block"></div>
<!-- /wp:woocommerce/checkout-contact-information-block -->

<!-- wp:woocommerce/checkout-shipping-method-block -->
<div class="wp-block-woocommerce-checkout-shipping-method-block"></div>
<!-- /wp:woocommerce/checkout-shipping-method-block -->

<!-- wp:woocommerce/checkout-pickup-options-block -->
<div class="wp-block-woocommerce-checkout-pickup-options-block"></div>
<!-- /wp:woocommerce/checkout-pickup-options-block -->

<!-- wp:woocommerce/checkout-shipping-address-block -->
<div class="wp-block-woocommerce-checkout-shipping-address-block"></div>
<!-- /wp:woocommerce/checkout-shipping-address-block -->

<!-- wp:woocommerce/checkout-billing-address-block -->
<div class="wp-block-woocommerce-checkout-billing-address-block"></div>
<!-- /wp:woocommerce/checkout-billing-address-block -->

<!-- wp:woocommerce/checkout-shipping-methods-block -->
<div class="wp-block-woocommerce-checkout-shipping-methods-block"></div>
<!-- /wp:woocommerce/checkout-shipping-methods-block -->

<!-- wp:woocommerce/checkout-payment-block -->
<div class="wp-block-woocommerce-checkout-payment-block"></div>
<!-- /wp:woocommerce/checkout-payment-block -->

<!-- wp:woocommerce/checkout-order-note-block -->
<div class="wp-block-woocommerce-checkout-order-note-block"></div>
<!-- /wp:woocommerce/checkout-order-note-block -->

<!-- wp:woocommerce/checkout-terms-block -->
<div class="wp-block-woocommerce-checkout-terms-block"></div>
<!-- /wp:woocommerce/checkout-terms-block -->

<!-- wp:woocommerce/checkout-actions-block -->
<div class="wp-block-woocommerce-checkout-actions-block"></div>
<!-- /wp:woocommerce/checkout-actions-block --></div>
<!-- /wp:woocommerce/checkout-fields-block -->

<!-- wp:woocommerce/checkout-totals-block -->
<div class="wp-block-woocommerce-checkout-totals-block"><!-- wp:woocommerce/checkout-order-summary-block -->
<div class="wp-block-woocommerce-checkout-order-summary-block"><!-- wp:woocommerce/checkout-order-summary-cart-items-block -->
<div class="wp-block-woocommerce-checkout-order-summary-cart-items-block"></div>
<!-- /wp:woocommerce/checkout-order-summary-cart-items-block -->

<!-- wp:woocommerce/checkout-order-summary-coupon-form-block -->
<div class="wp-block-woocommerce-checkout-order-summary-coupon-form-block"></div>
<!-- /wp:woocommerce/checkout-order-summary-coupon-form-block -->

<!-- wp:woocommerce/checkout-order-summary-subtotal-block -->
<div class="wp-block-woocommerce-checkout-order-summary-subtotal-block"></div>
<!-- /wp:woocommerce/checkout-order-summary-subtotal-block -->

<!-- wp:woocommerce/checkout-order-summary-fee-block -->
<div class="wp-block-woocommerce-checkout-order-summary-fee-block"></div>
<!-- /wp:woocommerce/checkout-order-summary-fee-block -->

<!-- wp:woocommerce/checkout-order-summary-discount-block -->
<div class="wp-block-woocommerce-checkout-order-summary-discount-block"></div>
<!-- /wp:woocommerce/checkout-order-summary-discount-block -->

<!-- wp:woocommerce/checkout-order-summary-shipping-block -->
<div class="wp-block-woocommerce-checkout-order-summary-shipping-block"></div>
<!-- /wp:woocommerce/checkout-order-summary-shipping-block -->

<!-- wp:woocommerce/checkout-order-summary-taxes-block -->
<div class="wp-block-woocommerce-checkout-order-summary-taxes-block"></div>
<!-- /wp:woocommerce/checkout-order-summary-taxes-block --></div>
<!-- /wp:woocommerce/checkout-order-summary-block --></div>
<!-- /wp:woocommerce/checkout-totals-block --></div>
<!-- /wp:woocommerce/checkout -->
63 changes: 63 additions & 0 deletions assets/css/admin.css
Original file line number Diff line number Diff line change
Expand Up @@ -809,6 +809,62 @@ tr.user_can_not_edit>td {
color: gray;
}

.wcmmq-renew-license-notice>div {
background: white;
padding: 10px 15px;
display: block !important;
clear: both;
border-left: 5px solid #d00;
margin: 13px 0 0 0;
box-sizing: border-box;
height: max-content;
line-height: 30px;
}

.wcmmq-renew-license-notice {
display: block;
clear: both;
height: max-content;
background: transparent;
}
.error.wcmmq-renew-license-notice {
border: 0 none !important;
padding: 0;
}

.wcmmq-renew-license-notice a {
background: #E91E63;
border-color: #E91E63;
text-transform: uppercase !important;
padding: 6px 10px !important;
border-left: 27px solid #7a052d;
position: relative;
color: white;
text-decoration: none;
white-space: nowrap;
}
.wcmmq-renew-license-notice a:hover {

background: #4caf50;
border-color: #38823b;
text-transform: uppercase !important;
padding: 6px 10px !important;
border-left: 27px solid #38823b;
position: relative;
}
.wcmmq-renew-license-notice a::before {
content: "☀";
position: absolute;
top: -2px;
left: -20px;
color: rgb(255, 255, 255);
}
img.wcmmq-license-brand-logo {
width: 25px;
height: auto;
display: inline-block;
margin-bottom: -8px;
}
/********Configure Tab Area Start*********/
.wcmmq-configure-tab-wrapper.wcmmq-section-panel a {
color: black;
Expand Down Expand Up @@ -840,6 +896,13 @@ tr.user_can_not_edit>td {
box-sizing: border-box;
box-shadow: 0px 9px 13px 0 #0000004a;
}
/* wpml note color/style */
output#wcmmq_note_for_wpml {
color: #bf0000;
font-size: 15px;
background: #ddd;
padding: 2px 10px;
}
/********Configure Tab Area End*********/


Expand Down
Loading

0 comments on commit 0125579

Please sign in to comment.