__ __ __ __ _____ _ _ _____ _ _ _ | \/ | \ \ / / | __ \ (_) | | / ____| | | | | | \ / |_ __\ V / | |__) | __ ___ ____ _| |_ ___ | (___ | |__ ___| | | | |\/| | '__|> < | ___/ '__| \ \ / / _` | __/ _ \ \___ \| '_ \ / _ \ | | | | | | |_ / . \ | | | | | |\ V / (_| | || __/ ____) | | | | __/ | | |_| |_|_(_)_/ \_\ |_| |_| |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1 if you need WebShell for Seo everyday contact me on Telegram Telegram Address : @jackleetFor_More_Tools:
<?php
namespace Automattic\WooCommerce\StoreApi\Schemas\V1;
/**
* OrderFeeSchema class.
*/
class OrderFeeSchema extends AbstractSchema {
/**
* The schema item name.
*
* @var string
*/
protected $title = 'order_fee';
/**
* The schema item identifier.
*
* @var string
*/
const IDENTIFIER = 'order-fee';
/**
* Cart schema properties.
*
* @return array
*/
public function get_properties() {
return [
'id' => [
'description' => __( 'Unique identifier for the fee within the cart', 'woocommerce' ),
'type' => 'string',
'context' => [ 'view', 'edit' ],
'readonly' => true,
],
'name' => [
'description' => __( 'Fee name', 'woocommerce' ),
'type' => 'string',
'context' => [ 'view', 'edit' ],
'readonly' => true,
],
'totals' => [
'description' => __( 'Fee total amounts provided using the smallest unit of the currency.', 'woocommerce' ),
'type' => 'object',
'context' => [ 'view', 'edit' ],
'readonly' => true,
'properties' => array_merge(
$this->get_store_currency_properties(),
[
'total' => [
'description' => __( 'Total amount for this fee.', 'woocommerce' ),
'type' => 'string',
'context' => [ 'view', 'edit' ],
'readonly' => true,
],
'total_tax' => [
'description' => __( 'Total tax amount for this fee.', 'woocommerce' ),
'type' => 'string',
'context' => [ 'view', 'edit' ],
'readonly' => true,
],
]
),
],
];
}
/**
* Convert a WooCommerce cart fee to an object suitable for the response.
*
* @param \WC_Order_Item_Fee $fee Order fee object.
* @return array
*/
public function get_item_response( $fee ) {
if ( ! $fee ) {
return [];
}
return [
'key' => $fee->get_id(),
'name' => $this->prepare_html_response( $fee->get_name() ),
'totals' => (object) $this->prepare_currency_response(
[
'total' => $this->prepare_money_response( $fee->get_total(), wc_get_price_decimals() ),
'total_tax' => $this->prepare_money_response( $fee->get_total_tax(), wc_get_price_decimals(), PHP_ROUND_HALF_DOWN ),
]
),
];
}
}
| Name | Type | Size | Permission | Actions |
|---|---|---|---|---|
| AI | Folder | 0775 |
|
|
| Agentic | Folder | 0775 |
|
|
| AbstractAddressSchema.php | File | 10.58 KB | 0664 |
|
| AbstractSchema.php | File | 12.83 KB | 0664 |
|
| BatchSchema.php | File | 427 B | 0664 |
|
| BillingAddressSchema.php | File | 4.46 KB | 0664 |
|
| CartCouponSchema.php | File | 2.98 KB | 0664 |
|
| CartExtensionsSchema.php | File | 2.21 KB | 0664 |
|
| CartFeeSchema.php | File | 2.12 KB | 0664 |
|
| CartItemSchema.php | File | 7.55 KB | 0664 |
|
| CartSchema.php | File | 15.82 KB | 0664 |
|
| CartShippingRateSchema.php | File | 11.37 KB | 0664 |
|
| CheckoutOrderSchema.php | File | 752 B | 0664 |
|
| CheckoutSchema.php | File | 15.05 KB | 0664 |
|
| ErrorSchema.php | File | 1.12 KB | 0664 |
|
| ImageAttachmentSchema.php | File | 2.55 KB | 0664 |
|
| ItemSchema.php | File | 11.27 KB | 0664 |
|
| OrderCouponSchema.php | File | 2.41 KB | 0664 |
|
| OrderFeeSchema.php | File | 2.2 KB | 0664 |
|
| OrderItemSchema.php | File | 2.79 KB | 0664 |
|
| OrderSchema.php | File | 12.74 KB | 0664 |
|
| PatternsSchema.php | File | 673 B | 0664 |
|
| ProductAttributeSchema.php | File | 2.5 KB | 0664 |
|
| ProductBrandSchema.php | File | 3.49 KB | 0664 |
|
| ProductCategorySchema.php | File | 3.5 KB | 0664 |
|
| ProductCollectionDataSchema.php | File | 4.95 KB | 0664 |
|
| ProductReviewSchema.php | File | 6.12 KB | 0664 |
|
| ProductSchema.php | File | 32.79 KB | 0664 |
|
| ShippingAddressSchema.php | File | 2.84 KB | 0664 |
|
| TermSchema.php | File | 2.15 KB | 0664 |
|