Skip to content

Commit

Permalink
Revert "Revert "Update plugin version""
Browse files Browse the repository at this point in the history
This reverts commit de08c92.
  • Loading branch information
DevWael committed May 14, 2024
1 parent ea58916 commit 853e976
Show file tree
Hide file tree
Showing 7 changed files with 151 additions and 100 deletions.
2 changes: 1 addition & 1 deletion admin/classes/class-merchant-admin-modules.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public function __construct() {
'section' => 'boost-revenue',
'icon' => Merchant_SVG_Icons::get_svg_icon( 'module-product-bundles' ),
'title' => esc_html__( 'Product Bundles', 'merchant' ),
'desc' => esc_html__( 'Combine multiple products into bundles to sell at discounted or regular prices', 'merchant' ),
'desc' => esc_html__( 'Create bundles of products to be sold together', 'merchant' ),
'tutorial_url' => 'https://docs.athemes.com/article/merchant-product-bundles/',
),
'frequently-bought-together' => array(
Expand Down
31 changes: 16 additions & 15 deletions gulpfile.babel.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ const errorHandler = r => {
* Helper function to allow browser reload with Gulp 4.
*/
const reload = done => {
browserSync.reload();
//browserSync.reload();
done();
};

Expand Down Expand Up @@ -238,23 +238,24 @@ gulp.task(
...styleTasks,
...styleMinTasks,
...scriptTasks,
browsersync, () => {
() => {

// Global.
gulp.watch(config.watchPhp, reload);

// Styles.
for (const style of config.styles) {
gulp.watch(config.watchStyles, gulp.parallel(style.name + 'StyleTask'));
gulp.watch(config.watchStyles, gulp.parallel(style.name + 'StyleMinTask'));
}
// Global.
gulp.watch(config.watchPhp, reload);

// Scripts.
for (const script of config.scripts) {
gulp.watch(config.watchScripts, gulp.series(script.name + 'ScriptTask', reload));
}
// Styles.
for (const style of config.styles) {
gulp.watch(config.watchStyles, gulp.parallel(style.name + 'StyleTask'));
gulp.watch(config.watchStyles, gulp.parallel(style.name + 'StyleMinTask'));
}

})
// Scripts.
for (const script of config.scripts) {
gulp.watch(config.watchScripts, gulp.series(script.name + 'ScriptTask', reload));
}

}
)
);

/**
Expand Down
2 changes: 1 addition & 1 deletion inc/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ function merchant_modules_shortcode_exists() {
'merchant_module_recently_viewed_products',
'merchant_module_trust_badges',
'merchant_module_advanced_reviews',
'merchant_module_frequency_bought_together',
'merchant_module_frequently_bought_together',
'merchant_module_buy_x_get_y',
'merchant_module_product_bundles',
)
Expand Down
132 changes: 73 additions & 59 deletions inc/modules/product-bundles/admin/options.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,122 +10,135 @@
exit; // Exit if accessed directly
}

/**
* Hook functionality before including modules options.
*
* @since 1.9.8
*/
do_action( 'merchant_admin_before_include_modules_options', Merchant_Product_Bundles::MODULE_ID );

// Settings
Merchant_Admin_Options::create( array(
'module' => Merchant_Product_Bundles::MODULE_ID,
'title' => esc_html__( 'General settings', 'merchant' ),
'title' => esc_html__( 'Product page settings', 'merchant' ),
'fields' => array(

array(
'id' => 'hide_bundled_cart',
'id' => 'bundled_thumb',
'type' => 'switcher',
'title' => __( 'Hide bundled products in cart', 'merchant' ),
'default' => 0,
'title' => __( 'Display bundled product thumbnails', 'merchant' ),
'default' => '1',
),

array(
'id' => 'hide_bundled_mini_cart',
'id' => 'bundled_description',
'type' => 'switcher',
'title' => __( 'Hide bundled products in mini cart', 'merchant' ),
'title' => __( 'Display bundled product descriptions', 'merchant' ),
'default' => 0,
),

// array(
// 'id' => '_woopq_decimal',
// 'type' => 'switcher',
// 'title' => __( 'Allow decimal product quantity', 'merchant' ),
// 'default' => 0,
// ),
array(
'id' => 'bundled_qty',
'type' => 'switcher',
'title' => __( 'Display bundled product quantities', 'merchant' ),
'default' => '1',
),

array(
'id' => 'bundled_link',
'id' => 'bundled_link_single',
'type' => 'switcher',
'title' => __( 'Display link for each bundled product on cart page', 'merchant' ),
'default' => 0,
'title' => __( 'Make bundled product thumbnails and titles clickable', 'merchant' ),
'default' => '1',
),

array(
'id' => 'cart_contents_count',
'id' => 'bundled_price',
'type' => 'select',
'title' => __( 'Cart contents count will include', 'merchant' ),
'title' => __( 'Display the prices of bundled products', 'merchant' ),
'options' => array(
'bundle' => __( 'The bundle as one product', 'merchant' ),
'both' => __( 'Both bundle and bundled products', 'merchant' ),
'price' => __( 'Price per unit', 'merchant' ),
'subtotal' => __( 'Subtotal', 'merchant' ),
'no' => __( 'Hide', 'merchant' ),
),
'default' => 'bundle',
'default' => 'price',
),

array(
'id' => 'hide_bundled',
'id' => 'bundled_price_from',
'type' => 'select',
'title' => __( 'Bundled products text style in cart', 'merchant' ),
'title' => __( 'Calculate the prices of bundled products based on', 'merchant' ),
'options' => array(
'text' => __( 'Show bundled products list inline', 'merchant' ),
'list' => __( 'Show bundled products in a bulleted list', 'merchant' ),
'regular_price' => __( 'Regular price', 'merchant' ),
'sale_price' => __( 'Sale Price', 'merchant' ),
),
'default' => 'text',
'default' => 'sale_price',
),

array(
'id' => 'placement',
'type' => 'select',
'title' => __( 'Where to display the bundled products', 'merchant' ),
'options' => array(
'woocommerce_before_add_to_cart_form' => __( 'Before add to cart section', 'merchant' ),
'woocommerce_after_add_to_cart_form' => __( 'After add to cart section', 'merchant' ),
),
'default' => 'before_form',
),
),
) );

