Class orddd_common
Common functions used in the plugin
Author: Tyche Softwares
Class: orddd_common
Located at orddd-common.php
Methods summary
public static
string
|
#
delivery_date_language( string $delivery_date_formatted, string $delivery_date_timestamp )
Return the date with the selected langauge in Appearance tab |
public static
string
|
|
public static
string
|
#
orddd_get_order_timeslot( integer $order_id, boolean $is_subscription_parent_order = false )
Returns time slot for an order |
public static
array
|
#
orddd_get_betweendays( string $FromDate, string $ToDate )
Returns between days from a start date till end date |
public static
integer
|
#
get_shipping_setting_option_key( integer $row_id )
Returns option key to update the Custom Delivery Settings in options table |
public static
string
|
#
orddd_time_settings_enable_for_custom_delivery( )
Returns yes if the time settings is enabled for the Custom Delivery Setting |
public static
string
|
#
orddd_get_timestamp( string $delivery_date, string $date_format, array $time_setting )
Returns timestamp for the selected delivery date |
public static
string
|
#
orddd_get_zone_id( array $post_array = array(), boolean $is_ajax = true )
Get the zone id for the address on the checkout page |
public static
string
|
#
orddd_shipping_methods_for_custom( )
Check if the custom delivery setting is added for the shipping method or product category |
public static
array
|
|
public static
string
|
#
get_disabled_days( )
Get days to disable on the calendar when the same day or next day is enabled. |
public static
|
#
orddd_cancel_delivery_for_trashed( integer $order_id )
Free up delivery date & time when the order is moved to trash |
public static
|
#
orddd_untrash_order( integer $post_id )
Block the delivery date & time again when the order is restored from the trash |
public static
|
#
orddd_restore_deliveries( integer $order_id, string $old_status, string $new_status )
Restoring the deliveries when the order status is changed from cancelled/refunded/failed. |
public static
|
#
orddd_cancel_delivery( integer $order_id )
Cancel Delivery for the order when the order status is cancelled/refunded/failed. |
public static
string
|
#
orddd_admin_product_has_delivery( integer $product_id )
Check if delivery is enabled for the product category |
public static
string
|
|
public static
string
|
#
orddd_get_shipping_method_str( array $shipping_settings )
Return the selected settings by option value of the custom delivery settings added in the admin |
public static
string
|
#
orddd_get_shipping_methods_for_categories( array $shipping_settings )
Return the selected shipping method/shipping class/product category for the custom delivery settings added in the admin |
public static
string
|
#
orddd_get_shipping_enable_delivery_date( array $shipping_settings )
Return the enable delivery date checkbox value for the custom delivery settings added in the admin |
public static
string
|
#
orddd_get_shipping_delivery_checkout_option( array $shipping_settings )
Return the delivery checkout option radio button value for the custom delivery settings added in the admin |
public static
string
|
#
orddd_get_shipping_orddd_min_between_days( array $shipping_settings )
Return the min range for text block value for the custom delivery settings added in the admin |
public static
string
|
#
orddd_get_shipping_orddd_max_between_days( array $shipping_settings )
Return the max range for text block value for the custom delivery settings added in the admin |
public static
string
|
#
orddd_get_shipping_minimum_delivery_time( array $shipping_settings )
Return the minimum delivery time in hours for the custom delivery settings added in the admin |
public static
string
|
#
orddd_get_shipping_date_field_label( array $shipping_settings )
Return the delivery date field label for the custom delivery settings added in the admin |
public static
string
|
#
orddd_get_shipping_time_field_label( array $shipping_settings )
Return the delivery time field label for the custom delivery settings added in the admin |
public static
string
|
#
orddd_get_shipping_time_settings_variable( array $shipping_settings, string $holidays_str, string $lockout_str )
Return the options to be set for the time sliders for custom delivery settings added in the admin |
public static
string
|
#
orddd_get_shipping_from_time( array $time_settings, array $shipping_settings, string $holidays_str, string $lockout_str )
Return the from time set for the time sliders for custom delivery settings added in the admin |
public static
string
|
#
orddd_get_shipping_date_field_mandatory( array $shipping_settings )
Return the delivery date field mandatory checkbox value for custom delivery settings added in the admin |
public static
string
|
#
orddd_is_shipping_timeslot_enable( array $shipping_settings )
Check whether the time slod is enabled for the custom delivery settings added in the admin |
public static
string
|
#
orddd_get_shipping_time_field_mandatory( array $shipping_settings )
Return the delivery time field mandatory checkbox value for custom delivery settings added in the admin |
public static
string
|
#
orddd_get_shipping_disabled_days_str( array $shipping_settings, array $same_day, array $next_day )
Return the delivery dates to disabled when same or next day is enabled for custom delivery settings added in the admin |
public static
array
|
#
orddd_common_delivery_days_for_product_category( string $orddd_shipping_id, boolean $is_ajax = false )
Return the common delivery days/dates enabled when the multiple product categories/shipping classes are added to the cart |
public static
array
|
#
orddd_get_common_delivery_dates( array $specific_dates, arrry $common_days, array $delivery_days )
Return the common delivery specific dates enabled when the multiple product categories are added to the cart |
public static
array
|
#
orddd_get_common_delivery_days( array $delivery_days )
Return the common delivery weekdays enabled when the multiple product categories are added to the cart |
public static
array
|
|
public static
array
|
#
orddd_get_cart_product_categories( boolean $is_ajax, integer $order_id )
Return all product categories for the products added to the cart |
public static
string
|
#
orddd_get_cart_shipping_classes( boolean $is_ajax, integer $order_id )
Return all shipping classes for the products added to the cart |
public static
string
|
#
orddd_get_product_category_for_higher_minimum_delivery_time( integer $order_id = '' )
Return product category which has the highest minimum delivery time added in the custom settings |
public static
integer
|
#
orddd_get_higher_minimum_delivery_time( integer $order_id = '' )
Return the highest minimum delivery time added in the custom settings |
public static
string
|
#
orddd_get_highest_same_day( integer $order_id = '' )
Return the highest same day cut-off time added in the custom settings |
public static
string
|
#
orddd_get_highest_next_day( integer $order_id = '' )
Return the highest next day cut-off time added in the custom settings |
public static
string
|
#
orddd_get_product_shipping_class( integer $order_id = '' )
Return Product shipping class for which settings loads on the checkout page |
public static
string
|
#
get_base_shipping_class( string $shipping_class_id )
Returns the Shipping Class ID in the base language |
public static
string
|
#
ordd_get_shipping_class_slug( string $shipping_class_id )
Returns the Shipping Class Slug for the passed ID |
public static
string
|
#
orddd_get_shipping_class_for_higher_minimum_delivery_time( integer $order_id = '' )
Return shipping class which has the highest minimum delivery time added in the custom settings |
public static
string
|
#
orddd_is_delivery_enabled( )
Checks if there is a Virtual/Featured product in cart and delivery is enable for these products or not |
public static
string
|
#
orddd_get_address_key( array $package )
Returns the address key of the address package from shipping multiple addresses plugin |
public static
boolean
|
#
get_wcms_session( )
Returns the addresses stored in session from shipping multiple addresses plugin |
public static
array
|
#
orddd_get_total_orders_to_export( )
Returns the total number of orders to be exported to the google calendar |
public static
array
|
|
public static
string
|
#
orddd_get_shipping_method_enabled( )
Checks if the settings for shipping methods are added in custom delivery settings |
public static
string
|
|
public static
string
|
#
orddd_get_formatted_shipping_customer_address( integer $user_id )
Return formatted shipping custom address |
public static
array
|
#
get_timeslot_values( string $time_slot )
Return the time slots in array format for the custom delivery settings |
public static
array
|
#
orddd_get_timeslots( string $current_date, integer $dw, string $delivery_date )
Return all the time slots added for a day/date |
public static
string
|
|
public static
string
|
|
public static
array
|
|
public static
array
|
|
public static
array
|
#
get_timeslot_to_disable( integer $dw, string $delivery_date, array $disable_days )
Return all the time slots disabled for a date/weekday |
public static
array
|
#
get_min_date( integer $delivery_time_seconds, array $delivery_time_enabled, str $holidays_str, str $lockout_str, array $shipping_settings = array() )
Return the minimum delivery date & time |
public static
string
|
#
orddd_get_if_past_specific_dates( array $specific_dates )
Checks if all the added specific dates are past dates or not. |
public static
integer
|
|
public static
array
|
#
orddd_get_timeslot_display( string $time_slot_for_order )
Checks if all the added specific dates are past dates or not. |
public static
resource
|
#
dateTimeDiff( resource $date1, resource $date2 )
This function will return the differance days between two dates. |
public static
array
|
#
orddd_date_range_limit( string $start, string $end, integer $adj, string $a, string $b, array $result )
Calculates the difference between the dates. |
public static
array
|
|
public static
array
|
|
public static
array
|
#
orddd_previous_charges_label( integer $order_id )
Get previous added delivery charges labels for an order. |
public static
|
#
orddd_update_delivery_charges( integer $order_id, string $delivery_date, string $time_slot )
Update delivery charges for edited delivery date on edit order page. |
public static
array
|
#
orddd_get_delivery_date_charges( integer $order_id, string $delivery_date, string $time_slot )
Get the delivery charges of the selected date and time |
public static
string
|
#
orddd_get_shipping_method_for_order( resource $order )
Get the delivery charges of the selected date and time |
public static
string
|
#
orddd_get_shipping_service_name( string $usps_service_id )
Get service name for the USPS services from WooCommerce USPS shipping plugin |
public static
string
|
|
public static
array
|
#
orddd_get_event_details( integer $order_id )
Get order details to be exported to the google calendar |
public static
string
|
#
orddd_get_text_block_shipping_date( integer $delivery_time_seconds )
Return estimated shipping date for text block |
public static
string
|
#
orddd_is_delivery_calendar_enabled_for_custom_delivery( )
Check if the delivery calendar is enabled for the custom setting |
public static
string
|
#
orddd_is_text_block_enabled_for_custom_delivery( )
Check if the text block is enabled for the custom setting |
public static
string
|
#
orddd_get_delivery_date_field_label( string $shipping_method, string $product_category, string $shipping_class )
Get the delivery date field label for the custom setting on checkout page. |
public static
string
|
#
orddd_get_delivery_time_field_label( string $shipping_method, string $product_category, string $shipping_class )
Get the delivery time field label for the custom setting on checkout page. |
public static
string
|
#
orddd_get_order_shipping_method( integer $order_id )
Get the selected shipping method for an order. |
public static
string
|
#
orddd_get_order_product_category( integer $order_id )
Get the product categories of the products added to an order |
public static
|
|
public static
|