Plugin Directory

Changeset 3180675


Ignore:
Timestamp:
11/03/2024 12:39:45 PM (15 months ago)
Author:
jamsheedkm
Message:

Update plugin to version 1.1.0 with new feature show product price

Location:
jkm-force-sells/trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • jkm-force-sells/trunk/includes/class-jkmfs.php

    r3171794 r3180675  
    133133            'jkmfs_display_settings'
    134134        );
     135
     136        add_settings_field(
     137            'jkmfs_show_price',
     138            __('Show Product Prices', 'jkm-force-sells'),
     139            array($this, 'jkmfs_show_price_field_callback'),
     140            'jkmfs_force_sell_settings',
     141            'jkmfs_display_settings'
     142        );
    135143    }
    136144
     
    170178    }
    171179
     180    public function jkmfs_show_price_field_callback() {
     181        $options = get_option('jkmfs_settings');
     182        $show_price = isset($options['show_price']) ? $options['show_price'] : 'no';
     183        ?>
     184        <input type="checkbox" name="jkmfs_settings[show_price]" value="yes" <?php checked($show_price, 'yes'); ?> />
     185        <label for="jkmfs_settings[show_price]"><?php esc_html_e('Show product prices', 'jkm-force-sells'); ?></label>
     186        <?php
     187    }
     188
    172189    public function add_settings_link($links) {
    173190        $settings_link = '<a href="' . esc_url(admin_url('edit.php?post_type=product&page=jkmfs_force_sell_settings')) . '">' . __('Settings', 'jkm-force-sells') . '</a>';
  • jkm-force-sells/trunk/includes/utils/class-jkmfs-utils.php

    r3171794 r3180675  
    77 *
    88 * @package    jkm-force-sells
    9  * @subpackage jkm-force-sells/admin/utils
     9 * @subpackage jkm-force-sells/includes/utils
    1010 */
    1111
  • jkm-force-sells/trunk/jkm-force-sells.php

    r3171794 r3180675  
    44 * Description: Automatically add selected products to the cart with a main item, creating smart bundles effortlessly.
    55 * Author:      Jamsheed KM
    6  * Version:     1.0.0
     6 * Version:     1.1.0
    77 * Author URI:  https://github.com/kmjamsheed0
    88 * Plugin URI:  https://github.com/kmjamsheed0/jkm-force-sells
     
    4545
    4646            public function init() {
    47                 define('JKMFS_VERSION', '1.0.0');
     47                define('JKMFS_VERSION', '1.1.0');
    4848                !defined('JKMFS_BASE_NAME') && define('JKMFS_BASE_NAME', plugin_basename( __FILE__ ));
    4949                !defined('JKMFS_PATH') && define('JKMFS_PATH', plugin_dir_path( __FILE__ ));
  • jkm-force-sells/trunk/languages/jkm-force-sells.pot

    r3171794 r3180675  
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version: Force Sells and Smart Bundles for WooCommerce 1.0.0\n"
     5"Project-Id-Version: Force Sells and Smart Bundles for WooCommerce 1.1.0\n"
    66"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/jkm-force-sells\n"
    77"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
     
    1010"Content-Type: text/plain; charset=UTF-8\n"
    1111"Content-Transfer-Encoding: 8bit\n"
    12 "POT-Creation-Date: 2024-10-12T08:36:18+00:00\n"
     12"POT-Creation-Date: 2024-11-03T12:01:28+00:00\n"
    1313"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
    14 "X-Generator: WP-CLI 2.10.0\n"
     14"X-Generator: WP-CLI 2.11.0\n"
    1515"X-Domain: jkm-force-sells\n"
    1616
     
    9090
    9191#: includes/class-jkmfs.php:138
     92msgid "Show Product Prices"
     93msgstr ""
     94
     95#: includes/class-jkmfs.php:146
    9296msgid "Configure the display settings for force-sell products."
    9397msgstr ""
    9498
    95 #: includes/class-jkmfs.php:146
     99#: includes/class-jkmfs.php:154
    96100msgid "Before Add to Cart Button"
    97101msgstr ""
    98102
    99 #: includes/class-jkmfs.php:147
     103#: includes/class-jkmfs.php:155
    100104msgid "After Add to Cart Button"
    101105msgstr ""
    102106
    103 #: includes/class-jkmfs.php:157
     107#: includes/class-jkmfs.php:165
    104108msgid "List View"
    105109msgstr ""
    106110
    107 #: includes/class-jkmfs.php:158
     111#: includes/class-jkmfs.php:166
    108112msgid "Grid View"
    109113msgstr ""
    110114
    111 #: includes/class-jkmfs.php:168
     115#: includes/class-jkmfs.php:176
    112116msgid "Show product images"
    113117msgstr ""
    114118
    115 #: includes/class-jkmfs.php:173
     119#: includes/class-jkmfs.php:185
     120msgid "Show product prices"
     121msgstr ""
     122
     123#: includes/class-jkmfs.php:190
    116124msgid "Settings"
    117125msgstr ""
    118126
    119 #: public/class-jkmfs-public.php:69
     127#: public/class-jkmfs-public.php:72
    120128msgid "The following product(s) will also be added to your cart:"
    121129msgstr ""
    122130
    123131#. translators: %s: Product title
    124 #: public/class-jkmfs-public.php:163
     132#: public/class-jkmfs-public.php:190
    125133msgid "%s will also be removed as they're sold together."
    126134msgstr ""
    127135
    128 #: public/class-jkmfs-public.php:224
     136#: public/class-jkmfs-public.php:251
    129137msgid "Linked to"
    130138msgstr ""
  • jkm-force-sells/trunk/public/class-jkmfs-public.php

    r3171794 r3180675  
    5050                $product_datas[$product_id] = array(
    5151                    'title' => $prd->get_name(), // Get product name
    52                     'image' => $prd->get_image() // Get product image
     52                    'image' => $prd->get_image(), // Get product image
     53                    'price' => $prd->get_price_html()  // Get formatted price HTML
    5354                );
    5455            }
     
    6061            $view_type = isset($options['display_type']) ? $options['display_type'] : 'list';
    6162            $show_images = isset($options['show_images']) ? $options['show_images'] : 'no';
     63            $show_price = isset($options['show_price']) ? $options['show_price'] : 'no';
    6264
    6365            // Apply filters to allow customization of these settings
    6466            $view_type = apply_filters('jkmfs_products_display_type', $view_type);
    6567            $show_images = apply_filters('jkmfs_show_products_images', $show_images);
     68            $show_price = apply_filters('jkmfs_show_products_prices', $show_price);
    6669
    6770            echo '<div class="clear"></div>';
     
    7578                    foreach ($product_datas as $data) {
    7679                        echo '<div class="jkmfs-force-sell-item">';
     80
     81                        // Display product image
    7782                        if ($show_images === 'yes' && !empty($data['image'])) {
    7883
    7984                            echo '<div class="jkmfs-force-sell-image">' . wp_kses_post($data['image']) . '</div>';
    8085                        }
     86
     87                        echo '<div class="jkmfs-force-sell-title-wrapper">';
     88                        //Display title
    8189                        echo '<div class="jkmfs-force-sell-title">' . esc_html($data['title']) . '</div>'; // Title below image
     90
     91                        // Display product price
     92                        if ($show_price === 'yes' && !empty($data['price'])) {
     93                            echo '<div class="jkmfs-force-sell-price">(' . wp_kses_post($data['price']) . ')</div>';
     94                        }
     95
     96                        echo '</div>';
    8297                        echo '</div>';
    8398                    }
     
    90105                    foreach ($product_datas as $data) {
    91106                        echo '<li class="jkmfs-force-sell-item">';
     107
     108                        // Display product image
    92109                        if ($show_images === 'yes' && !empty($data['image'])) {
    93110
    94111                            echo '<div class="jkmfs-force-sell-image">' . wp_kses_post($data['image']) . '</div>';
    95112                        }
     113
     114                        echo '<div class="jkmfs-force-sell-title-wrapper">';
     115                        // Display product title
    96116                        echo '<div class="jkmfs-force-sell-title">' . esc_html($data['title']) . '</div>'; // Title next to image
     117
     118                        // Display product price
     119                        if ($show_price === 'yes' && !empty($data['price'])) {
     120                            echo '<div class="jkmfs-force-sell-price">(' . wp_kses_post($data['price']) . ')</div>';
     121                        }
     122
     123                        echo '</div>';
    97124                        echo '</li>';
    98125                    }
  • jkm-force-sells/trunk/readme.txt

    r3171846 r3180675  
    66Tested up to: 6.7
    77Requires PHP: 5.6
    8 Stable tag: 1.0.0
     8Stable tag: 1.1.0
    99License: GPLv2 or later
    1010License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    2929- Choose to display force-sell items in a list or grid view.
    3030- Option to show or hide force-sell product images.
     31- Option to show or hide force-sell product prices.
    3132
    3233**2. Additional Display Positions:**
     
    6869- `jkmfs_products_display_type`: Control the display type (e.g., list, grid) for force sell products.
    6970- `jkmfs_show_products_images`: Enable or disable the display of product images for force sell products.
     71- `jkmfs_show_products_prices`: Enable or disable the display of product prices for force sell products.
    7072- `jkmfs_force_sell_add_to_cart_product`: Customize parameters for adding a force sell product to the cart.
    7173- `jkmfs_force_sell_disallow_no_stock`: Control whether out-of-stock products are disallowed for force sell.
     
    7476== Screenshots ==
    75771. Add force sell products.
     782. List View.
     793. Grid View.
    7680
    7781== Changelog ==
     82
     83= 1.1.0 =
     84* Added: New feature to display product price of force-selling products.
     85* Added: Compatibility with WooCommerce 9.4.
     86* Added: Compatibility with WordPress 6.7.
    7887
    7988= 1.0.0 =
Note: See TracChangeset for help on using the changeset viewer.