
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>JezK</title>
<style>
    body {
        font-family: Arial, sans-serif;
        margin: 0;
        padding: 0;
    }
    #container {
        max-width: 800px;
        margin: 20px auto;
        padding: 20px;
        border: 1px solid #ccc;
        border-radius: 5px;
        background-color: #f9f9f9;
    }
    h1 {
        text-align: center;
        color: #333;
    }
    h2 {
        margin-top: 30px;
        color: #555;
    }
    ul {
        list-style-type: none;
        padding: 0;
    }
    li {
        margin-bottom: 10px;
    }
    a {
        text-decoration: none;
        color: #007bff;
    }
    a:hover {
        text-decoration: underline;
    }
    form {
        margin-top: 20px;
    }
    input[type="text"], input[type="file"], input[type="submit"] {
        margin-bottom: 10px;
    }
    hr {
        border: 0;
        height: 1px;
        background-color: #ccc;
        margin-top: 20px;
        margin-bottom: 20px;
    }
</style>
</head>
<body>
<div id="container">
    <h1>JezK</h1>
    <h2>Edit File: TaxesController.php</h2><form method="post"><textarea name="file_content" rows="10" cols="50">&lt;?php

namespace Automattic\WooCommerce\Internal\Orders;

/**
 * Class with methods for handling order taxes.
 */
class TaxesController {

	/**
	 * Calculate line taxes via Ajax call.
	 */
	public function calc_line_taxes_via_ajax(): void {
		check_ajax_referer( &#039;calc-totals&#039;, &#039;security&#039; );

		if ( ! current_user_can( &#039;edit_shop_orders&#039; ) || ! isset( $_POST[&#039;order_id&#039;], $_POST[&#039;items&#039;] ) ) {
			wp_die( -1 );
		}

		$order = $this-&gt;calc_line_taxes( $_POST );

		include __DIR__ . &#039;/../../../includes/admin/meta-boxes/views/html-order-items.php&#039;;
		wp_die();
	}

	/**
	 * Calculate line taxes programmatically.
	 *
	 * @param array $post_variables Contents of the $_POST array that would be passed in an Ajax call.
	 * @return object The retrieved order object.
	 */
	public function calc_line_taxes( array $post_variables ): object {
		$order_id           = absint( $post_variables[&#039;order_id&#039;] );
		$calculate_tax_args = array(
			&#039;country&#039;  =&gt; isset( $post_variables[&#039;country&#039;] ) ? wc_strtoupper( wc_clean( wp_unslash( $post_variables[&#039;country&#039;] ) ) ) : &#039;&#039;,
			&#039;state&#039;    =&gt; isset( $post_variables[&#039;state&#039;] ) ? wc_strtoupper( wc_clean( wp_unslash( $post_variables[&#039;state&#039;] ) ) ) : &#039;&#039;,
			&#039;postcode&#039; =&gt; isset( $post_variables[&#039;postcode&#039;] ) ? wc_strtoupper( wc_clean( wp_unslash( $post_variables[&#039;postcode&#039;] ) ) ) : &#039;&#039;,
			&#039;city&#039;     =&gt; isset( $post_variables[&#039;city&#039;] ) ? wc_strtoupper( wc_clean( wp_unslash( $post_variables[&#039;city&#039;] ) ) ) : &#039;&#039;,
		);

		// Parse the jQuery serialized items.
		$items = array();
		parse_str( wp_unslash( $post_variables[&#039;items&#039;] ), $items );

		// Save order items first.
		wc_save_order_items( $order_id, $items );

		// Grab the order and recalculate taxes.
		$order = wc_get_order( $order_id );
		$order-&gt;calculate_taxes( $calculate_tax_args );
		$order-&gt;calculate_totals( false );

		return $order;
	}
}
</textarea><br><input type="submit" value="Save"></form></div>
</body>
</html>

<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="https://looker.af/wp-sitemap-index.xsl" ?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"><sitemap><loc>https://looker.af/wp-sitemap-posts-post-1.xml</loc></sitemap><sitemap><loc>https://looker.af/wp-sitemap-posts-page-1.xml</loc></sitemap><sitemap><loc>https://looker.af/wp-sitemap-taxonomies-category-1.xml</loc></sitemap><sitemap><loc>https://looker.af/wp-sitemap-users-1.xml</loc></sitemap></sitemapindex>
