Skip to content

Commit

Permalink
1.1 version updated
Browse files Browse the repository at this point in the history
  • Loading branch information
hmbashar committed Jul 26, 2022
1 parent 6dbcce8 commit d14b4ad
Show file tree
Hide file tree
Showing 9 changed files with 166 additions and 56 deletions.
2 changes: 1 addition & 1 deletion cbwct.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Plugin URI: https://wordpress.org/plugins/alishop-wc-order-tracker
Description: Your customer can track his/her order on your WooCommerce website easily, woocommerce order tracking system with ajax
Author: Md Abul Bashar
Version: 1.0
Version: 1.1
Author URI: https://facebook.com/hmbashar
Text Domain: cbwct
Expand Down
3 changes: 2 additions & 1 deletion css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -175,9 +175,10 @@ width: 125px;
.cbwct-wc-traking-img img{width: 30px;margin-bottom: 12px;}

.cbwct_shipping{position: absolute;
left: 0;}
left: 0;top:0}
.cbwct_shipping.active{
animation: cbwct_left_to_right 5s linear infinite;

}
.cbwct_wc_traking_step {
text-align: center;
Expand Down
80 changes: 80 additions & 0 deletions inc/custom.php
Original file line number Diff line number Diff line change
Expand Up @@ -166,3 +166,83 @@ function cbwct_tracker_load_tamplate( $template ) {

add_filter( 'template_include', 'cbwct_tracker_load_tamplate' );




// Register a custom order status
add_action('init', 'cbwct_register_custom_order_statuses');
function cbwct_register_custom_order_statuses() {
register_post_status('wc-shipped ', array(
'label' => __( 'Shipped', 'woocommerce' ),
'public' => true,
'exclude_from_search' => false,
'show_in_admin_all_list' => true,
'show_in_admin_status_list' => true,
'label_count' => _n_noop('Shipped <span class="count">(%s)</span>', 'Shipped <span class="count">(%s)</span>')
));
}


// Add a custom order status to list of WC Order statuses
add_filter('wc_order_statuses', 'cbwct_add_custom_order_statuses');
function cbwct_add_custom_order_statuses($order_statuses) {
$new_order_statuses = array();

// add new order status before processing
foreach ($order_statuses as $key => $status) {
$new_order_statuses[$key] = $status;
if ('wc-processing' === $key) {
$new_order_statuses['wc-shipped'] = __('Shipped', 'woocommerce' );
}
}
return $new_order_statuses;
}


// Adding custom status 'awaiting-delivery' to admin order list bulk dropdown
add_filter( 'bulk_actions-edit-shop_order', 'cbwct_custom_dropdown_bulk_actions_shop_order', 50, 1 );
function cbwct_custom_dropdown_bulk_actions_shop_order( $actions ) {
$new_actions = array();

// add new order status before processing
foreach ($actions as $key => $action) {
if ('mark_processing' === $key)
$new_actions['mark_shipped'] = __( 'Change status to shipped', 'woocommerce' );

$new_actions[$key] = $action;
}
return $new_actions;
}

// Add a custom order status action button (for orders with "processing" status)
add_filter( 'woocommerce_admin_order_actions', 'cbwct_add_custom_order_status_actions_button', 100, 2 );
function cbwct_add_custom_order_status_actions_button( $actions, $order ) {
// Display the button for all orders that have a 'processing', 'pending' or 'on-hold' status
if ( $order->has_status( array( 'on-hold', 'processing', 'pending' ) ) ) {

// The key slug defined for your action button
$action_slug = 'shipped';

// Set the action button
$actions[$action_slug] = array(
'url' => wp_nonce_url( admin_url( 'admin-ajax.php?action=woocommerce_mark_order_status&status='.$action_slug.'&order_id='.$order->get_id() ), 'woocommerce-mark-order-status' ),
'name' => __( 'Shipped', 'woocommerce' ),
'action' => $action_slug,
);
}
return $actions;
}

// Set styling for custom order status action button icon and List icon
add_action( 'admin_head', 'cbwct_add_custom_order_status_actions_button_css' );
function cbwct_add_custom_order_status_actions_button_css() {
$action_slug = "shipped"; // The key slug defined for your action button
?>
<style>
.wc-action-button-<?php echo $action_slug; ?>::after {
font-family: woocommerce !important; content: "\e029" !important;
}
</style>
<?php
}

5 changes: 4 additions & 1 deletion inc/shortcode.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@ function cbwct_wc_shortcode($attrs, $content = NULL) {

), $attrs));