// Settings
Merchant_Admin_Options::create( array(
'module' => Merchant_Product_Bundles::MODULE_ID,
'title' => esc_html__( 'Product single page', 'merchant' ),
'title' => esc_html__( 'Cart settings', 'merchant' ),
'fields' => array(

array(
'id' => 'bundled_thumb',
'id' => 'hide_bundled_cart',
'type' => 'switcher',
'title' => __( 'Display bundled products thumbnails', 'merchant' ),
'title' => __( 'Hide bundled products in cart', 'merchant' ),
'default' => 0,
),

array(
'id' => 'bundled_description',
'id' => 'hide_bundled_mini_cart',
'type' => 'switcher',
'title' => __( 'Display descriptions of bundled products', 'merchant' ),
'title' => __( 'Hide bundled products in mini cart', 'merchant' ),
'default' => 0,
),

array(
'id' => 'bundled_qty',
'type' => 'switcher',
'title' => __( 'Display the quantity of bundled products', 'merchant' ),
'default' => 0,
),
// array(
// 'id' => '_woopq_decimal',
// 'type' => 'switcher',
// 'title' => __( 'Allow decimal product quantity', 'merchant' ),
// 'default' => 0,
// ),

array(
'id' => 'bundled_price',
'type' => 'select',
'title' => __( 'Display the prices of bundled products', 'merchant' ),
'options' => array(
'price' => __( 'Price per unit', 'merchant' ),
'subtotal' => __( 'Subtotal', 'merchant' ),
'no' => __( 'Hide', 'merchant' ),
),
'default' => 'price',
'id' => 'bundled_link',
'type' => 'switcher',
'title' => __( 'Include links to bundled products on cart page', 'merchant' ),
'default' => '1',
),

array(
'id' => 'bundled_price_from',
'id' => 'cart_contents_count',
'type' => 'select',
'title' => __( 'Calculate the prices of bundled products based on', 'merchant' ),
'title' => __( 'Cart contents count will include', 'merchant' ),
'options' => array(
'regular_price' => __( 'Regular price', 'merchant' ),
'sale_price' => __( 'Sale Price', 'merchant' ),
'bundle' => __( 'The bundle as one product', 'merchant' ),
'both' => __( 'Both bundle and bundled products', 'merchant' ),
),
'default' => 'sale_price',
'default' => 'bundle',
),

array(
'id' => 'placement',
'type' => 'select',
'title' => __( 'Where to display the bundled products', 'merchant' ),
'id' => 'hide_bundled',
'type' => 'radio',
'title' => __( 'Show bundled products', 'merchant' ),
'options' => array(
'woocommerce_before_add_to_cart_form' => __( 'Before add to cart section', 'merchant' ),
'woocommerce_after_add_to_cart_form' => __( 'After add to cart section', 'merchant' ),
'text' => __( 'List inline', 'merchant' ),
'list' => __( 'Bulleted list', 'merchant' ),
),
'default' => 'before_form',
'default' => 'text',
),
),
) );
Expand All @@ -145,7 +158,8 @@
array(
'type' => 'info',
'id' => 'shortcode_info',
'content' => esc_html__( 'If you are using a page builder or a theme that supports shortcodes, then you can output the module using the shortcode above. This might be useful if, for example, you find that you want to control the position of the module output more precisely than with the module settings. Note that the shortcodes can only be used on single product pages.', 'merchant' ),
'content' => esc_html__( 'If you are using a page builder or a theme that supports shortcodes, then you can output the module using the shortcode above. This might be useful if, for example, you find that you want to control the position of the module output more precisely than with the module settings. Note that the shortcodes can only be used on single product pages.',
'merchant' ),
),
array(
'id' => 'shortcode_text',
Expand Down
73 changes: 53 additions & 20 deletions inc/modules/product-bundles/class-product-bundles.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,39 @@ public function __construct() {
// Admin preview box.
add_filter( 'merchant_module_preview', array( $this, 'render_admin_preview' ), 10, 2 );
}

add_action( 'merchant_admin_before_include_modules_options', array( $this, 'help_banner' ) );
}

