templates/web/customer/layout/footer/powered_by.twig line 1

Open in your IDE?
  1. {##
  2.  # Powered by box
  3.  #}
  4. {# Modification of this template or removal of the "Powered by X-Cart" label are forbidden for X-Cart Free Edition. #}
  5. <div class="powered-by">
  6.   <p class="copyright">&copy; {{ this.getCompanyYear() }} {{ this.get('config').Company.company_name }}. {{ t('All rights reserved.') }}</p>
  7.   <p class="powered-by-label">{{ this.getMessage()|raw }}</p>
  8. </div>
  9. <div class="modal fade" id="jobModal" tabindex="-1" role="dialog" aria-labelledby="jobModalLabel" aria-hidden="true" >
  10.   <div class="modal-dialog modal-dialog-centered" role="document">
  11.     <div class="modal-content">
  12.       <div class="modal-header">
  13.         <h5 class="modal-title" id="exampleModalLabel">New project list</h5>
  14.         <button type="button" class="close" data-dismiss="modal" aria-label="Close">
  15.           <span aria-hidden="true">&times;</span>
  16.         </button>
  17.       </div>
  18.       <div class="modal-body">
  19.       <form id="addform">
  20.        <div class="form-group">
  21.     <label for="exampleInputEmail1">Project list name</label>
  22.     <input type="text" class="form-control" id="project_list_name" name="project_list_name" aria-describedby="emailHelp" placeholder="Enter List name">
  23.     <input type="hidden" class="form-control" id="project_id" name="project_id">
  24.     <div class="text-danger" id='project_list_name-err'></div>
  25.     <small id="emailHelp" class="form-text text-muted">The name must contain at least 1 character and at most 60 characters
  26.     </small>
  27.     </form>
  28.   </div>
  29.       </div>
  30.       <div class="modal-footer">
  31.         <button type="button" class="btn btn-primary" id="addjoblist">Create Job List</button>
  32.       </div>
  33.     </div>
  34.   </div>
  35. </div>
  36. <div class="modal fade" id="jobModal1" tabindex="-1" role="dialog" aria-labelledby="jobModalLabel" aria-hidden="true" >
  37.   <div class="modal-dialog modal-dialog-centered" role="document">
  38.     <div class="modal-content">
  39.       <div class="modal-header">
  40.         <h5 class="modal-title" id="exampleModalLabel">Add item to a product list</h5>
  41.         <button type="button" class="close" data-dismiss="modal" aria-label="Close">
  42.           <span aria-hidden="true">&times;</span>
  43.         </button>
  44.       </div>
  45.       <div class="modal-body">
  46.       <form id="addform1">
  47.        <div class="row">
  48.        <div class='col-md-9'>
  49.         <input type='hidden' id="product_id" name="product_id" />
  50.         <input type='hidden' id="quantity" name="quantity" />
  51.        <label for="exampleInputEmail1">Project list name</label>
  52.     <input type="text" class="form-control" id="project_list_name" name="project_list_name" aria-describedby="emailHelp" placeholder="Enter List name">
  53.      <div class="text-danger" id='project_list_name-err'></div>
  54.     <small id="emailHelp" class="form-text text-muted">The name must contain at least 1 character and at most 60 characters
  55.     </small>
  56.        </div>
  57.      <div class='col-md-3'>
  58.       <label for="exampleInputEmail1"></label>
  59.      <button type="button" class="btn btn-primary" id="addjoblists1">Create Job List</button>
  60.       </div>
  61.       </div>
  62.     </form>
  63.    
  64.     <div id="loadcontent"></div>
  65.         </div>
  66.       </div>
  67.      
  68.     </div>
  69.   </div>
  70.   {# <div class="modal fade" id="jobModal2" tabindex="-1" role="dialog" aria-labelledby="jobModalLabel" aria-hidden="true" >
  71.   <div class="modal-dialog modal-dialog-centered" role="document">
  72.     <div class="modal-content">
  73.       <div class="modal-header">
  74.         <h5 class="modal-title" id="exampleModalLabel">Add item to a product list</h5>
  75.         <button type="button" class="close" data-dismiss="modal" aria-label="Close">
  76.           <span aria-hidden="true">&times;</span>
  77.         </button>
  78.       </div>
  79.       <div class="modal-body">
  80.       <form id="addform2">
  81.        <div class="row">
  82.        <div class='col-md-9'>
  83.        <label for="exampleInputEmail1">Project list name</label>
  84.     <input type="text" class="form-control" id="project_list_name" name="project_list_name" aria-describedby="emailHelp" placeholder="Enter List name">
  85.      <div class="text-danger" id='project_list_name-err'></div>
  86.     <small id="emailHelp" class="form-text text-muted">The name must contain at least 1 character and at most 60 characters
  87.     </small>
  88.        </div>
  89.      <div class='col-md-3'>
  90.       <label for="exampleInputEmail1"></label>
  91.      <button type="button" class="btn btn-primary" id="addjoblist2">Create Job List</button>
  92.       </div>
  93.       </div>
  94.     </form>
  95.     <input type='hidden' id="product_id" name="product_id" />
  96.     <div id="loadcontent2"></div>
  97.         </div>
  98.       </div>
  99.      
  100.     </div>
  101.   </div> #}
  102.   <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.1/jquery.min.js"></script>
  103. <script>
  104. $(document).ready(function(){
  105.  //$("#addjob").attr("class","add-product-to-joblist");
  106.     $('.add-to-wishlist').removeClass('add-to-wishlist').addClass('add-product-to-joblists');
  107. })
  108.     $(document).on("click","#addjob",function() {
  109.       $("#quantity").val(1);
  110.      var $this = jQuery(this);
  111.     if($this.hasClass('must-be-logged-in')){
  112.    jQuery('a.log-in').first().click();
  113.     }else{
  114.         var productid = $(this).data("productid");
  115.         var quantity = $(this).closest('.buttons-row').find(".quantity").val();
  116.         loaddata(productid); 
  117.         $("#jobModal1").modal("show")
  118.         $(".modal-backdrop").modal("hide")
  119.           $("#product_id").val(productid);
  120.           $("#quantity").val(quantity);
  121.     }
  122.     
  123.     })
  124. $(document).on("click",".add-product-to-joblist",function() {
  125.       $("#quantity").val(1);
  126.      var $this = jQuery(this);
  127.     if($this.hasClass('must-be-logged-in')){
  128.    jQuery('a.log-in').first().click();
  129.     }else{
  130.         var productid = $(this).data("productid");
  131.         var quantity = $(this).closest('.buttons-container').find(".qty-in-cart").val();
  132.         loaddata(productid); 
  133.         $("#jobModal1").modal("show")
  134.         $(".modal-backdrop").modal("hide")
  135.           $("#product_id").val(productid);
  136.           $("#quantity").val(quantity);
  137.     }
  138.     
  139.     })
  140.     
  141.     $(document).on("click","#addjoblists1",function(event) {
  142.       event.preventDefault();
  143.       console.log("1");
  144.       if($("#addform1 #project_list_name").val() == ""){
  145.  $("#addform1 #project_list_name-err").text("Project list name is required!")
  146.  return true;
  147.       }else if($("#addform1 #project_list_name").val().length > 60){
  148.         $("#addform1 #project_list_name-err").text("Project list name is maximum 60 character!")
  149.         }else{
  150. $("#addform1 #project_list_name-err").text("")
  151.  var formdata = new FormData();
  152.   var productid = $("#addform1 #product_id").val();
  153.   var quantity = $("#addform1 #quantity").val();
  154.  formdata.append("project_list_name",$("#addform1 #project_list_name").val())
  155.  formdata.append("product_id",productid)
  156.  formdata.append("quantity",quantity)
  157.     $.ajax({
  158.     type: 'POST',
  159.     url: '?target=job_list&action=add',
  160.     processData:false,
  161.     contentType:false,
  162.     dataType:'json',
  163.     data: formdata,
  164.     success: function(response) {
  165.       if(response.success){
  166.          $("#addform1 #project_list_name").val("")
  167.       loaddata(productid);
  168.       }else{
  169.         $("#addform1 #project_list_name-err").text(response.message)
  170.       }
  171.         console.log(response)
  172.     },
  173.     error: function(xhr, status, error) {
  174.         console.log(error)
  175.     }
  176. });
  177.       }
  178.      
  179.     })
  180.     
  181.     function loaddata(productid){
  182.     var formdata2 = new FormData();
  183.  formdata2.append("product_id",productid);
  184.     $("#loadcontent").html("")
  185.     $.ajax({
  186.     type: 'POST',
  187.      processData:false,
  188.     contentType:false,
  189.     dataType:'json',
  190.     data: formdata2,
  191.     url: '?target=job_list&action=list',
  192.     success: function(response) {
  193.       if(response.success){
  194.       for(let x=0; x<response.datas.length;x++){
  195.       if(response.datas[x].exists == "yes"){
  196.       var button=`<a href="javascript:void(0)" class="btn btn-primary" style='background-color:#16704a' ><i class='fa fa-check-circle'></i> Product Added</a>`;
  197.       }else{
  198.       var button=`<a href="javascript:void(0)" class="btn btn-primary addproducttojoblists" data-id="${response.datas[x].id}">Add Product</a>`;
  199.       }
  200.       
  201.         $("#loadcontent").append(`<div class="row mb-3" style="margin-bottom:20px">
  202. <div class="card " >
  203. <svg xmlns="http://www.w3.org/2000/svg" width="100" height="50" viewBox="0 0 40 40"><path d="M0 24h36a4 4 0 0 1 4 4v12H4a4 4 0 0 1-4-4V24z" fill="#DEDEDE" fill-rule="evenodd" style="fill: rgb(56, 191, 199);"></path>
  204.     <path d="M28 9v28H4V9h24zm-1.333 1.333H5.333v25.334h21.334V10.333zm8-9.333v36h-8V10.373l-.69-.04H5.333v-2a2 2 0 0 1 2-2h7.334V1h20zM18 27.667a2 2 0 0 1 1.99 1.807l.01.193V37h-8v-7.333a2 2 0 0 1 1.807-1.991l.193-.01h4zM33.333 2.333H16V6.21l8.689.095.19.011a2 2 0 0 1 1.788 1.989V9h2a2 2 0 0 1 1.99 1.807l.01.193v2.667a2 2 0 0 1-1.808 1.99l-.192.01H28v2.666h.667a2 2 0 0 1 1.99 1.808l.01.192V23a2 2 0 0 1-1.808 1.99l-.192.01H28v2.667h.667a2 2 0 0 1 1.99 1.807l.01.193v2.666a2 2 0 0 1-1.808 1.991l-.192.01H28v1.333h5.333V2.333zM18 29h-4c-.327 0-.6.236-.656.547l-.01.12v6h5.333v-6c0-.287-.18-.53-.434-.625l-.113-.031L18 29zm10.667 0H28v4h.667c.327 0 .6-.236.656-.547l.01-.12v-2.666c0-.328-.236-.6-.546-.656l-.12-.011zm-16-8a2 2 0 0 1 1.99 1.807l.01.193v1.333a2 2 0 0 1-1.808 1.991l-.192.01h-1.334a2 2 0 0 1-1.99-1.808l-.01-.193V23a2 2 0 0 1 1.808-1.99l.192-.01h1.334zm8 0a2 2 0 0 1 1.99 1.807l.01.193v1.333a2 2 0 0 1-1.808 1.991l-.192.01h-1.334a2 2 0 0 1-1.99-1.808l-.01-.193V23a2 2 0 0 1 1.808-1.99l.192-.01h1.334zm-8 1.333h-1.334c-.327 0-.6.236-.656.547l-.01.12v1.333c0 .328.236.6.546.656l.12.011h1.334c.327 0 .6-.236.656-.547l.01-.12V23c0-.327-.236-.6-.546-.656l-.12-.01zm8 0h-1.334c-.327 0-.6.236-.656.547l-.01.12v1.333c0 .328.236.6.546.656l.12.011h1.334c.327 0 .6-.236.656-.547l.01-.12V23c0-.327-.236-.6-.546-.656l-.12-.01zm8-2.666H28v4h.667c.327 0 .6-.236.656-.547l.01-.12v-2.667c0-.327-.236-.6-.546-.656l-.12-.01zm-16-5.334a2 2 0 0 1 1.99 1.808l.01.192v1.334a2 2 0 0 1-1.808 1.99l-.192.01h-1.334a2 2 0 0 1-1.99-1.808l-.01-.192v-1.334a2 2 0 0 1 1.808-1.99l.192-.01h1.334zm8 0a2 2 0 0 1 1.99 1.808l.01.192v1.334a2 2 0 0 1-1.808 1.99l-.192.01h-1.334a2 2 0 0 1-1.99-1.808l-.01-.192v-1.334a2 2 0 0 1 1.808-1.99l.192-.01h1.334zm-8 1.334h-1.334c-.327 0-.6.236-.656.546l-.01.12v1.334c0 .327.236.6.546.656l.12.01h1.334c.327 0 .6-.236.656-.546l.01-.12v-1.334c0-.327-.236-.6-.546-.656l-.12-.01zm8 0h-1.334c-.327 0-.6.236-.656.546l-.01.12v1.334c0 .327.236.6.546.656l.12.01h1.334c.327 0 .6-.236.656-.546l.01-.12v-1.334c0-.327-.236-.6-.546-.656l-.12-.01zm8-5.334H28v4h.667c.327 0 .6-.236.656-.546l.01-.12V11c0-.327-.236-.6-.546-.656l-.12-.01zm-4-2.666H7.333l-.12.01a.667.667 0 0 0-.546.656V9h18.666v-.667a.667.667 0 0 0-.666-.666z" fill="#303545" fill-rule="nonzero"></path>
  205. </svg>
  206.     <div class="card-body">
  207.     <h3 class="card-title">${response.datas[x].project_name}</h3>
  208.     ${button}
  209.        
  210.   </div>
  211. </div>
  212. </div>`)
  213. }
  214.       
  215.       }
  216.         console.log(response)
  217.     },
  218.     error: function(xhr, status, error) {
  219.         console.log(error)
  220.     }
  221. });
  222.     }
  223.     $(document).on("click",".addproducttojoblists",function(){
  224.     var button = $(this)
  225.     var id = $(this).data("id");
  226.      var productid = $("#product_id").val();
  227.    var quantity = $("#addform1 #quantity").val();
  228.      var formdata = new FormData();
  229.  formdata.append("job_list_id",id)
  230.  formdata.append("product_id",productid)
  231.  formdata.append("quantity",quantity)
  232.     $.ajax({
  233.     type: 'POST',
  234.     url: '?target=job_list&action=AddProduct',
  235.     processData:false,
  236.     contentType:false,
  237.     dataType:'json',
  238.     data: formdata,
  239.     success: function(response) {
  240.       if(response.success){
  241.         button.css("background-color","#16704a").html("<i class='fa fa-check-circle'></i> Product Added")
  242.       }else{
  243.        button.css("background-color","#16704a").html("<i class='fa fa-check-circle'></i> Product Already Added")
  244.       }
  245.        button.removeClass('addproducttojoblists').addClass('');
  246.     },
  247.     error: function(xhr, status, error) {
  248.         console.log(error)
  249.     }
  250. });
  251.      
  252.     
  253.     })
  254.     $(document).ready(function(){
  255.     var jobList = $(".job_list");
  256.     var makeAnOffer = $(".make-an-offer");
  257.     jobList.insertBefore(makeAnOffer);
  258. });
  259. </script>