Changeset 3020868
- Timestamp:
- 01/12/2024 09:21:16 AM (2 years ago)
- Location:
- iwd-checkout-connector/trunk
- Files:
-
- 9 added
- 12 edited
-
admin/additional_fields.php (added)
-
admin/check-connection/iwd-connector-check-connection.php (modified) (3 diffs)
-
admin/class-iwd-connector-backend.php (modified) (2 diffs)
-
admin/templates/customer_account (added)
-
admin/templates/customer_account/personal_information_section.php (added)
-
admin/templates/order/additional-fields (added)
-
admin/templates/order/additional-fields/address_information_section.php (added)
-
admin/templates/order/additional-fields/customer_account_section.php (added)
-
admin/templates/order/additional-fields/payment_section.php (added)
-
admin/templates/order/additional-fields/personal_details_section.php (added)
-
admin/templates/order/additional-fields/shipping_methods_section.php (added)
-
admin/templates/settings-options.php (modified) (1 diff)
-
includes/api/class-iwd-con-api.php (modified) (3 diffs)
-
includes/api/class-iwd-con-place-order.php (modified) (4 diffs)
-
includes/model/cart/class-iwd-con-cart.php (modified) (1 diff)
-
includes/model/customer/class-iwd-con-customer.php (modified) (1 diff)
-
includes/model/session/class-iwd-con-cart-session.php (modified) (1 diff)
-
iwd-checkout-connector.php (modified) (2 diffs)
-
public/class-iwd-connector-frontend.php (modified) (1 diff)
-
public/templates/iwd-checkout-saas.php (modified) (1 diff)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
iwd-checkout-connector/trunk/admin/check-connection/iwd-connector-check-connection.php
r2629644 r3020868 67 67 case 'wrong_api_credentials': 68 68 return __( 'Wrong Integration API Credentials' ); 69 case 'not_configured_payments':70 return __( 'Not Configured Payments' );71 69 case 'wrong_website_url': 72 70 return __( 'Wrong Integration Website URL' ); … … 98 96 case 'wrong_api_credentials': 99 97 return __( 'We were unable to locate an Integration with your Api Key & Secret. Please enter valid API Key & Secret from your ' . $checkoutAdminUrl . ' on our ' . $iwdSiteUrl . '.' ); 100 case 'not_configured_payments':101 return __( 'Your Payment Methods are not configured. Please go to your ' . $checkoutAdminUrl . ' on our ' . $checkoutAdminUrl . ' and configure at least one Payment Method.' );102 98 case 'wrong_website_url': 103 99 return __( 'Your current Store URL differs from the Website URL saved for your Integration. Please go to your ' . $checkoutAdminUrl . ' on our ' . $iwdSiteUrl . ' and change Website URL value for your Integration' ); … … 136 132 return array( 137 133 'error' => false, 138 'massage' => __( 'C onnection Successful' ),134 'massage' => __( 'Checkout is Successfully Connected!' ), 139 135 ); 140 136 } -
iwd-checkout-connector/trunk/admin/class-iwd-connector-backend.php
r2946120 r3020868 1 1 <?php 2 require_once IWD_CONNECTOR_PATH . 'admin/additional_fields.php'; 2 3 3 4 if ( ! class_exists( 'Iwd_Connector_Admin' ) ) { … … 28 29 */ 29 30 public function __construct() { 31 new Iwd_Additional_Fields(); 32 30 33 add_action( 'admin_menu', array( $this, 'add_admin_menu' ) ); 31 34 add_action( 'admin_init', array( $this, 'options_update' ) ); -
iwd-checkout-connector/trunk/admin/templates/settings-options.php
r2946120 r3020868 61 61 <button type="submit" name="Connection Test" id="iwd-connector-connection-test">Connection Test<br> 62 62 </button> 63 <p>Check to make sure your payment methods are configured within Dominate's Checkout Admin Panel to continue using</p> 63 64 </td> 64 65 </tr> -
iwd-checkout-connector/trunk/includes/api/class-iwd-con-api.php
r2540679 r3020868 51 51 } 52 52 53 /** 54 * Save data to session 55 * 56 * @param $quote_id 57 */ 53 /** 54 * Save data to session 55 * 56 * @param $quote_id 57 * @throws Exception 58 */ 58 59 public function setSessionData( $quote_id ) { 59 60 $session_data = $this->getSessionData( $quote_id ); … … 65 66 WC()->session->set( 'coupon_discount_tax_totals', maybe_unserialize( $session_data['coupon_discount_tax_totals'] ) ); 66 67 WC()->session->set( 'removed_cart_contents', maybe_unserialize( $session_data['removed_cart_contents'] ) ); 67 WC()->session->set( 'customer', $customer ); 68 WC()->customer->set_id( $customer['id']);68 69 $this->setCustomerAddress($customer); 69 70 70 71 if ( ! empty( $session_data['cart_fees'] ) ) { 71 72 WC()->session->set( 'cart_fees', maybe_unserialize( $session_data['cart_fees'] ) ); 72 73 } 74 75 WC()->customer->set_calculated_shipping( true ); 76 WC()->customer->save(); 77 73 78 WC()->session->save_data(); 74 79 WC()->cart->set_session(); … … 109 114 } 110 115 116 /** 117 * @return void 118 * @throws Exception 119 * 120 */ 121 private function setCustomerAddress($customer) { 122 WC()->customer = new WC_Customer( $customer['id'], true ); 123 124 WC()->customer->set_shipping_first_name( $customer['shipping_first_name'] ); 125 WC()->customer->set_shipping_last_name( $customer['shipping_last_name'] ); 126 WC()->customer->set_shipping_address( $customer['shipping_address_1'] ); 127 WC()->customer->set_shipping_country( $customer['shipping_country'] ); 128 WC()->customer->set_shipping_state( $customer['shipping_state'] ); 129 WC()->customer->set_shipping_city( $customer['shipping_city'] ); 130 WC()->customer->set_shipping_postcode( $customer['shipping_postcode'] ); 131 WC()->customer->set_shipping_phone( $customer['shipping_phone']); 132 133 WC()->customer->set_billing_first_name($customer['first_name']); 134 WC()->customer->set_billing_last_name($customer['last_name']); 135 WC()->customer->set_billing_address($customer['address']); 136 WC()->customer->set_billing_country($customer['country']); 137 WC()->customer->set_billing_state( $customer['state'] ); 138 WC()->customer->set_billing_city( $customer['city'] ); 139 WC()->customer->set_billing_postcode( $customer['postcode'] ); 140 WC()->customer->set_billing_phone( $customer['phone']); 141 WC()->customer->set_billing_email( $customer['email'] ); 142 } 111 143 } -
iwd-checkout-connector/trunk/includes/api/class-iwd-con-place-order.php
r2946120 r3020868 129 129 $order->set_shipping_city($this->customer_data['shipping_city']); 130 130 $order->set_shipping_postcode($this->customer_data['shipping_postcode']); 131 $order->set_shipping_phone($this->customer_data['shipping_phone']); 131 132 132 133 // apply coupons … … 146 147 $order->set_prices_include_tax('yes' === get_option('woocommerce_prices_include_tax')); 147 148 148 if ($api->data->comments) { 149 foreach ($api->data->comments as $comments) { 150 $order->add_order_note(__($comments)); 151 } 152 } 153 154 // set payment method 155 $methodCode = $this->parseMethodCode($api->data->payment_method_code); 156 $methodTitle = $api->data->payment_method_title; 157 $paymentAction = $api->data->payment_action; 158 $offlinePayments = [ 159 'zero', 'purchaseorder', 'custom', 'check_or_money_order', 'cash_on_delivery', 'banktransfer', 160 'multiple_offline', 161 ]; 162 163 $order->add_meta_data(self::TRANSACTION_STATUS, $paymentAction, true); 164 $order->set_payment_method_title($methodTitle); 165 $order->calculate_totals(); 149 // set payment method 150 $methodCode = $this->parseMethodCode($api->data->payment_method_code); 151 $methodTitle = $api->data->payment_method_title; 152 $paymentAction = $api->data->payment_action; 153 $offlinePayments = [ 154 'zero', 'purchaseorder', 'custom', 'check_or_money_order', 'cash_on_delivery', 'banktransfer', 155 'multiple_offline', 156 ]; 157 158 $order->add_meta_data( self::TRANSACTION_STATUS, $paymentAction, true ); 159 $order->set_payment_method_title($methodTitle); 160 $order->calculate_totals(); 161 $this->addAdditionalFields($api->data->custom_data->dominate, $order->get_id() ); 162 163 if ($api->data->comments) { 164 foreach ($api->data->comments as $comments) { 165 $order->add_order_note(sprintf(__($comments))); 166 } 167 } 168 169 $order->save(); 170 171 $calculate_tax_args = array( 172 'country' => $this->customer_data['shipping_country'], 173 'state' => $this->customer_data['shipping_state'], 174 'postcode' => $this->customer_data['postcode'], 175 'city' => $this->customer_data['city'], 176 ); 177 178 // Save order items first. 179 if (function_exists('wc_save_order_items')) 180 wc_save_order_items( $order->get_id(), $order->get_items() ); 181 182 // Grab the order and recalculate taxes. 183 $order = wc_get_order( $order->get_id() ); 184 $order->calculate_taxes( $calculate_tax_args ); 185 $order->calculate_totals( false ); 166 186 167 187 if (in_array($methodCode, $offlinePayments)) { … … 219 239 } 220 240 221 /** 222 * @param $data 223 * 224 * @return void 225 * @throws Exception 226 */ 241 /** 242 * @param $data 243 * @param $orderId 244 * @return void 245 */ 246 private function addAdditionalFields($data, $orderId) 247 { 248 if($data->additional){ 249 foreach ($data->additional as $placement => $data) 250 { 251 update_post_meta($orderId, $placement, json_encode($data) ); 252 } 253 } 254 } 255 256 /** 257 * @param $data 258 * @param $customer_data 259 * @return void 260 */ 227 261 private function processDominateData($data) 228 262 { … … 232 266 } elseif ($key === 'create_customer_account' && !$this->customer_data['id']) { 233 267 $customer = new Iwd_Connector_Customer(); 234 268 235 269 $customer->setData($this->customer_data); 236 270 $customer->assignCustomerToOrder(); 237 271 238 272 $this->customer_data['id'] = $customer->getId(); 239 273 } -
iwd-checkout-connector/trunk/includes/model/cart/class-iwd-con-cart.php
r2946120 r3020868 16 16 17 17 return [ 18 'version' => esc_html(IWD_CONNECTOR_VERSION) ?? null, 18 19 'is_virtual' =>$this->getIsVirtual($session_data), 19 20 'currency' => get_woocommerce_currency(), -
iwd-checkout-connector/trunk/includes/model/customer/class-iwd-con-customer.php
r2946120 r3020868 100 100 WC()->customer = new WC_Customer( $customer_id, true ); 101 101 WC()->customer->set_billing_email( $addresses->email ); 102 WC()->customer->set_address_2( $addresses->ship_bill_to_different_address );103 102 104 103 $this->setBilling( $addresses->billing ); -
iwd-checkout-connector/trunk/includes/model/session/class-iwd-con-cart-session.php
r2540679 r3020868 21 21 ) 22 22 ); 23 24 $this->destroy_session(); 23 25 } 24 26 -
iwd-checkout-connector/trunk/iwd-checkout-connector.php
r2971737 r3020868 5 5 * Description: Checkout Suite Connector 6 6 * Author: Dominate 7 * Version: 1. 1.27 * Version: 1.2.0 8 8 * Author URI: https://www.dominate.co/ 9 9 * WC requires at least: 2.6.0 10 * WC tested up to: 7.8.010 * WC tested up to: 8.4.0 11 11 */ 12 12 … … 30 30 * Define plugin minimums and constants. 31 31 */ 32 define( 'IWD_CONNECTOR_VERSION', '1. 1.2' );32 define( 'IWD_CONNECTOR_VERSION', '1.2.0' ); 33 33 define( 'IWD_CONNECTOR_FILE', __FILE__ ); 34 34 define( 'IWD_CONNECTOR_PATH', plugin_dir_path( __FILE__ ) ); -
iwd-checkout-connector/trunk/public/class-iwd-connector-frontend.php
r2862744 r3020868 54 54 * @return string 55 55 */ 56 public function modify_thank_you_details( $thank_you_title, $order ){ 56 public function modify_thank_you_details( $thank_you_title ){ 57 global $wp; 58 57 59 $html = '<p>'.$thank_you_title.'</p>'; 60 $order = wc_get_order($wp->query_vars['order-received']); 58 61 59 if ($order ->get_payment_method_title() === 'PayPal - Pay Upon Invoice') {62 if ($order && $order->get_payment_method_title() === 'PayPal - Pay Upon Invoice') { 60 63 $html .= '<p><b>'.__('Important', 'woocommerce').'</b>: '; 61 64 $html .= __('Please review the payment instructions that have been sent to your email.', 'woocommerce').'</p>'; -
iwd-checkout-connector/trunk/public/templates/iwd-checkout-saas.php
r2971737 r3020868 1 <input type="email" name="billing_email" id="billing_email" style="display: none"> 1 <form class="woocommerce-checkout" style="display: none"> 2 <input type="email" name="billing_email" id="billing_email" style="display: none"> 3 </form> 2 4 3 5 <iframe id="iwdCheckoutFrame" -
iwd-checkout-connector/trunk/readme.txt
r2946120 r3020868 1 === Dominate Checkout Suite (Saas) ===1 === Dominate Checkout (SaaS) === 2 2 Author URI: https://www.dominate.co/ 3 3 Plugin URI: https://www.dominate.co/woocommerce … … 6 6 Requires at least: 5.0 7 7 Requires PHP: 7.0 8 Tested up to: 6. 2.28 Tested up to: 6.4.2 9 9 Stable tag: 2.0.14 10 10 WC requires at least: 3.6.0 11 WC tested up to: 7.8.011 WC tested up to: 8.4.0 12 12 License: GPLv3 13 13 License URI: http://www.gnu.org/licenses/gpl-3.0.html
Note: See TracChangeset
for help on using the changeset viewer.