Changeset 2692952
- Timestamp:
- 03/12/2022 01:56:01 PM (4 years ago)
- Location:
- quiver-delivery/trunk
- Files:
-
- 4 edited
-
includes/class-quiver-delivery-shipping-method.php (modified) (6 diffs)
-
quiver-delivery.php (modified) (2 diffs)
-
readme.md (modified) (1 diff)
-
readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
quiver-delivery/trunk/includes/class-quiver-delivery-shipping-method.php
r2624465 r2692952 16 16 'QUI-WN' => 'WINDOW' 17 17 ]; 18 private $BATCH_CREATE_QUOTE_URL = 'https://api.quiver.london/delivery/quotes:batchCreate'; 19 private $CREATE_DELIVERY_URL = 'https://api.quiver.london/delivery/deliveries'; 18 // private $BATCH_CREATE_QUOTE_URL = 'https://api.quiver.london/delivery/quotes:batchCreate'; 19 // private $CREATE_DELIVERY_URL = 'https://api.quiver.london/delivery/deliveries'; 20 private $BATCH_CREATE_QUOTE_URL = 'http://localhost:2002/delivery/quotes:batchCreate'; 21 private $CREATE_DELIVERY_URL = 'http://localhost:2002/delivery/deliveries'; 20 22 21 23 /** … … 90 92 'postcode' => array_key_exists('postcode', $destination) ? $destination['postcode'] : '', 91 93 ]; 94 95 if (empty($address['postcode'])) { 96 return; 97 } 92 98 93 99 $lineItems = []; … … 97 103 } 98 104 105 $order = [ 106 'subtotalPrice' => (float) WC()->cart->get_subtotal() 107 ]; 108 99 109 $request = [ 100 110 'address' => $address, 101 111 'lineItems' => $lineItems, 112 'order' => $order 102 113 ]; 103 114 … … 148 159 $quiver_line_items = $this->order_to_line_items($order); 149 160 $quiver_customer = $this->order_to_quiver_customer($order); 161 $quiver_purchaser = $this->order_to_quiver_purchaser($order); 150 162 $quiver_address = $this->order_to_quiver_address($order); 151 163 … … 157 169 'address' => $quiver_address, 158 170 ]; 171 172 if ($quiver_purchaser['firstName'] != $quiver_customer['firstName'] 173 || $quiver_purchaser['lastName'] != $quiver_customer['lastName'] 174 || $quiver_purchaser['company'] != $quiver_customer['company']) { 175 $request['purchaser'] = $quiver_purchaser; 176 } 177 159 178 $response = $this->post_request($this->CREATE_DELIVERY_URL, $request); 160 179 if (!$response) { … … 214 233 'firstName' => $order->get_shipping_first_name(), 215 234 'lastName' => $order->get_shipping_last_name(), 235 'company' => $order->get_shipping_company(), 236 'emailAddress' => $order->get_billing_email(), 237 'phoneNumber' => $order->get_billing_phone() 238 ]; 239 } 240 241 /** 242 * @param WC_Order $order 243 * @return array 244 */ 245 private function order_to_quiver_purchaser( $order ) { 246 return [ 247 'firstName' => $order->get_billing_first_name(), 248 'lastName' => $order->get_billing_last_name(), 249 'company' => $order->get_billing_company(), 216 250 'emailAddress' => $order->get_billing_email(), 217 251 'phoneNumber' => $order->get_billing_phone() -
quiver-delivery/trunk/quiver-delivery.php
r2624465 r2692952 4 4 * Plugin URI: https://wordpress.org/plugins/quiver-delivery/ 5 5 * Description: Quiver provides fast and emissionless urban delivery. Magic. 6 * Version: 1.0. 06 * Version: 1.0.1 7 7 * Author: Quiver 8 8 * Author URI: https://getquiver.co.uk/ … … 22 22 class Quiver_Delivery { 23 23 24 private $version = "1.0. 0";24 private $version = "1.0.1"; 25 25 26 26 /** -
quiver-delivery/trunk/readme.md
r2625649 r2692952 6 6 Requires PHP: 5.6 7 7 Tested up to: 5.8.1 8 Stable tag: 1.0. 08 Stable tag: 1.0.1 9 9 WC requires at least: 3.0.0 10 10 WC tested up to: 5.8.0 -
quiver-delivery/trunk/readme.txt
r2625649 r2692952 6 6 Requires PHP: 5.6 7 7 Tested up to: 5.8.1 8 Stable tag: 1.0. 08 Stable tag: 1.0.1 9 9 WC requires at least: 3.0.0 10 10 WC tested up to: 5.8.0
Note: See TracChangeset
for help on using the changeset viewer.