REDROOM
PHP 8.2.31
Path:
Logout
Edit File
Size: 2.85 KB
Close
/home/nshryvcy/taramarriagebureau.com/wp-content/plugins/woocommerce/src/StoreApi/Utilities/LocalPickupUtils.php
Text
Base64
<?php namespace Automattic\WooCommerce\StoreApi\Utilities; /** * Util class for local pickup related functionality, this contains methods that need to be accessed from places besides * the ShippingController, i.e. the OrderController. */ class LocalPickupUtils { /** * Gets the local pickup location settings. * * @param string $context The context for the settings. Defaults to 'view'. */ public static function get_local_pickup_settings( $context = 'view' ) { $pickup_location_settings = get_option( 'woocommerce_pickup_location_settings', [ 'enabled' => 'no', 'title' => __( 'Pickup', 'woocommerce' ), 'cost' => '', 'tax_status' => 'taxable', ] ); if ( empty( $pickup_location_settings['title'] ) ) { $pickup_location_settings['title'] = __( 'Pickup', 'woocommerce' ); } if ( empty( $pickup_location_settings['enabled'] ) ) { $pickup_location_settings['enabled'] = 'no'; } if ( ! isset( $pickup_location_settings['cost'] ) ) { $pickup_location_settings['cost'] = ''; } // Return settings as is if we're editing them. if ( 'edit' === $context ) { return $pickup_location_settings; } // All consumers of this turn it into a bool eventually. Doing it here removes the need for that. $pickup_location_settings['enabled'] = wc_string_to_bool( $pickup_location_settings['enabled'] ); $pickup_location_settings['title'] = wc_clean( $pickup_location_settings['title'] ); return $pickup_location_settings; } /** * Checks if WC Blocks local pickup is enabled. * * @return bool True if local pickup is enabled. */ public static function is_local_pickup_enabled() { // Get option directly to avoid early translation function call. // See https://github.com/woocommerce/woocommerce/pull/47113. $pickup_location_settings = get_option( 'woocommerce_pickup_location_settings', [ 'enabled' => 'no', ] ); if ( empty( $pickup_location_settings['enabled'] ) ) { $pickup_location_settings['enabled'] = 'no'; } return wc_string_to_bool( $pickup_location_settings['enabled'] ); } /** * Gets a list of payment method ids that support the 'local-pickup' feature. * * @return string[] List of payment method ids that support the 'local-pickup' feature. */ public static function get_local_pickup_method_ids() { $all_methods_supporting_local_pickup = array_reduce( WC()->shipping()->get_shipping_methods(), function ( $methods, $method ) { if ( $method->supports( 'local-pickup' ) ) { $methods[] = $method->id; } return $methods; }, array() ); // We use array_values because this will be used in JS, so we don't need the (numerical) keys. return array_values( // This array_unique is necessary because WC()->shipping()->get_shipping_methods() can return duplicates. array_unique( $all_methods_supporting_local_pickup ) ); } }
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 0 × Files: 18
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
ArrayUtils.php
1.49 KB
lrw-r--r--
2026-03-03 06:25:16
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
CartController.php
47.46 KB
lrw-r--r--
2026-03-03 06:25:16
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
CheckoutTrait.php
10.24 KB
lrw-r--r--
2026-03-03 06:25:16
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
DraftOrderTrait.php
1.76 KB
lrw-r--r--
2026-03-03 06:25:16
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
JsonWebToken.php
5.07 KB
lrw-r--r--
2026-03-03 06:25:16
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
LocalPickupUtils.php
2.85 KB
lrw-r--r--
2026-03-03 06:25:16
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
NoticeHandler.php
2.02 KB
lrw-r--r--
2026-03-03 06:25:16
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
OrderAuthorizationTrait.php
3.25 KB
lrw-r--r--
2026-03-03 06:25:16
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
OrderController.php
27.25 KB
lrw-r--r--
2026-03-03 06:25:16
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Pagination.php
2.05 KB
lrw-r--r--
2026-03-03 06:25:16
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
PaymentUtils.php
3.58 KB
lrw-r--r--
2026-03-03 06:25:16
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
ProductItemTrait.php
2.95 KB
lrw-r--r--
2026-03-03 06:25:16
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
ProductQuery.php
18.96 KB
lrw-r--r--
2026-03-03 06:25:16
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
ProductQueryFilters.php
8.01 KB
lrw-r--r--
2026-03-03 06:25:16
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
QuantityLimits.php
9.87 KB
lrw-r--r--
2026-03-03 06:25:16
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
RateLimits.php
6.14 KB
lrw-r--r--
2026-03-03 06:25:16
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
SanitizationUtils.php
794 B
lrw-r--r--
2026-03-03 06:25:16
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
ValidationUtils.php
1.73 KB
lrw-r--r--
2026-03-03 06:25:16
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Zip Selected
If ZipArchive is unavailable, a
.tar
will be created (no compression).