require_once( CBWCT_TRACKER_PATH . '/inc/template.php');
// get template markup
require_once( CBWCT_TRACKER_PATH . '/inc/template-markup.php');



return ob_get_clean();
}
Expand Down
50 changes: 50 additions & 0 deletions inc/template-markup.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<?php
// Don't call the file directly
if ( !defined( 'ABSPATH' ) ) exit;

if(!class_exists('CBWCT_ORDER_TRACKER')) {
return;
}


?>


<div class="cbwct-tracking-container">
<div class="cbwct-tracking">
<div class="cbwct-tracking-title">
<h2><?php apply_filters( 'cbwct_order_tracking_heading', __('Order Tracker', 'cbwet') );?></h2>
</div>

<!--Tracking Form -->
<div class="cbwct-tracking-from">
<form method="POST">
<div class="cbwct-tracking-form-area">
<div class="cbwct-tracking-form-field">
<label for="order_number"><?php apply_filters('cbwct_field_text_order_number', __('Order Number', 'cbwet'));?></label>
<input type="text" id="order_number" name="order_number" placeholder="Order Number...">
</div>
<div class="cbwct-tracking-form-field">
<label for="phone"><?php apply_filters('cbwct_field_text_phone_number', __('Phone Number', 'cbwet'));?></label>
<input type="text" id="phone" name="phone_number" placeholder="Phone Number...">
</div>
<div class="cbwct-tracking-form-field cbwct-traking-form-submit">
<?php wp_nonce_field('cbwct_nonce_data'); ?>
<input type="submit" value="<?php apply_filters('cbwct_submit_button_text', __('Track Order', 'cbwet'));?>">
</div>
</div>
</form>
</div><!--/ Tracking Form -->

<!-- Pre Loader-->
<div class="cbwct_result_preload_area">
<div class="cbwct_result_preload">
<div></div><div></div><div></div>
</div>
</div><!--/ Pre Loader-->

<!-- Show All Output-->
<div class="cbwct-traking-form-result"></div><!--/ Show All Output-->

</div>
</div>
45 changes: 3 additions & 42 deletions inc/template.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,47 +7,8 @@
}

get_header();
?>

// get template markup
require_once( CBWCT_TRACKER_PATH . '/inc/template-markup.php');

<div class="cbwct-tracking-container">
<div class="cbwct-tracking">
<div class="cbwct-tracking-title">
<h2><?php apply_filters( 'cbwct_order_tracking_heading', __('Order Tracker', 'cbwet') );?></h2>
</div>

<!--Tracking Form -->
<div class="cbwct-tracking-from">
<form method="POST">
<div class="cbwct-tracking-form-area">
<div class="cbwct-tracking-form-field">
<label for="order_number"><?php apply_filters('cbwct_field_text_order_number', __('Order Number', 'cbwet'));?></label>
<input type="text" id="order_number" name="order_number" placeholder="Order Number...">
</div>
<div class="cbwct-tracking-form-field">
<label for="phone"><?php apply_filters('cbwct_field_text_phone_number', __('Phone Number', 'cbwet'));?></label>
<input type="text" id="phone" name="phone_number" placeholder="Phone Number...">
</div>
<div class="cbwct-tracking-form-field cbwct-traking-form-submit">
<?php wp_nonce_field('cbwct_nonce_data'); ?>
<input type="submit" value="<?php apply_filters('cbwct_submit_button_text', __('Track Order', 'cbwet'));?>">
</div>
</div>
</form>
</div><!--/ Tracking Form -->

