This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Order details URL | |
* | |
* Change the order details URL that is used on the Driver Dashboard, inside | |
* of the assigned orders table. | |
*/ | |
function acme_driver_dashboard_assigned_orders_order_details_url( $url, $orderid ) { | |
$url = 'YOUR_URL_HERE'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Change the origin address in the driver dashboard | |
* to display the customer's Billing Address | |
* | |
* @author Robert DeVore <deviodigital@gmail.com> | |
* @link https://www.wordpress.org/plugins/delivery-drivers-for-woocommerce/ | |
* @return string | |
*/ | |
function acme_google_maps_origin_address( $store_address ) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Redirect users who select "NO" in the age verification pop up. | |
*/ | |
function acme_avwp_redirect_on_fail_link( $redirect_fail ) { | |
$redirect_fail = 'https://yoururlhere.com'; | |
return $redirect_fail; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Add delivery address as plain text above the Google Map on driver's order details page | |
*/ | |
function acme_delivery_address_google_map( $google_map, $delivery_address, $store_address ) { | |
// Append delivery address to Google Map. | |
$google_map = '<p>' . $delivery_address . '</p>' . $google_map; | |
echo $google_map; | |
} | |
add_filter( 'ddwc_delivery_address_google_map', 'acme_delivery_address_google_map', 10, 3 ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Remove data from order details | |
*/ | |
add_filter( 'ddwc_driver_dashboard_delivery_total', '__return_false' ); | |
add_filter( 'ddwc_driver_dashboard_order_total', '__return_false' ); | |
add_filter( 'ddwc_driver_dashboard_total_title', '__return_false' ); | |
add_filter( 'ddwc_driver_dashboard_order_item_price', '__return_false' ); | |
add_filter( 'ddwc_driver_dashboard_payment_method', '__return_false' ); | |
add_filter( 'ddwc_driver_dashboard_assigned_orders_total_title', '__return_false' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Filters the link text of the header logo above the login form. | |
* | |
* @since 5.2.0 | |
* | |
* @param string $login_header_text The login header logo link text. | |
*/ | |
$login_header_text = apply_filters( 'login_headertext', $login_header_text ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Get order data. | |
$order = wc_get_order( 1246 ); | |
// Order total. | |
$total = $order->get_total(); | |
// Add Product data. | |
$product_id = 8; | |
$quantity = 1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//Works with WooCommerce 3.2.6 | |
add_action( 'woocommerce_shipping_init', 'econt_shipping_method' ); | |
function econt_shipping_method() { | |
if ( ! class_exists( 'WC_Econt_Shipping_Method' ) ) { | |
class WC_Econt_Shipping_Method extends WC_Shipping_Method { | |
public function __construct( $instance_id = 0 ) { | |
$this->instance_id = absint( $instance_id ); | |
$this->id = 'econt';//this is the id of our shipping method |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Driver Dadshboard - Access Denied Filter | |
*/ | |
function acme_access_denied( $access_denied ) { | |
if ( false !== get_option( 'ddwc_pro_settings_driver_application' ) && 'yes' == get_option( 'ddwc_pro_settings_driver_application' ) ) { | |
if ( false !== get_option( 'ddwc_pro_settings_contact_page' ) && 'none' !== get_option( 'ddwc_pro_settings_contact_page' ) ) { | |
$contact_link = get_permalink( get_option( 'ddwc_pro_settings_contact_page' ) ); | |
} else { | |
$contact_link = 'mailto:' . get_option( 'admin_email' ); |