Skip to content

Instantly share code, notes, and snippets.

View robertdevore's full-sized avatar
🛠️
#NeverNotWorking

Robert DeVore robertdevore

🛠️
#NeverNotWorking
View GitHub Profile
@robertdevore
robertdevore / ddwc-delivery-text-google-map.php
Last active July 29, 2019 17:54
Add the delivery address as text on the driver details page along with the Google Map
/**
* 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 );
@robertdevore
robertdevore / age-verification-redirect-on-fail-filter.php
Created September 26, 2019 20:27
Change the URL for the Age Verification plugin's redirect on fail (user selects NO button)
<?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;
}
<?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 ) {
@robertdevore
robertdevore / ddwc-assigned-orders-order-details-url.php
Created October 4, 2019 19:08
Filter the Assigned Orders table Order URL
<?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';
@robertdevore
robertdevore / ddwc-endpoint-title-filter.php
Last active December 2, 2019 20:25
Change the "Driver Dashboard" endpoint title for the WooCommerce menu items
<?php
/**
* Change "Driver Dashboard" endpoint title
*
* @return string
*/
function acme_endpoint_title() {
return esc_attr__( 'NEW TITLE HERE', 'acme-lang' );
}
add_filter( 'ddwc_my_account_menu_item_driver_dashboard', 'acme_endpoint_title' );
@robertdevore
robertdevore / age-verification-after-content-filter.php
Last active December 4, 2019 20:24
Add your own content to the Age Verification plugin for WordPress
<?php
/**
* Add content after the Age Verification pop up content
*
* @author Robert DeVore <deviodigital@gmail.com>
* @link https://www.wordpress.org/plugins/dispensary-age-verification/
* @return string
*/
function acme_after_popup_content( $string ) {
// Change the following to anything you'd like to display.
<?php
/**
* Google Maps filter
*
* @author Robert DeVore <deviodigital@gmail.com>
* @link https://www.wordpress.org/plugins/delivery-drivers-for-woocommerce/
* @return string
*/
function acme_google_maps_delivery_address( $google_map, $delivery_address, $store_address ) {
// Change the google map.
@robertdevore
robertdevore / dtwc-date-format-filter.php
Last active April 20, 2020 03:56
Customize the date output in the Delivery Times for WooCommerce
<?php
/**
* Delivery Times for WooCommerce
*
* Change the date format (default: M j, Y)
*
* @link https://wordpress.org/plugins/delivery-times-for-woocommerce/
* @return string
*/
function acme_date_format( $format ) {
<?php
/**
* Change redirect URL for driver login
*
* @url https://wordpress.org/plugins/delivery-drivers-for-woocommerce
* @return string
*/
function acme_login_redirect( $link ) {
// Change the value to your full my-account URL (https://etc)
$link = 'YOUR_URL_HERE';
<?php
/**
* Filter the order statuses used in the Unclaimed Orders table
*
* @url https://www.deviodigital.com/product/delivery-drivers-for-woocommerce-pro/
* @param $statuses array
* @return array
*/
function acme_unclaimed_orders_status_array( $statuses ) {
$statuses = array( 'processing', 'another', 'example' );