Page 1 of 1

PayPal App Delete Log

Posted: Mon Mar 22, 2021 1:10 pm
by mhsuffolk
In my 1.0.5.0 live shop I can delete the log here.
Capture.JPG
In my test 1.0.8.0 shop there is no delete button.
Capture 2.JPG

Re: PayPal App Delete Log

Posted: Mon Mar 22, 2021 5:59 pm
by 14Steve14
Will be interested in the answer to this as my 1.7.10 has no delete either.

Re: PayPal App Delete Log

Posted: Tue Mar 23, 2021 2:28 pm
by mhsuffolk
I have compared with the old files, try this.
In includes\apps\paypal\admin\content\log.php Find Line 18

Code: Select all

<h1 class="display-4"><?= $OSCOM_PayPal->getDef('heading_log'); ?></h1>
Add after

Code: Select all

  <tr>
    <td><?php echo $OSCOM_PayPal->drawButton($OSCOM_PayPal->getDef('button_dialog_delete'), '#', 'warning', 'data-button="delLogs"'); ?></td>
    <td style="text-align: right;"><?php echo $log_split->display_links($log_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $_GET['page'], 'action=log'); ?></td>
  </tr>
Find.

Code: Select all

  <div class="col text-right mr-2"><?= $log_split->display_links($log_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $_GET['page'], 'action=log'); ?></div>
Add after

Code: Select all

<div id="delLogs-dialog-confirm" title="<?php echo tep_output_string_protected($OSCOM_PayPal->getDef('dialog_delete_title')); ?>">
  <p><span class="ui-icon ui-icon-alert" style="float:left; margin:0 7px 20px 0;"></span><?php echo $OSCOM_PayPal->getDef('dialog_delete_body'); ?></p>
After the last </div> of the file add

Code: Select all

<script>
$(function() {
  $('#delLogs-dialog-confirm').dialog({
    autoOpen: false,
    resizable: false,
    height: 140,
    modal: true,
    buttons: {
      "<?php echo addslashes($OSCOM_PayPal->getDef('button_delete')); ?>": function() {
        window.location = '<?php echo tep_href_link('paypal.php', 'action=log&subaction=deleteAll'); ?>';
      },
      "<?php echo addslashes($OSCOM_PayPal->getDef('button_cancel')); ?>": function() {
        $( this ).dialog('close');
      }
    }
  });

  $('a[data-button="delLogs"]').click(function(e) {
    e.preventDefault();

    $('#delLogs-dialog-confirm').dialog('open');
  });
});
</script>