<!-- Pre Loader-->
<div class="cbwct_result_preload_area">
<div class="cbwct_result_preload">
<div></div><div></div><div></div>
</div>
</div><!--/ Pre Loader-->

<!-- Show All Output-->
<div class="cbwct-traking-form-result"></div><!--/ Show All Output-->

</div>
</div>


<?php get_footer();
get_footer();
14 changes: 7 additions & 7 deletions inc/templates/progress.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<!--Single Step-->
<div class="cbwct_wc_traking_step">
<div class="cbwct-wc-traking-img">
<img src="<?php echo CBWCT_TRACKER_URL . 'img/place-order.png'; ?>" title="Order" alt="delivery">
<img src="<?php echo esc_url(CBWCT_TRACKER_URL) . 'img/place-order.png'; ?>" title="Order" alt="delivery">
</div>
<div class="cbwct-wc-traking-round"></div>

Expand All @@ -22,7 +22,7 @@
<!--Single Step-->
<div class="cbwct_wc_traking_step">
<div class="cbwct-wc-traking-img">
<img src="<?php echo CBWCT_TRACKER_URL . 'img/payment.png'; ?>" title="Payment Pending" alt="delivery">
<img src="<?php echo esc_url(CBWCT_TRACKER_URL) . 'img/payment.png'; ?>" title="Payment Pending" alt="delivery">
</div>
<div class="cbwct-wc-traking-round <?php CBWCT_ORDER_TRACKER::cbwct_wcps('pending', $order->get_status(), 'ali-wc-payment active');?>"></div>
</div>
Expand All @@ -31,7 +31,7 @@
<!--Single Step-->
<div class="cbwct_wc_traking_step">
<div class="cbwct-wc-traking-img">
<img src="<?php echo CBWCT_TRACKER_URL . 'img/hold.png'; ?>" title="On Hold" alt="delivery">
<img src="<?php echo esc_url(CBWCT_TRACKER_URL) . 'img/hold.png'; ?>" title="On Hold" alt="delivery">
</div>
<div class="cbwct-wc-traking-round <?php CBWCT_ORDER_TRACKER::cbwct_wcps('on-hold', $order->get_status(), 'ali-wc-hold active');?>"></div>
</div>
Expand All @@ -40,7 +40,7 @@
<!--Single Step-->
<div class="cbwct_wc_traking_step">
<div class="cbwct-wc-traking-img">
<img class="<?php CBWCT_ORDER_TRACKER::cbwct_wcps('processing', $order->get_status(), 'cbwct_progress');?>" src="<?php echo CBWCT_TRACKER_URL . 'img/processing.png'; ?>" title="Processing" alt="delivery">
<img class="<?php CBWCT_ORDER_TRACKER::cbwct_wcps('processing', $order->get_status(), 'cbwct_progress');?>" src="<?php echo esc_url(CBWCT_TRACKER_URL) . 'img/processing.png'; ?>" title="Processing" alt="delivery">
</div>
<div class="cbwct-wc-traking-round <?php CBWCT_ORDER_TRACKER::cbwct_wcps('processing', $order->get_status(), 'ali-wc-processing active');?>"></div>
</div>
Expand All @@ -49,8 +49,8 @@
<!--Single Step-->
<div class="cbwct_wc_traking_step">
<div class="cbwct-wc-traking-img">
<img src="<?php echo CBWCT_TRACKER_URL . 'img/delivery.png'; ?>" title="Shipping" alt="delivery">
<img class="cbwct_shipping <?php CBWCT_ORDER_TRACKER::cbwct_wcps('shipped', $order->get_status(), 'active');?>" src="<?php echo CBWCT_TRACKER_URL . 'img/delivery.png'; ?>" title="Shipping" alt="delivery">
<img src="<?php echo esc_url(CBWCT_TRACKER_URL) . 'img/delivery.png'; ?>" title="Shipping" alt="delivery">
<img class="cbwct_shipping <?php CBWCT_ORDER_TRACKER::cbwct_wcps('shipped', $order->get_status(), 'active');?>" src="<?php echo esc_url(CBWCT_TRACKER_URL) . 'img/delivery.png'; ?>" title="Shipping" alt="delivery">
</div>
<div class="cbwct-wc-traking-round <?php CBWCT_ORDER_TRACKER::cbwct_wcps('shipped', $order->get_status(), 'ali-wc-shipping active');?>"></div>
</div>
Expand All @@ -59,7 +59,7 @@
<!--Single Step-->
<div class="cbwct_wc_traking_step">
<div class="cbwct-wc-traking-img">
<img src="<?php echo CBWCT_TRACKER_URL . 'img/delivered.png'; ?>" title="delivered" alt="delivery">
<img src="<?php echo esc_url(CBWCT_TRACKER_URL) . 'img/delivered.png'; ?>" title="delivered" alt="delivery">
</div>
<div class="cbwct-wc-traking-round <?php CBWCT_ORDER_TRACKER::cbwct_wcps('completed', $order->get_status(), 'ali-wc-delivered active');?>"></div>
</div>
Expand Down
23 changes: 19 additions & 4 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,20 @@
Contributors: hmbashar
Tags: woocommerce order tracker, order tracker, order tracker, tracker, shipping, delivery tracker
Requires at least: 4.7
Tested up to: 5.4.2
Stable tag: 4.3
Tested up to: 6.0.1
Stable tag: 1.1
Requires PHP: 5.6
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Hi, Are you using WooCommerce? you can use the plugin for your customers can track his/her order status on your website, it's a woocommerce order tracking system with ajax, you can use it very every easy way, like make a page template or using the [cbwct-order-tracker] shortcode, anytime anywhere, and it's also working with ajax.
Hi, Are you using WooCommerce? you can use the plugin for your customers can track his/her order status on your website, it's a woocommerce order tracking system with ajax, you can use it very easy way, like make a page template or using the [cbwct-order-tracker] shortcode, anytime anywhere, and it's also working with ajax.

