Overview
  • Package
  • Class
  • Tree
  • Deprecated
  • Todo
  • Hook Reference
  • Docs Home

Packages

  • None
  • Product-Delivery-Date-Pro-for-WooCommerce
    • Addon
    • Admin
      • Settings
        • Field-Labels
        • General
        • Google-Sync
      • View-Deliveries
    • Calendar
    • Common-Functions
    • Configuration
    • Delivery-Charges
    • Edit-Deliveries
    • Emails
    • Frontend
      • Cart
      • Checkout
    • Google-Calendar
    • Languages
    • License
    • Reschedule-Deliveries
    • View-Deliveries

Classes

  • prdd_special_delivery_price
  • prdd_timeslot_price

Class prdd_timeslot_price

Timeslot delivery charges class.

Package: Product-Delivery-Date-Pro-for-WooCommerce\Delivery-Charges
Author: Tyche Softwares
Since: 1.0
Located at prdd-timeslot-price.php

Methods summary

public
# __construct( )

Default Constructor

Default Constructor

Since

1.0
public
# timeslot_price_field( )

Time slot charges field on admin edit product page.

Time slot charges field on admin edit product page.

Since

1.0

Hook

prdd_after_lockout_time
public array
# timeslot_price_save( array $date_time_settings, integer|string $post_id )

Save time slot charges on admin edit product page.

Save time slot charges on admin edit product page.

Parameters

$date_time_settings
Time slots settings to save.
$post_id
Product ID.

Returns

array
Time slots settings to save with time slot charges.

Since

1.0

Hook

prdd_save_slot_field_settings
public
# timeslot_price_column_name( integer|string $product_id )

Add Time slot price column on Manage Dates, Time slots tab on admin edit product page.

Add Time slot price column on Manage Dates, Time slots tab on admin edit product page.

Parameters

$product_id
Product ID.

Since

1.0

Hook

prdd_add_column_names
public integer|string
# timeslot_price_column_value( integer|string $slot_price, array $date_time_settings )

Display Time slot price on Manage Dates, Time slots tab on admin edit product page.

Display Time slot price on Manage Dates, Time slots tab on admin edit product page.

Parameters

$slot_price
Time slot price.
$date_time_settings
Time slots added.

Returns

integer|string
Time slot price.

Since

1.0

Hook

prdd_add_column_value
public
# timeslot_price_div( integer|string $product_id )

Display Time slot price on frontend product page.

Display Time slot price on frontend product page.

Parameters

$product_id
Product ID.

Since

1.0

Todo

Unused function.

Hook

prdd_display_price_div
public
# timeslot_hidden_fields( integer|string $product_id )

Add hidden field required for time slot charges on frontend product page.

Add hidden field required for time slot charges on frontend product page.

Parameters

$product_id
Product ID.

Since

1.0

Hook

prdd_print_hidden_fields
public string
# get_timeslot_variable_price( integer|string $product_id )

Checks if the time slot price is added for any of the time slot for the product.

Checks if the time slot price is added for any of the time slot for the product.

Parameters

$product_id
Product ID.

Returns

string
'yes' if time slot price is added, else 'no'.

Since

1.0
public array
# timeslot_add_to_cart( array $cart_arr, integer|string $product_id, integer|string $variation_id, array $cart_item_meta )

Add time slot delivery charges to the cart item when add to cart button is clicked

Add time slot delivery charges to the cart item when add to cart button is clicked

Parameters

$cart_arr
WooCommerce cart array.
$product_id
Product ID.
$variation_id
Variation ID for the selected attributes.
$cart_item_meta
Cart item meta array.

Returns

array
WooCommerce cart array.

Since

1.0

Hook

prdd_addon_add_cart_item_data
public array
# get_timeslot_cart_item_from_session( array $cart_item, array $values )

This function adjust the prices calculated from the plugin in the cart session.

This function adjust the prices calculated from the plugin in the cart session.

Parameters

$cart_item
Cart item data.
$values
$_POST values.

Returns

array
Cart item data with delivery details.

Since

1.0

Hook

prdd_get_cart_item_from_session
public array
# timeslot_get_item_data( array $other_data, array $cart_item )

This function adds the time slot prices data on the Cart and Checkout page.

This function adds the time slot prices data on the Cart and Checkout page.

Parameters

$other_data
Additional data to be displayed.
$cart_item
Cart item data.

Returns

array
Additional data to be displayed with delivery fields.

Since

1.0

Hook

prdd_get_item_data
public array
# add_cart_item( array $cart_item )

This function adjust the extra prices for the product with the price calculated from the plugin.

This function adjust the extra prices for the product with the price calculated from the plugin.

Parameters

$cart_item
Cart item array

Returns

array
Cart item array with adjusted price

Since

1.0

Globals

resource $wpdb WordPress object
public static string
# get_price( integer|string $product_id, integer|string $variation_id, string $product_type, string $delivery_date, string $time_slot )

Returns time slot prices added for the selected delivery date and time slot for the product.

Returns time slot prices added for the selected delivery date and time slot for the product.

Parameters

$product_id
Product ID.
$variation_id
Variation ID.
$product_type
Product type.
$delivery_date
Selected delivery date.
$time_slot
Selected time slot.

Returns

string
Time slot price.

Since

1.0
public static
# timeslot_order_item_meta( array $values, resource $order )

Add time slot prices as order item meta when order is placed.

Add time slot prices as order item meta when order is placed.

Parameters

$values
Cart item values.
$order
Order object.

Since

1.0

Globals

resource $wpdb WordPress object.

Hook

prdd_update_order
API documentation generated by ApiGen