Plugin Directory

Changeset 2712648


Ignore:
Timestamp:
04/21/2022 08:56:33 AM (4 years ago)
Author:
aftercommerce
Message:

update dynamic plan name

File:
1 edited

Legend:

Unmodified
Added
Removed
  • afterinc-app/trunk/Custom_app.php

    r2710133 r2712648  
    246246        veriant_id int(20) NOT NULL,
    247247        priceCurrency varchar(255) NOT NULL,
     248        planname varchar(255) NOT NULL,
    248249        priceCategory varchar(255) NOT NULL,
    249250        termsAndConditionsURL varchar(255) NOT NULL,
     
    712713      $veriant_id = 1;
    713714      $priceCurrency=$warranty_plan->priceCurrency;
    714       // $planName=$warranty_plan->name;
     715      $planName=$warranty_plan->name;
    715716      $priceCategory=$warranty_plan->priceCategory;
    716717      $termsAndConditionsURL=$warranty_plan->termsAndConditionsURL;
     
    741742       
    742743         $results = $this->wpdb->query($this->wpdb->prepare("INSERT INTO product_warranty
    743          ( product_id, veriant_id, priceCurrency, priceCategory, 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));
    745746
    746747          $warrantyId = $this->wpdb->insert_id;
     
    752753      }else{
    753754
    754       $results = $this->wpdb->query( $this->wpdb->prepare( "UPDATE product_warranty SET product_id = %d, veriant_id = %d, priceCurrency = %s, priceCategory = %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));
    755756
    756757      }
     
    795796   <span class="close1">&times;</span>
    796797   <div><h3>After plan key benefits include:</h3>
    797   <ul><li>Your After plan documents will be delivered to your 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  <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>
    798799  <li>Nationwide network of service providers.</li>
    799800  <li>Power surge protection.</li>
     
    807808    <div class="parent-warranty-class">
    808809      <span class="sortOptions"> 
    809       <p class="planheading">After Plans</p>
     810      <p class="planheading"><?php echo esc_attr($result[0]->planname); ?> </p>
    810811      <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>
    811812      <label for="age_0" class="label-text">None</label><br>
     
    13531354    if(array_key_exists('warranty', $cart_item))
    13541355    {
    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
    13561362      $plan_id = $cart_item['warranty'];
    13571363      $term = $cart_item['term'];
     
    13591365      if($plan_id == "none") {
    13601366          $item_data[] = array(
    1361               'key'   => 'After Plan',
     1367              'key'   => $pname,
    13621368              'value' => "None"
    13631369          );
     
    13651371
    13661372        $item_data[] = array(
    1367             'key'   => 'After Plan',
     1373            'key'   => $pname,
    13681374            'value' => $term." Months"
    13691375        );
     
    16321638   //contract cancel from customer end.
    16331639  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;
    16341643 
    16351644  $customUrl = esc_url_raw($_SERVER['REQUEST_URI']);
     
    16561665   $refundamt = number_format((float)$refundamtqty, 2, '.', '');
    16571666
    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>";
    16591668
    16601669     if (($isOrderreceived !== false) && ($isOrderreceived > 0)) {
     
    16691678
    16701679   $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>";
    16721681
    16731682      if (($isOrderreceived !== false) && ($isOrderreceived > 0)) {
     
    16871696   
    16881697   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>";
    16901699
    16911700     if (($isOrderreceived !== false) && ($isOrderreceived > 0)) {
     
    18221831   /*add button order details page in admin side and cancel order functionality */
    18231832function 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
    18241837    $productOrderId = $item['order_id'];
    18251838    $order = wc_get_order( $productOrderId );
     
    18491862      $refundamtqty = $results[0]->refund_amount * $item['quantity'];
    18501863      $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);
    18521865     }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';
    18541867       }
    18551868   
     
    18621875     }
    18631876    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>';
    18651878        }
    18661879        elseif($order_status !=='cancelled'){
Note: See TracChangeset for help on using the changeset viewer.