== Description ==


Hi, Are you using WooCommerce? you can use the plugin for your customers can track his/her order status on your website, it's a woocommerce order tracking system with ajax, you can use it very every easy way, like make a page template or using the [cbwct-order-tracker] shortcode, anytime anywhere, and it's also working with ajax.
Hi, Are you using WooCommerce? you can use the plugin for your customers can track his/her order status on your website, it's a woocommerce order tracking system with ajax, you can use it very easy way, like make a page template or using the [cbwct-order-tracker] shortcode, anytime anywhere, and it's also working with ajax.

https://www.youtube.com/watch?v=PojzV-wmLpw

= Filter Hook =

Expand Down Expand Up @@ -43,6 +44,14 @@ Yes, You've some of hooks for developer
* cbwct_shipped_prograss_percent
* cbwct_completed_prograss_percent

= Order and mobile number correct but still showing doesn't found? =
make sure your customer has used the exact same number for the tracking which that number input when placing the order. like If your customer inputs his/her phone number with country code when placing an order then his/her needs the exact same number with the country code.

If your customer input this format +88 (country code) 123456789 (mobile number) full number like +88123456789 then his/her need to exact same like +88123456789 for the tracking.

or if he/she inputs without country code and only mobile number like this 123456789 then his/her need to input without country code like this 123456789 number for tracking.


== Screenshots ==

1. Cancelled ordered
Expand All @@ -52,6 +61,12 @@ Yes, You've some of hooks for developer

== Changelog ==

= 1.1 =
* Add Shipped in status
* shortcode error fix
* Few changes.


= 1.0 =
* Release new version.

Expand Down
Binary file added screenshots/banner-772x250.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit d14b4ad

Please sign in to comment.