Changeset 2712648
- Timestamp:
- 04/21/2022 08:56:33 AM (4 years ago)
- File:
-
- 1 edited
-
afterinc-app/trunk/Custom_app.php (modified) (16 diffs)
Legend:
- Unmodified
- Added
- Removed
-
afterinc-app/trunk/Custom_app.php
r2710133 r2712648 246 246 veriant_id int(20) NOT NULL, 247 247 priceCurrency varchar(255) NOT NULL, 248 planname varchar(255) NOT NULL, 248 249 priceCategory varchar(255) NOT NULL, 249 250 termsAndConditionsURL varchar(255) NOT NULL, … … 712 713 $veriant_id = 1; 713 714 $priceCurrency=$warranty_plan->priceCurrency; 714 //$planName=$warranty_plan->name;715 $planName=$warranty_plan->name; 715 716 $priceCategory=$warranty_plan->priceCategory; 716 717 $termsAndConditionsURL=$warranty_plan->termsAndConditionsURL; … … 741 742 742 743 $results = $this->wpdb->query($this->wpdb->prepare("INSERT INTO product_warranty 743 ( product_id, veriant_id, priceCurrency, p riceCategory, termsAndConditionsURL, learnMoreURL, plans )744 VALUES ( %d, %d, %s, %s, %s, %s, %s )", $product_id, $veriant_id, $priceCurrency, $priceCategory, $termsAndConditionsURL, $learnMoreURL, $plans));744 ( product_id, veriant_id, priceCurrency, planname, priceCategory, termsAndConditionsURL, learnMoreURL, plans ) 745 VALUES ( %d, %d, %s, %s, %s, %s, %s, %s )", $product_id, $veriant_id, $priceCurrency, $planName, $priceCategory, $termsAndConditionsURL, $learnMoreURL, $plans)); 745 746 746 747 $warrantyId = $this->wpdb->insert_id; … … 752 753 }else{ 753 754 754 $results = $this->wpdb->query( $this->wpdb->prepare( "UPDATE product_warranty SET product_id = %d, veriant_id = %d, priceCurrency = %s, p riceCategory = %s, termsAndConditionsURL = %s, learnMoreURL = %s, plans = %s WHERE product_id = %d", 3, $priceCurrency, $priceCategory, $termsAndConditionsURL, $learnMoreURL, $plans ,$product_id));755 $results = $this->wpdb->query( $this->wpdb->prepare( "UPDATE product_warranty SET product_id = %d, veriant_id = %d, priceCurrency = %s, planname = %s, priceCategory = %s, termsAndConditionsURL = %s, learnMoreURL = %s, plans = %s WHERE product_id = %d", 3, $priceCurrency, $planName, $priceCategory, $termsAndConditionsURL, $learnMoreURL, $plans ,$product_id)); 755 756 756 757 } … … 795 796 <span class="close1">×</span> 796 797 <div><h3>After plan key benefits include:</h3> 797 <ul><li>Your After plan documents will be delivered to you rvia email only to the address associated with your order.</li><li>Fast, easy service including parts and labor, with no deductible for covered failures.</li>798 <ul><li>Your After plan documents will be delivered to you via email only to the address associated with your order.</li><li>Fast, easy service including parts and labor, with no deductible for covered failures.</li> 798 799 <li>Nationwide network of service providers.</li> 799 800 <li>Power surge protection.</li> … … 807 808 <div class="parent-warranty-class"> 808 809 <span class="sortOptions"> 809 <p class="planheading"> After Plans</p>810 <p class="planheading"><?php echo esc_attr($result[0]->planname); ?> </p> 810 811 <input type="radio" id="war_0" name="warranty" class="price-variation warranty-button" warranty-price="0" plan-id='none' product-id="<?php echo esc_attr($product->get_id()); ?>" value="none/0" checked> 811 812 <label for="age_0" class="label-text">None</label><br> … … 1353 1354 if(array_key_exists('warranty', $cart_item)) 1354 1355 { 1355 //echo "<pre>"; print_r($cart_item); die; 1356 // echo "<pre>"; print_r($cart_item); die; 1357 1358 $planname = $this->wpdb->get_results( $this->wpdb->prepare("SELECT * FROM product_warranty")); 1359 1360 $pname = $planname[0]->planname; 1361 1356 1362 $plan_id = $cart_item['warranty']; 1357 1363 $term = $cart_item['term']; … … 1359 1365 if($plan_id == "none") { 1360 1366 $item_data[] = array( 1361 'key' => 'After Plan',1367 'key' => $pname, 1362 1368 'value' => "None" 1363 1369 ); … … 1365 1371 1366 1372 $item_data[] = array( 1367 'key' => 'After Plan',1373 'key' => $pname, 1368 1374 'value' => $term." Months" 1369 1375 ); … … 1632 1638 //contract cancel from customer end. 1633 1639 function woocommerce_order_item_name( $name, $item ){ 1640 1641 $planname = $this->wpdb->get_results( $this->wpdb->prepare("SELECT * FROM product_warranty")); 1642 $pnamecustomer = $planname[0]->planname; 1634 1643 1635 1644 $customUrl = esc_url_raw($_SERVER['REQUEST_URI']); … … 1656 1665 $refundamt = number_format((float)$refundamtqty, 2, '.', ''); 1657 1666 1658 $cancelButton = "<button class='btn' data-orderId=".$productOrderId." data-lineItemID =".$lineItemId." disabled=true style='cursor: not-allowed; pointer-events: none; color: #a7aaad; padding: 5px 10px; font-size: 13px; border: 1px solid #dcdcde; background: #f6f7f7; font-family: sans-serif;'> Cancel After Plan</button>";1667 $cancelButton = "<button class='btn' data-orderId=".$productOrderId." data-lineItemID =".$lineItemId." disabled=true style='cursor: not-allowed; pointer-events: none; color: #a7aaad; padding: 5px 10px; font-size: 13px; border: 1px solid #dcdcde; background: #f6f7f7; font-family: sans-serif;'> Cancel ".$pnamecustomer." </button>"; 1659 1668 1660 1669 if (($isOrderreceived !== false) && ($isOrderreceived > 0)) { … … 1669 1678 1670 1679 $refundtxt = "Cancel Request outside the cancel period,Please contract Administrator"; 1671 $cancelButton = "<button class='btn' data-orderId=".$productOrderId." data-lineItemID =".$lineItemId." disabled=true style='cursor: not-allowed; pointer-events: none; color: #a7aaad; padding: 5px 10px; font-size: 13px; border: 1px solid #dcdcde; background: #f6f7f7; font-family: sans-serif;'> Cancel After Plan</button>";1680 $cancelButton = "<button class='btn' data-orderId=".$productOrderId." data-lineItemID =".$lineItemId." disabled=true style='cursor: not-allowed; pointer-events: none; color: #a7aaad; padding: 5px 10px; font-size: 13px; border: 1px solid #dcdcde; background: #f6f7f7; font-family: sans-serif;'> Cancel ".$pnamecustomer." </button>"; 1672 1681 1673 1682 if (($isOrderreceived !== false) && ($isOrderreceived > 0)) { … … 1687 1696 1688 1697 if (in_array($productOrderId, $order_id)){ 1689 $cancelButton = "<button class='cancelContract' id=".$item_quantity." style='display: block; padding: 5px 10px; font-size: 13px; border: none; background: #009688; font-family: sans-serif; float: right; margin-right: 320px' data-orderId=".$productOrderId." data-lineItemID=".$lineItemId." data-cancelby='customer'> Cancel After Plans</button>";1698 $cancelButton = "<button class='cancelContract' id=".$item_quantity." style='display: block; padding: 5px 10px; font-size: 13px; border: none; background: #009688; font-family: sans-serif; float: right; margin-right: 320px' data-orderId=".$productOrderId." data-lineItemID=".$lineItemId." data-cancelby='customer'> Cancel ".$pnamecustomer."</button>"; 1690 1699 1691 1700 if (($isOrderreceived !== false) && ($isOrderreceived > 0)) { … … 1822 1831 /*add button order details page in admin side and cancel order functionality */ 1823 1832 function woocommerce_before_order_itemmeta($item_id, $item, $product){ 1833 1834 $planname = $this->wpdb->get_results( $this->wpdb->prepare("SELECT * FROM product_warranty")); 1835 $pnameadmin = $planname[0]->planname; 1836 1824 1837 $productOrderId = $item['order_id']; 1825 1838 $order = wc_get_order( $productOrderId ); … … 1849 1862 $refundamtqty = $results[0]->refund_amount * $item['quantity']; 1850 1863 $refundamt = number_format((float)$refundamtqty, 2, '.', ''); 1851 echo '<p><button type="button" class="btn button-primary" data-orderId="'.esc_attr($productOrderId).'" data-lineItemID ="'.esc_attr($lineItemId).'" disabled=true style="cursor: not-allowed;">Cancelled After Plan</button></p><b>Cancel By : '.esc_attr($results[0]->contract_canceled_by).'<b> <br>Contract has been cancelled successfully,We have initiated <b>Refund:'. ' $'.esc_attr($refundamt);1864 echo '<p><button type="button" class="btn button-primary" data-orderId="'.esc_attr($productOrderId).'" data-lineItemID ="'.esc_attr($lineItemId).'" disabled=true style="cursor: not-allowed;">Cancelled '.esc_attr($pnameadmin).'</button></p><b>Cancel By : '.esc_attr($results[0]->contract_canceled_by).'<b> <br>Contract has been cancelled successfully,We have initiated <b>Refund:'. ' $'.esc_attr($refundamt); 1852 1865 }else if(isset($results[0]->contract_status) && $results[0]->contract_status == '250' && $results[0]->refund_amount !=''){ 1853 echo '<p><button type="button" class="btn button-primary" data-orderId="'.esc_attr($productOrderId).'" data-lineItemID ="'.esc_attr($lineItemId).'" disabled=true style="cursor: not-allowed;">Cancelled After Plan</button></p><b><br>Cancel Request outside the cancel period,Please contract Administrator';1866 echo '<p><button type="button" class="btn button-primary" data-orderId="'.esc_attr($productOrderId).'" data-lineItemID ="'.esc_attr($lineItemId).'" disabled=true style="cursor: not-allowed;">Cancelled '.esc_attr($pnameadmin).'</button></p><b><br>Cancel Request outside the cancel period,Please contract Administrator'; 1854 1867 } 1855 1868 … … 1862 1875 } 1863 1876 if (in_array($productOrderId, $order_id)){ 1864 echo '<p><button type="button" class="btn button-primary cancelContract" style ="background: #009688; color: white;" data-orderId="'.esc_attr($productOrderId).'" data-lineItemID ="'.esc_attr($lineItemId).'" id ="'.esc_attr($item_quantity).'" data-cancelby=admin> Cancel After plan<img src='.esc_url(content_url()).'/plugins/afterinc/assets/images/Chasing_arrows.gif id="loaderImg" alt="loader" height="40" width="" style="display: none;"></button></p>';1877 echo '<p><button type="button" class="btn button-primary cancelContract" style ="background: #009688; color: white;" data-orderId="'.esc_attr($productOrderId).'" data-lineItemID ="'.esc_attr($lineItemId).'" id ="'.esc_attr($item_quantity).'" data-cancelby=admin> Cancel '.esc_attr($pnameadmin).' <img src='.esc_url(content_url()).'/plugins/afterinc/assets/images/Chasing_arrows.gif id="loaderImg" alt="loader" height="40" width="" style="display: none;"></button></p>'; 1865 1878 } 1866 1879 elseif($order_status !=='cancelled'){
Note: See TracChangeset
for help on using the changeset viewer.