Plugin Directory

Changeset 2878554


Ignore:
Timestamp:
03/12/2023 01:06:09 AM (2 years ago)
Author:
ok9xnirab
Message:

v1.0.5 released

Location:
wc-pre-order/trunk
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • wc-pre-order/trunk/includes/Frontend/Cart.php

    r2550859 r2878554  
    77/**
    88 * Class Cart
     9 *
    910 * @package SpringDevs\PreOrder\Frontend
    1011 */
    11 class Cart
    12 {
     12class Cart {
    1313
    14     public function __construct()
    15     {
    16         add_filter('woocommerce_cart_item_name', [$this, 'change_cart_item_name'], 10, 3);
    17     }
    1814
    19     public function change_cart_item_name($item_name, $cart_item, $cart_item_key)
    20     {
    21         $product = wc_get_product($cart_item['product_id']);
    22         $has_preorder = Helper::has_preorder($product->get_id());
    23         if ($has_preorder) {
    24             $item_name .= '<br /><small>' . __(get_option('preorder_order_item_marker_txt', 'Pre-Order product'), "sdevs_preorder") . '</small>';
    25             $product_cls = new Product();
    26             $summery_txt = $product_cls->display_txt($product, false);
    27             $item_name .= '<br /><small>' . __($summery_txt, "sdevs_preorder") . '</small>';
    28         }
    29         return $item_name;
    30     }
     15    public function __construct() {
     16        add_filter( 'woocommerce_cart_item_name', array( $this, 'change_cart_item_name' ), 10, 3 );
     17    }
     18
     19    public function change_cart_item_name( $item_name, $cart_item, $cart_item_key ) {
     20        $product      = wc_get_product( $cart_item['product_id'] );
     21        $has_preorder = Helper::has_preorder( $product->get_id() );
     22        if ( $has_preorder ) {
     23            $item_name  .= '<br /><small class="sdevs_preorder_cart_marker">' . __( get_option( 'preorder_order_item_marker_txt', 'Pre-Order product' ), 'sdevs_preorder' ) . '</small>';
     24            $product_cls = new Product();
     25            $summery_txt = $product_cls->display_txt( $product, false );
     26            $item_name  .= '<br /><small class="sdevs_preorder_cart_label">' . __( $summery_txt, 'sdevs_preorder' ) . '</small>';
     27        }
     28        return $item_name;
     29    }
    3130}
  • wc-pre-order/trunk/includes/Frontend/Order.php

    r2550859 r2878554  
    55/**
    66 * Class Order
     7 *
    78 * @package SpringDevs\PreOrder\Frontend
    89 */
    9 class Order
    10 {
     10class Order {
    1111
    12     public function __construct()
    13     {
    14         add_action('woocommerce_order_item_meta_start', [$this, 'add_meta_data'], 10, 3);
    15         add_action('woocommerce_my_account_my_orders_column_order-status', [$this, 'add_preorder_marker']);
    16     }
    1712
    18     public function add_meta_data($item_id, $item, $order)
    19     {
    20         $has_preorder = $item->get_meta('_has_preorder', true);
    21         if ($has_preorder) {
    22             echo '<br /><small>' . __(get_option('preorder_order_item_marker_txt', 'Pre-Order Product'), "sdevs_preorder") . '</small>';
    23             $rels_date = $item->get_meta('_relase_date', true);
    24             if ($rels_date) {
    25                 echo '<br /><small>' . __('Release date: ', 'sdevs_preorder') . date('F d, Y', strtotime($rels_date)) . '</small>';
    26             } else {
    27                 echo '<br /><small>' . __('Release date: N/A', 'sdevs_preorder') . '</small>';
    28             }
    29         }
    30     }
     13    public function __construct() {
     14        add_action( 'woocommerce_order_item_meta_start', array( $this, 'add_meta_data' ), 10, 3 );
     15        add_action( 'woocommerce_my_account_my_orders_column_order-status', array( $this, 'add_preorder_marker' ) );
     16    }
    3117
    32     public function add_preorder_marker($order)
    33     {
    34         $post_ids = get_post_meta($order->get_id(), '_preorders', true);
    35         if ($post_ids && is_array($post_ids) && count($post_ids) > 0) {
    36             echo wc_get_order_status_name($order->get_status());
    37             echo '<br><mark>' . esc_html(esc_html__('Has Pre-Orders', 'sdevs_preorder')) . '</mark>';
    38         } else {
    39             echo wc_get_order_status_name($order->get_status());
    40         }
    41     }
     18    public function add_meta_data( $item_id, $item, $order ) {
     19        $has_preorder = $item->get_meta( '_has_preorder', true );
     20        if ( $has_preorder ) {
     21            echo '<br /><small class="sdevs_preorder_marker_label">' . __( get_option( 'preorder_order_item_marker_txt', 'Pre-Order Product' ), 'sdevs_preorder' ) . '</small>';
     22            $rels_date = $item->get_meta( '_relase_date', true );
     23            if ( $rels_date ) {
     24                echo '<br /><small class="sdevs_preorder_order_label">' . __( 'Release date: ', 'sdevs_preorder' ) . date( 'F d, Y', strtotime( $rels_date ) ) . '</small>';
     25            } else {
     26                echo '<br /><small>' . __( 'Release date: N/A', 'sdevs_preorder' ) . '</small>';
     27            }
     28        }
     29    }
     30
     31    public function add_preorder_marker( $order ) {
     32        $post_ids = get_post_meta( $order->get_id(), '_preorders', true );
     33        if ( $post_ids && is_array( $post_ids ) && count( $post_ids ) > 0 ) {
     34            echo wc_get_order_status_name( $order->get_status() );
     35            echo '<br><mark>' . esc_html( esc_html__( 'Has Pre-Orders', 'sdevs_preorder' ) ) . '</mark>';
     36        } else {
     37            echo wc_get_order_status_name( $order->get_status() );
     38        }
     39    }
    4240}
  • wc-pre-order/trunk/includes/Frontend/Product.php

    r2878118 r2878554  
    109109        if ( $echo ) :
    110110            ?>
    111             <p>
     111            <p class="sdevs_preorder_single_notice">
    112112                <strong <?php echo $attr; ?>><?php _e( $summery_text, 'sdevs_preorder' ); ?></strong>
    113113            </p>
  • wc-pre-order/trunk/pre-order.php

    r2878118 r2878554  
    44Plugin URI: https://wordpress.org/plugins/sdevs-wc-preorder
    55Description: Allow customers to pre-order from your store.
    6 Version: 1.0.4
     6Version: 1.0.5
    77Author: SpringDevs
    88Author URI: https://springdevs.com/
     
    5858     * @var string
    5959     */
    60     const version = '1.0.4';
     60    const version = '1.0.5';
    6161
    6262    /**
  • wc-pre-order/trunk/readme.txt

    r2878122 r2878554  
    55Requires at least: 4.0
    66Tested up to: 6.1
    7 Stable tag: 1.0.4
     7Stable tag: 1.0.5
    88Requires PHP: 7.0
    99License: GPLv2 or later
     
    5050== Changelog ==
    5151
     52= 1.0.5 - March 12, 2023 =
     53* Add classes to label, marker.
     54
    5255= 1.0.4 - March 11, 2023 =
    5356* Label placement setting added
  • wc-pre-order/trunk/vendor/autoload.php

    r2878118 r2878554  
    2323require_once __DIR__ . '/composer/autoload_real.php';
    2424
    25 return ComposerAutoloaderInit8b057caf3cd808091e292aea40097efa::getLoader();
     25return ComposerAutoloaderInit78c8d9959a9c1ed0e2bdc2e719554cb4::getLoader();
  • wc-pre-order/trunk/vendor/composer/InstalledVersions.php

    r2878118 r2878554  
    2222 *
    2323 * To require its presence, you can require `composer-runtime-api ^2.0`
     24 *
     25 * @final
    2426 */
    2527class InstalledVersions
     
    2729    /**
    2830     * @var mixed[]|null
    29      * @psalm-var array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}|array{}|null
     31     * @psalm-var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}|array{}|null
    3032     */
    3133    private static $installed;
     
    3840    /**
    3941     * @var array[]
    40      * @psalm-var array<string, array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}>
     42     * @psalm-var array<string, array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}>
    4143     */
    4244    private static $installedByVendor = array();
     
    242244    /**
    243245     * @return array
    244      * @psalm-return array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}
     246     * @psalm-return array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}
    245247     */
    246248    public static function getRootPackage()
     
    256258     * @deprecated Use getAllRawData() instead which returns all datasets for all autoloaders present in the process. getRawData only returns the first dataset loaded, which may not be what you expect.
    257259     * @return array[]
    258      * @psalm-return array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}
     260     * @psalm-return array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}
    259261     */
    260262    public static function getRawData()
     
    279281     *
    280282     * @return array[]
    281      * @psalm-return list<array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}>
     283     * @psalm-return list<array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}>
    282284     */
    283285    public static function getAllRawData()
     
    302304     * @return void
    303305     *
    304      * @psalm-param array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>} $data
     306     * @psalm-param array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $data
    305307     */
    306308    public static function reload($data)
     
    312314    /**
    313315     * @return array[]
    314      * @psalm-return list<array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}>
     316     * @psalm-return list<array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}>
    315317     */
    316318    private static function getInstalled()
  • wc-pre-order/trunk/vendor/composer/autoload_real.php

    r2878118 r2878554  
    33// autoload_real.php @generated by Composer
    44
    5 class ComposerAutoloaderInit8b057caf3cd808091e292aea40097efa
     5class ComposerAutoloaderInit78c8d9959a9c1ed0e2bdc2e719554cb4
    66{
    77    private static $loader;
     
    2323        }
    2424
    25         spl_autoload_register(array('ComposerAutoloaderInit8b057caf3cd808091e292aea40097efa', 'loadClassLoader'), true, true);
     25        spl_autoload_register(array('ComposerAutoloaderInit78c8d9959a9c1ed0e2bdc2e719554cb4', 'loadClassLoader'), true, true);
    2626        self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
    27         spl_autoload_unregister(array('ComposerAutoloaderInit8b057caf3cd808091e292aea40097efa', 'loadClassLoader'));
     27        spl_autoload_unregister(array('ComposerAutoloaderInit78c8d9959a9c1ed0e2bdc2e719554cb4', 'loadClassLoader'));
    2828
    2929        require __DIR__ . '/autoload_static.php';
    30         call_user_func(\Composer\Autoload\ComposerStaticInit8b057caf3cd808091e292aea40097efa::getInitializer($loader));
     30        call_user_func(\Composer\Autoload\ComposerStaticInit78c8d9959a9c1ed0e2bdc2e719554cb4::getInitializer($loader));
    3131
    3232        $loader->register(true);
    3333
    34         $filesToLoad = \Composer\Autoload\ComposerStaticInit8b057caf3cd808091e292aea40097efa::$files;
     34        $filesToLoad = \Composer\Autoload\ComposerStaticInit78c8d9959a9c1ed0e2bdc2e719554cb4::$files;
    3535        $requireFile = \Closure::bind(static function ($fileIdentifier, $file) {
    3636            if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
  • wc-pre-order/trunk/vendor/composer/autoload_static.php

    r2550859 r2878554  
    55namespace Composer\Autoload;
    66
    7 class ComposerStaticInit8b057caf3cd808091e292aea40097efa
     7class ComposerStaticInit78c8d9959a9c1ed0e2bdc2e719554cb4
    88{
    99    public static $files = array (
     
    3232    {
    3333        return \Closure::bind(function () use ($loader) {
    34             $loader->prefixLengthsPsr4 = ComposerStaticInit8b057caf3cd808091e292aea40097efa::$prefixLengthsPsr4;
    35             $loader->prefixDirsPsr4 = ComposerStaticInit8b057caf3cd808091e292aea40097efa::$prefixDirsPsr4;
    36             $loader->classMap = ComposerStaticInit8b057caf3cd808091e292aea40097efa::$classMap;
     34            $loader->prefixLengthsPsr4 = ComposerStaticInit78c8d9959a9c1ed0e2bdc2e719554cb4::$prefixLengthsPsr4;
     35            $loader->prefixDirsPsr4 = ComposerStaticInit78c8d9959a9c1ed0e2bdc2e719554cb4::$prefixDirsPsr4;
     36            $loader->classMap = ComposerStaticInit78c8d9959a9c1ed0e2bdc2e719554cb4::$classMap;
    3737
    3838        }, null, ClassLoader::class);
  • wc-pre-order/trunk/vendor/composer/installed.php

    r2878118 r2878554  
    11<?php return array(
    22    'root' => array(
    3         'pretty_version' => 'dev-stable',
    4         'version' => 'dev-stable',
     3        'name' => 'springdevs/pre-order',
     4        'pretty_version' => 'dev-next',
     5        'version' => 'dev-next',
     6        'reference' => 'f51fe8338cfbfc47434eafbf10fa8e2b373d7c41',
    57        'type' => 'wordpress-plugin',
    68        'install_path' => __DIR__ . '/../../',
    79        'aliases' => array(),
    8         'reference' => '434d19b20b4937e43fda3cc30df84c238d4cc525',
    9         'name' => 'springdevs/pre-order',
    1010        'dev' => true,
    1111    ),
    1212    'versions' => array(
    1313        'springdevs/pre-order' => array(
    14             'pretty_version' => 'dev-stable',
    15             'version' => 'dev-stable',
     14            'pretty_version' => 'dev-next',
     15            'version' => 'dev-next',
     16            'reference' => 'f51fe8338cfbfc47434eafbf10fa8e2b373d7c41',
    1617            'type' => 'wordpress-plugin',
    1718            'install_path' => __DIR__ . '/../../',
    1819            'aliases' => array(),
    19             'reference' => '434d19b20b4937e43fda3cc30df84c238d4cc525',
    2020            'dev_requirement' => false,
    2121        ),
Note: See TracChangeset for help on using the changeset viewer.