/**
* Help banner.
*
* @return void
*/
public function help_banner() {
?>
<div class="merchant-module-page-setting-fields">
<div class="merchant-module-page-setting-field merchant-module-page-setting-field-content">
<div class="merchant-module-page-setting-field-inner">
<div class="merchant-tag-pre-orders">
<i class="dashicons dashicons-info"></i>
<p>
<?php
echo esc_html__(
'To create a new product bundle (simple or variable), go to Products > Add New menu in the left sidebar of your WordPress admin area.',
'merchant'
);
printf(
'<a href="%1s" target="_blank">%2s</a>',
esc_url( admin_url( 'post-new.php?post_type=product' ) ),
esc_html__( 'Add New Bundle', 'merchant' )
);
?></p>
</div>
</div>
</div>
</div>
<?php
}

/**
Expand Down Expand Up @@ -115,23 +148,23 @@ public function render_admin_preview( $preview, $module ) {
*/
public function admin_preview_content( $settings ) {
?>
<div class="mrc-preview-single-product-elements">
<div class="mrc-preview-left-column">
<div class="mrc-preview-product-image-wrapper">
<div class="mrc-preview-product-image"></div>
<div class="mrc-preview-product-image-thumbs">
<div class="mrc-preview-product-image-thumb"></div>
<div class="mrc-preview-product-image-thumb"></div>
<div class="mrc-preview-product-image-thumb"></div>
</div>
</div>
</div>
<div class="mrc-preview-right-column">
<div class="mrc-preview-text-placeholder"></div>
<div class="mrc-preview-text-placeholder mrc-mw-70"></div>
<div class="mrc-preview-text-placeholder mrc-mw-30"></div>
<div class="mrc-preview-text-placeholder mrc-mw-40"></div>
<div class="mrc-preview-bundle-wrapper mrc-mw-60">
<div class="mrc-preview-single-product-elements">
<div class="mrc-preview-left-column">
<div class="mrc-preview-product-image-wrapper">
<div class="mrc-preview-product-image"></div>
<div class="mrc-preview-product-image-thumbs">
<div class="mrc-preview-product-image-thumb"></div>
<div class="mrc-preview-product-image-thumb"></div>
<div class="mrc-preview-product-image-thumb"></div>
</div>
</div>
</div>
<div class="mrc-preview-right-column">
<div class="mrc-preview-text-placeholder"></div>
<div class="mrc-preview-text-placeholder mrc-mw-70"></div>
<div class="mrc-preview-text-placeholder mrc-mw-30"></div>
<div class="mrc-preview-text-placeholder mrc-mw-40"></div>
<div class="mrc-preview-bundle-wrapper mrc-mw-60">
<div class="mrc-preview-bundle-product">
<div class="mrc-preview-bundle-product-image"></div>
<div class="mrc-preview-bundle-product-info">
Expand All @@ -157,9 +190,9 @@ public function admin_preview_content( $settings ) {
</div>
</div>
</div>
<div class="mrc-preview-addtocart-placeholder"></div>
</div>
</div>
<div class="mrc-preview-addtocart-placeholder"></div>
</div>
</div>
<?php
}
}
Expand Down
6 changes: 3 additions & 3 deletions merchant.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Plugin Name: Merchant
* Plugin URI: https://athemes.com
* Description: All-in-one plugin designed to help you grow your WooCommerce store. Pre-orders, Buy Now buttons, product labels, trust badges, payment logos, and more.
* Version: 1.9.8
* Version: 1.9.9
* Author: aThemes
* Author URI: https://athemes.com
* License: GPLv3 or later License
Expand All @@ -12,7 +12,7 @@
* Domain Path: /languages
*
* WC requires at least: 6.0
* WC tested up to: 8.7.0
* WC tested up to: 8.8.3
*
* @package Merchant
* @since 1.0
Expand All @@ -24,7 +24,7 @@
}

// Merchant constants.
define( 'MERCHANT_VERSION', '1.9.8' );
define( 'MERCHANT_VERSION', '1.9.9' );
define( 'MERCHANT_FILE', __FILE__ );
define( 'MERCHANT_BASE', trailingslashit( plugin_basename( MERCHANT_FILE ) ) );
define( 'MERCHANT_DIR', trailingslashit( plugin_dir_path( MERCHANT_FILE ) ) );
Expand Down
Loading

0 comments on commit 853e976

Please sign in to comment.