Changeset 3837530
- Timestamp:
- 12/01/2026 12:00:39 PM (less than one hour ago)
- Location:
- bytecraftdz-cash-on-delivery
- Files:
-
- 14 edited
- 1 copied
-
tags/1.1.1 (copied) (copied from bytecraftdz-cash-on-delivery/trunk )
-
tags/1.1.1/assets/js/dzcod-form.js (modified) (2 diffs)
-
tags/1.1.1/bytecraftdz-cash-on-delivery.php (modified) (2 diffs)
-
tags/1.1.1/includes/class-dzcod-cart.php (modified) (5 diffs)
-
tags/1.1.1/includes/class-dzcod-leads.php (modified) (4 diffs)
-
tags/1.1.1/includes/class-dzcod-order.php (modified) (3 diffs)
-
tags/1.1.1/includes/class-dzcod-settings.php (modified) (1 diff)
-
tags/1.1.1/readme.txt (modified) (2 diffs)
-
trunk/assets/js/dzcod-form.js (modified) (2 diffs)
-
trunk/bytecraftdz-cash-on-delivery.php (modified) (2 diffs)
-
trunk/includes/class-dzcod-cart.php (modified) (5 diffs)
-
trunk/includes/class-dzcod-leads.php (modified) (4 diffs)
-
trunk/includes/class-dzcod-order.php (modified) (3 diffs)
-
trunk/includes/class-dzcod-settings.php (modified) (1 diff)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
bytecraftdz-cash-on-delivery/tags/1.1.1/assets/js/dzcod-form.js
r3837356 r3837530 520 520 var leadTimer = null, leadSent = '', orderDone = false; 521 521 function saveLead() { 522 if (!S.leads || orderDone) return; 522 // Never while the order is being sent: it would re-create the lead the order just removed. 523 if (!S.leads || orderDone || form.classList.contains('is-loading')) return; 523 524 var phoneEl = $('[name="phone"]', form); 524 525 var phone = phoneEl ? normalizePhone(phoneEl.value) : ''; … … 559 560 form.classList.add('is-loading'); 560 561 submitBtn.disabled = true; 562 clearTimeout(leadTimer); 561 563 562 564 fetch(D.ajaxUrl, { method: 'POST', body: fd, credentials: 'same-origin' }) -
bytecraftdz-cash-on-delivery/tags/1.1.1/bytecraftdz-cash-on-delivery.php
r3837356 r3837530 3 3 * Plugin Name: ByteCraftDZ Cash on Delivery for WooCommerce 4 4 * Description: Highly customizable one-page Cash On Delivery order form for Algerian WooCommerce stores: 69 wilayas (or the previous 58), communes, per-wilaya home/stop-desk shipping, product variations, custom fields and full style control. 5 * Version: 1.1. 05 * Version: 1.1.1 6 6 * Author: ByteCraftDZ 7 7 * Author URI: https://www.facebook.com/bytecraftdz … … 18 18 defined( 'ABSPATH' ) || exit; 19 19 20 define( 'DZCOD_VERSION', '1.1. 0' );20 define( 'DZCOD_VERSION', '1.1.1' ); 21 21 define( 'DZCOD_FILE', __FILE__ ); 22 22 define( 'DZCOD_PATH', plugin_dir_path( __FILE__ ) ); -
bytecraftdz-cash-on-delivery/tags/1.1.1/includes/class-dzcod-cart.php
r3837285 r3837530 18 18 add_filter( 'the_content', array( __CLASS__, 'cart_page_content' ), 20 ); 19 19 add_action( 'template_redirect', array( __CLASS__, 'redirect_checkout' ) ); 20 add_action( 'woocommerce_before_calculate_totals', array( __CLASS__, 'apply_offers' ), 20 ); 21 } 22 23 /** Quantity offers also count in the WooCommerce cart totals (mini cart, blocks). */ 24 public static function apply_offers( $cart ) { 25 if ( ! self::enabled() || ! $cart instanceof WC_Cart ) { 26 return; 27 } 28 foreach ( $cart->get_cart() as $line ) { 29 $price = DZCOD_Settings::offer_price( $line['data'], $line['quantity'] ); 30 if ( $price ) { 31 $line['data']->set_price( $price['total'] / (int) $line['quantity'] ); 32 } 33 } 34 } 35 36 /** Value of the pieces just added (for the pixels), offers included. */ 37 private static function added_value( $product, $qty ) { 38 $offer = DZCOD_Settings::offer_price( $product, $qty ); 39 return $offer ? $offer['total'] : (float) wc_get_price_to_display( $product ) * $qty; 40 } 41 42 /** Displayed total of a cart line, offers included. */ 43 public static function line_total( $line ) { 44 $price = DZCOD_Settings::offer_price( $line['data'], $line['quantity'] ); 45 if ( $price ) { 46 return $price['total']; 47 } 48 return (float) wc_get_price_to_display( $line['data'] ) * (int) $line['quantity']; 20 49 } 21 50 … … 92 121 'cartUrl' => wc_get_cart_url(), 93 122 'message' => $t['txt_added'], 94 'value' => (float) wc_get_price_to_display( $variation_id ? wc_get_product( $variation_id ) : $product ) * $qty,123 'value' => self::added_value( $variation_id ? wc_get_product( $variation_id ) : $product, $qty ), 95 124 'currency' => get_woocommerce_currency(), 96 125 ) … … 140 169 $total = 0.0; 141 170 foreach ( WC()->cart->get_cart() as $line ) { 142 $total += (float) wc_get_price_to_display( $line['data'] ) * (int) $line['quantity'];171 $total += self::line_total( $line ); 143 172 } 144 173 return $total; … … 191 220 $meta = wc_get_formatted_cart_item_data( $line, true ); 192 221 $max = $product->managing_stock() && ! $product->backorders_allowed() ? (int) $product->get_stock_quantity() : 0; 193 $price = (float) wc_get_price_to_display( $product ); 222 $offer = DZCOD_Settings::offer_price( $product, $line['quantity'] ); 223 $fresh = $offer ? wc_get_product( $product->get_id() ) : null; 224 $price = (float) wc_get_price_to_display( $fresh ? $fresh : $product ); 225 $full = $price * (int) $line['quantity']; 226 $total = $offer ? $offer['total'] : $full; 194 227 ?> 195 228 <div class="dzcod-cart-item" data-key="<?php echo esc_attr( $key ); ?>"> … … 214 247 <button type="button" class="dzcod-qty-btn" data-step="-1" aria-label="-">−</button> 215 248 </div> 216 <div class="dzcod-cart-line"><?php echo wp_kses_post( wc_price( $price * (int) $line['quantity'] ) ); ?></div> 249 <div class="dzcod-cart-line"> 250 <?php if ( $offer ) : ?> 251 <del><?php echo wp_kses_post( wc_price( $full ) ); ?></del> 252 <?php endif; ?> 253 <?php echo wp_kses_post( wc_price( $total ) ); ?> 254 </div> 217 255 <button type="button" class="dzcod-cart-remove" aria-label="<?php echo esc_attr( $t['txt_remove'] ); ?>" title="<?php echo esc_attr( $t['txt_remove'] ); ?>">×</button> 218 256 </div> -
bytecraftdz-cash-on-delivery/tags/1.1.1/includes/class-dzcod-leads.php
r3837356 r3837530 81 81 } 82 82 set_transient( $rl_key, $count + 1, HOUR_IN_SECONDS ); 83 84 // A save that arrives just after the order went through is not an abandoned order. 85 $recent = wc_get_orders( 86 array( 87 'billing_phone' => $phone, 88 'date_created' => '>' . ( time() - 10 * MINUTE_IN_SECONDS ), 89 'limit' => 1, 90 'return' => 'ids', 91 'type' => 'shop_order', 92 ) 93 ); 94 if ( $recent ) { 95 wp_send_json_success(); 96 } 83 97 84 98 $product_id = absint( DZCOD_Settings::posted( 'product_id' ) ); … … 95 109 'cart' => 'cart' === DZCOD_Settings::posted( 'mode' ) ? 1 : 0, 96 110 ); 111 if ( $data['cart'] ) { 112 $data['cart_items'] = self::cart_summary(); 113 } 97 114 98 115 $existing = self::find( $phone, $data['product_id'] ); … … 115 132 } 116 133 wp_send_json_success(); 134 } 135 136 /** "Name × qty, Name × qty" for the current cart. */ 137 private static function cart_summary() { 138 if ( ! function_exists( 'WC' ) || ! WC()->cart ) { 139 return ''; 140 } 141 $parts = array(); 142 foreach ( WC()->cart->get_cart() as $line ) { 143 if ( empty( $line['data'] ) || ! $line['data'] instanceof WC_Product ) { 144 continue; 145 } 146 $qty = (int) $line['quantity']; 147 $parts[] = wp_strip_all_tags( $line['data']->get_name() ) . ( $qty > 1 ? ' × ' . $qty : '' ); 148 } 149 return implode( ', ', $parts ); 117 150 } 118 151 … … 262 295 if ( get_post_meta( $id, '_cart', true ) ) { 263 296 esc_html_e( 'Cart', 'bytecraftdz-cash-on-delivery' ); 297 $items = (string) get_post_meta( $id, '_cart_items', true ); 298 if ( '' !== $items ) { 299 echo ': ' . esc_html( $items ); 300 } 264 301 } elseif ( $product ) { 265 302 echo '<a href="' . esc_url( get_permalink( $product->get_parent_id() ? $product->get_parent_id() : $product->get_id() ) ) . '" target="_blank">' . esc_html( $product->get_name() ) . '</a>' . ( $qty > 1 ? ' × ' . esc_html( (string) $qty ) : '' ); -
bytecraftdz-cash-on-delivery/tags/1.1.1/includes/class-dzcod-order.php
r3837356 r3837530 113 113 self::fail( $t['txt_out_of_stock'] . ': ' . $product->get_name() ); 114 114 } 115 $offer = DZCOD_Settings::offer_price( $product, $qty ); 115 116 $items[] = array( 116 117 'product' => $product, 117 118 'qty' => $qty, 118 119 'args' => ! empty( $line['variation'] ) ? array( 'variation' => $line['variation'] ) : array(), 120 'total' => $offer ? $offer['total'] : null, 119 121 ); 120 122 } … … 281 283 } 282 284 285 $offer_notes = array(); 283 286 foreach ( $items as $line ) { 284 287 $args = $line['args']; … … 289 292 $order->add_product( $line['product'], $line['qty'], $args ); 290 293 if ( isset( $args['total'] ) ) { 291 $order->update_meta_data( '_dzcod_offer', $line['qty'] . ' / ' . wc_format_decimal( $line['total'] ) ); 292 } 294 $offer_notes[] = ( count( $items ) > 1 ? $line['product']->get_name() . ': ' : '' ) . $line['qty'] . ' / ' . wc_format_decimal( $line['total'] ); 295 } 296 } 297 if ( $offer_notes ) { 298 $order->update_meta_data( '_dzcod_offer', implode( ', ', $offer_notes ) ); 293 299 } 294 300 -
bytecraftdz-cash-on-delivery/tags/1.1.1/includes/class-dzcod-settings.php
r3837356 r3837530 738 738 } 739 739 740 /** 741 * Price of a cart line with the quantity offers: the biggest offer that fits the 742 * quantity, plus the remaining pieces at the normal price. 743 * 744 * @param WC_Product $product Product or variation. 745 * @param int $qty Quantity. 746 * @return array{total: float, offer: array}|null Null when no offer lowers the price. 747 */ 748 public static function offer_price( $product, $qty ) { 749 $qty = (int) $qty; 750 if ( ! $product instanceof WC_Product || $qty < 1 ) { 751 return null; 752 } 753 $best = null; 754 foreach ( self::product_offers( $product ) as $offer ) { 755 if ( $offer['qty'] <= $qty && ( null === $best || $offer['qty'] > $best['qty'] ) ) { 756 $best = $offer; 757 } 758 } 759 if ( null === $best ) { 760 return null; 761 } 762 // Fresh copy: the cart may already have changed the price of this object. 763 $fresh = wc_get_product( $product->get_id() ); 764 $unit = (float) wc_get_price_to_display( $fresh ? $fresh : $product ); 765 $total = (float) $best['price'] + ( $qty - $best['qty'] ) * $unit; 766 if ( $total >= $unit * $qty ) { 767 return null; 768 } 769 return array( 770 'total' => $total, 771 'offer' => $best, 772 ); 773 } 774 740 775 /** Custom field options (one per line) as an array. */ 741 776 public static function field_options( $field ) { -
bytecraftdz-cash-on-delivery/tags/1.1.1/readme.txt
r3837356 r3837530 6 6 Requires PHP: 7.4 7 7 Requires Plugins: woocommerce 8 Stable tag: 1.1. 08 Stable tag: 1.1.1 9 9 License: GPLv2 or later 10 10 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 161 161 == Changelog == 162 162 163 = 1.1.1 = 164 165 * Quantity offers now apply in the cart: a line gets the biggest offer that fits its quantity, and the rest is charged at the normal price. 166 * Fixed abandoned orders that came back right after the customer placed the order. 167 * Abandoned cart orders now list the products in the cart. 168 163 169 = 1.1.0 = 164 170 -
bytecraftdz-cash-on-delivery/trunk/assets/js/dzcod-form.js
r3837356 r3837530 520 520 var leadTimer = null, leadSent = '', orderDone = false; 521 521 function saveLead() { 522 if (!S.leads || orderDone) return; 522 // Never while the order is being sent: it would re-create the lead the order just removed. 523 if (!S.leads || orderDone || form.classList.contains('is-loading')) return; 523 524 var phoneEl = $('[name="phone"]', form); 524 525 var phone = phoneEl ? normalizePhone(phoneEl.value) : ''; … … 559 560 form.classList.add('is-loading'); 560 561 submitBtn.disabled = true; 562 clearTimeout(leadTimer); 561 563 562 564 fetch(D.ajaxUrl, { method: 'POST', body: fd, credentials: 'same-origin' }) -
bytecraftdz-cash-on-delivery/trunk/bytecraftdz-cash-on-delivery.php
r3837356 r3837530 3 3 * Plugin Name: ByteCraftDZ Cash on Delivery for WooCommerce 4 4 * Description: Highly customizable one-page Cash On Delivery order form for Algerian WooCommerce stores: 69 wilayas (or the previous 58), communes, per-wilaya home/stop-desk shipping, product variations, custom fields and full style control. 5 * Version: 1.1. 05 * Version: 1.1.1 6 6 * Author: ByteCraftDZ 7 7 * Author URI: https://www.facebook.com/bytecraftdz … … 18 18 defined( 'ABSPATH' ) || exit; 19 19 20 define( 'DZCOD_VERSION', '1.1. 0' );20 define( 'DZCOD_VERSION', '1.1.1' ); 21 21 define( 'DZCOD_FILE', __FILE__ ); 22 22 define( 'DZCOD_PATH', plugin_dir_path( __FILE__ ) ); -
bytecraftdz-cash-on-delivery/trunk/includes/class-dzcod-cart.php
r3837285 r3837530 18 18 add_filter( 'the_content', array( __CLASS__, 'cart_page_content' ), 20 ); 19 19 add_action( 'template_redirect', array( __CLASS__, 'redirect_checkout' ) ); 20 add_action( 'woocommerce_before_calculate_totals', array( __CLASS__, 'apply_offers' ), 20 ); 21 } 22 23 /** Quantity offers also count in the WooCommerce cart totals (mini cart, blocks). */ 24 public static function apply_offers( $cart ) { 25 if ( ! self::enabled() || ! $cart instanceof WC_Cart ) { 26 return; 27 } 28 foreach ( $cart->get_cart() as $line ) { 29 $price = DZCOD_Settings::offer_price( $line['data'], $line['quantity'] ); 30 if ( $price ) { 31 $line['data']->set_price( $price['total'] / (int) $line['quantity'] ); 32 } 33 } 34 } 35 36 /** Value of the pieces just added (for the pixels), offers included. */ 37 private static function added_value( $product, $qty ) { 38 $offer = DZCOD_Settings::offer_price( $product, $qty ); 39 return $offer ? $offer['total'] : (float) wc_get_price_to_display( $product ) * $qty; 40 } 41 42 /** Displayed total of a cart line, offers included. */ 43 public static function line_total( $line ) { 44 $price = DZCOD_Settings::offer_price( $line['data'], $line['quantity'] ); 45 if ( $price ) { 46 return $price['total']; 47 } 48 return (float) wc_get_price_to_display( $line['data'] ) * (int) $line['quantity']; 20 49 } 21 50 … … 92 121 'cartUrl' => wc_get_cart_url(), 93 122 'message' => $t['txt_added'], 94 'value' => (float) wc_get_price_to_display( $variation_id ? wc_get_product( $variation_id ) : $product ) * $qty,123 'value' => self::added_value( $variation_id ? wc_get_product( $variation_id ) : $product, $qty ), 95 124 'currency' => get_woocommerce_currency(), 96 125 ) … … 140 169 $total = 0.0; 141 170 foreach ( WC()->cart->get_cart() as $line ) { 142 $total += (float) wc_get_price_to_display( $line['data'] ) * (int) $line['quantity'];171 $total += self::line_total( $line ); 143 172 } 144 173 return $total; … … 191 220 $meta = wc_get_formatted_cart_item_data( $line, true ); 192 221 $max = $product->managing_stock() && ! $product->backorders_allowed() ? (int) $product->get_stock_quantity() : 0; 193 $price = (float) wc_get_price_to_display( $product ); 222 $offer = DZCOD_Settings::offer_price( $product, $line['quantity'] ); 223 $fresh = $offer ? wc_get_product( $product->get_id() ) : null; 224 $price = (float) wc_get_price_to_display( $fresh ? $fresh : $product ); 225 $full = $price * (int) $line['quantity']; 226 $total = $offer ? $offer['total'] : $full; 194 227 ?> 195 228 <div class="dzcod-cart-item" data-key="<?php echo esc_attr( $key ); ?>"> … … 214 247 <button type="button" class="dzcod-qty-btn" data-step="-1" aria-label="-">−</button> 215 248 </div> 216 <div class="dzcod-cart-line"><?php echo wp_kses_post( wc_price( $price * (int) $line['quantity'] ) ); ?></div> 249 <div class="dzcod-cart-line"> 250 <?php if ( $offer ) : ?> 251 <del><?php echo wp_kses_post( wc_price( $full ) ); ?></del> 252 <?php endif; ?> 253 <?php echo wp_kses_post( wc_price( $total ) ); ?> 254 </div> 217 255 <button type="button" class="dzcod-cart-remove" aria-label="<?php echo esc_attr( $t['txt_remove'] ); ?>" title="<?php echo esc_attr( $t['txt_remove'] ); ?>">×</button> 218 256 </div> -
bytecraftdz-cash-on-delivery/trunk/includes/class-dzcod-leads.php
r3837356 r3837530 81 81 } 82 82 set_transient( $rl_key, $count + 1, HOUR_IN_SECONDS ); 83 84 // A save that arrives just after the order went through is not an abandoned order. 85 $recent = wc_get_orders( 86 array( 87 'billing_phone' => $phone, 88 'date_created' => '>' . ( time() - 10 * MINUTE_IN_SECONDS ), 89 'limit' => 1, 90 'return' => 'ids', 91 'type' => 'shop_order', 92 ) 93 ); 94 if ( $recent ) { 95 wp_send_json_success(); 96 } 83 97 84 98 $product_id = absint( DZCOD_Settings::posted( 'product_id' ) ); … … 95 109 'cart' => 'cart' === DZCOD_Settings::posted( 'mode' ) ? 1 : 0, 96 110 ); 111 if ( $data['cart'] ) { 112 $data['cart_items'] = self::cart_summary(); 113 } 97 114 98 115 $existing = self::find( $phone, $data['product_id'] ); … … 115 132 } 116 133 wp_send_json_success(); 134 } 135 136 /** "Name × qty, Name × qty" for the current cart. */ 137 private static function cart_summary() { 138 if ( ! function_exists( 'WC' ) || ! WC()->cart ) { 139 return ''; 140 } 141 $parts = array(); 142 foreach ( WC()->cart->get_cart() as $line ) { 143 if ( empty( $line['data'] ) || ! $line['data'] instanceof WC_Product ) { 144 continue; 145 } 146 $qty = (int) $line['quantity']; 147 $parts[] = wp_strip_all_tags( $line['data']->get_name() ) . ( $qty > 1 ? ' × ' . $qty : '' ); 148 } 149 return implode( ', ', $parts ); 117 150 } 118 151 … … 262 295 if ( get_post_meta( $id, '_cart', true ) ) { 263 296 esc_html_e( 'Cart', 'bytecraftdz-cash-on-delivery' ); 297 $items = (string) get_post_meta( $id, '_cart_items', true ); 298 if ( '' !== $items ) { 299 echo ': ' . esc_html( $items ); 300 } 264 301 } elseif ( $product ) { 265 302 echo '<a href="' . esc_url( get_permalink( $product->get_parent_id() ? $product->get_parent_id() : $product->get_id() ) ) . '" target="_blank">' . esc_html( $product->get_name() ) . '</a>' . ( $qty > 1 ? ' × ' . esc_html( (string) $qty ) : '' ); -
bytecraftdz-cash-on-delivery/trunk/includes/class-dzcod-order.php
r3837356 r3837530 113 113 self::fail( $t['txt_out_of_stock'] . ': ' . $product->get_name() ); 114 114 } 115 $offer = DZCOD_Settings::offer_price( $product, $qty ); 115 116 $items[] = array( 116 117 'product' => $product, 117 118 'qty' => $qty, 118 119 'args' => ! empty( $line['variation'] ) ? array( 'variation' => $line['variation'] ) : array(), 120 'total' => $offer ? $offer['total'] : null, 119 121 ); 120 122 } … … 281 283 } 282 284 285 $offer_notes = array(); 283 286 foreach ( $items as $line ) { 284 287 $args = $line['args']; … … 289 292 $order->add_product( $line['product'], $line['qty'], $args ); 290 293 if ( isset( $args['total'] ) ) { 291 $order->update_meta_data( '_dzcod_offer', $line['qty'] . ' / ' . wc_format_decimal( $line['total'] ) ); 292 } 294 $offer_notes[] = ( count( $items ) > 1 ? $line['product']->get_name() . ': ' : '' ) . $line['qty'] . ' / ' . wc_format_decimal( $line['total'] ); 295 } 296 } 297 if ( $offer_notes ) { 298 $order->update_meta_data( '_dzcod_offer', implode( ', ', $offer_notes ) ); 293 299 } 294 300 -
bytecraftdz-cash-on-delivery/trunk/includes/class-dzcod-settings.php
r3837356 r3837530 738 738 } 739 739 740 /** 741 * Price of a cart line with the quantity offers: the biggest offer that fits the 742 * quantity, plus the remaining pieces at the normal price. 743 * 744 * @param WC_Product $product Product or variation. 745 * @param int $qty Quantity. 746 * @return array{total: float, offer: array}|null Null when no offer lowers the price. 747 */ 748 public static function offer_price( $product, $qty ) { 749 $qty = (int) $qty; 750 if ( ! $product instanceof WC_Product || $qty < 1 ) { 751 return null; 752 } 753 $best = null; 754 foreach ( self::product_offers( $product ) as $offer ) { 755 if ( $offer['qty'] <= $qty && ( null === $best || $offer['qty'] > $best['qty'] ) ) { 756 $best = $offer; 757 } 758 } 759 if ( null === $best ) { 760 return null; 761 } 762 // Fresh copy: the cart may already have changed the price of this object. 763 $fresh = wc_get_product( $product->get_id() ); 764 $unit = (float) wc_get_price_to_display( $fresh ? $fresh : $product ); 765 $total = (float) $best['price'] + ( $qty - $best['qty'] ) * $unit; 766 if ( $total >= $unit * $qty ) { 767 return null; 768 } 769 return array( 770 'total' => $total, 771 'offer' => $best, 772 ); 773 } 774 740 775 /** Custom field options (one per line) as an array. */ 741 776 public static function field_options( $field ) { -
bytecraftdz-cash-on-delivery/trunk/readme.txt
r3837356 r3837530 6 6 Requires PHP: 7.4 7 7 Requires Plugins: woocommerce 8 Stable tag: 1.1. 08 Stable tag: 1.1.1 9 9 License: GPLv2 or later 10 10 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 161 161 == Changelog == 162 162 163 = 1.1.1 = 164 165 * Quantity offers now apply in the cart: a line gets the biggest offer that fits its quantity, and the rest is charged at the normal price. 166 * Fixed abandoned orders that came back right after the customer placed the order. 167 * Abandoned cart orders now list the products in the cart. 168 163 169 = 1.1.0 = 164 170
Note:
See TracChangeset
for help on using the changeset viewer.