Changeset 3458299
- Timestamp:
- 02/10/2026 05:37:27 PM (8 weeks ago)
- Location:
- automatic-ffl-for-wc/tags/1.0.14
- Files:
-
- 21 edited
-
assets/js/blocks/ffl-dealer-selection/components/SaveForLaterButtons.js (modified) (1 diff)
-
assets/js/save-for-later.js (modified) (1 diff)
-
automaticffl-for-woocommerce.php (modified) (2 diffs)
-
includes/admin/class-product-ffl-meta.php (modified) (12 diffs)
-
includes/admin/screens/class-general.php (modified) (1 diff)
-
includes/api/class-restrictions-client.php (modified) (6 diffs)
-
includes/blocks/class-store-api-extension.php (modified) (2 diffs)
-
includes/class-plugin.php (modified) (10 diffs)
-
includes/helper/class-cart-analyzer.php (modified) (18 diffs)
-
includes/helper/class-config.php (modified) (6 diffs)
-
includes/helper/class-credentials.php (modified) (3 diffs)
-
includes/helper/class-messages.php (modified) (1 diff)
-
includes/helper/class-saved-cart.php (modified) (14 diffs)
-
includes/helper/class-us-states.php (modified) (4 diffs)
-
includes/views/class-cart.php (modified) (7 diffs)
-
includes/views/class-checkout.php (modified) (6 diffs)
-
includes/views/class-thank-you.php (modified) (2 diffs)
-
templates/checkout/ammo-state-selector-js.php (modified) (1 diff)
-
templates/checkout/ammo-state-selector.php (modified) (1 diff)
-
templates/checkout/ffl-map-js.php (modified) (1 diff)
-
templates/checkout/ffl-map.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
automatic-ffl-for-wc/tags/1.0.14/assets/js/blocks/ffl-dealer-selection/components/SaveForLaterButtons.js
r3458254 r3458299 5 5 * WooCommerce Blocks checkout. 6 6 * 7 * @since 1.0.1 57 * @since 1.0.14 8 8 */ 9 9 -
automatic-ffl-for-wc/tags/1.0.14/assets/js/save-for-later.js
r3458254 r3458299 5 5 * when customers have mixed carts (FFL items + regular items). 6 6 * 7 * @since 1.0.1 57 * @since 1.0.14 8 8 */ 9 9 -
automatic-ffl-for-wc/tags/1.0.14/automaticffl-for-woocommerce.php
r3458254 r3458299 6 6 * Author: Refactored Group 7 7 * Author URI: http://refactored.group 8 * Version: 1.0.1 58 * Version: 1.0.14 9 9 * Tested up to: 6.9 10 10 * WC tested up to: 10.4.3 … … 25 25 defined( 'ABSPATH' ) || exit; 26 26 define( '_AFFL_LOADER_', __FILE__ ); 27 define( 'AFFL_VERSION', '1.0.1 5' );27 define( 'AFFL_VERSION', '1.0.14' ); 28 28 define( 'AFFL_TEMPLATES_PATH', plugin_dir_path( __FILE__ ) . 'templates/' ); 29 29 -
automatic-ffl-for-wc/tags/1.0.14/includes/admin/class-product-ffl-meta.php
r3458254 r3458299 18 18 * - Bulk/Quick edit functionality 19 19 * 20 * @since 1.0.1 520 * @since 1.0.14 21 21 */ 22 22 class Product_FFL_Meta { … … 25 25 * Constructor - registers all hooks. 26 26 * 27 * @since 1.0.1 527 * @since 1.0.14 28 28 */ 29 29 public function __construct() { … … 34 34 * Register all hooks for FFL product meta handling. 35 35 * 36 * @since 1.0.1 536 * @since 1.0.14 37 37 * 38 38 * @return void … … 65 65 * Add FFL Required checkbox to product type options. 66 66 * 67 * @since 1.0.1 567 * @since 1.0.14 68 68 * 69 69 * @param array $product_type_options Existing product type options. … … 86 86 * Save FFL Required meta when product is saved. 87 87 * 88 * @since 1.0.1 588 * @since 1.0.14 89 89 * 90 90 * @param int $id Product ID. … … 100 100 * Add FFL Required column to export columns. 101 101 * 102 * @since 1.0.1 5102 * @since 1.0.14 103 103 * 104 104 * @param array $columns Export columns. … … 113 113 * Get FFL Required data for export. 114 114 * 115 * @since 1.0.1 5115 * @since 1.0.14 116 116 * 117 117 * @param mixed $value Default value. … … 126 126 * Add FFL Required to import mapping options. 127 127 * 128 * @since 1.0.1 5128 * @since 1.0.14 129 129 * 130 130 * @param array $options Import mapping options. … … 139 139 * Add default column mapping for FFL Required import. 140 140 * 141 * @since 1.0.1 5141 * @since 1.0.14 142 142 * 143 143 * @param array $columns Default column mappings. … … 153 153 * Process FFL Required data during import. 154 154 * 155 * @since 1.0.1 5155 * @since 1.0.14 156 156 * 157 157 * @param \WC_Product $object Product object being imported. … … 169 169 * Add FFL Required checkbox to Bulk/Quick Edit. 170 170 * 171 * @since 1.0.1 5171 * @since 1.0.14 172 172 * 173 173 * @return void … … 194 194 * Save FFL Required from Bulk/Quick Edit. 195 195 * 196 * @since 1.0.1 5196 * @since 1.0.14 197 197 * 198 198 * @param \WC_Product $product Product object. -
automatic-ffl-for-wc/tags/1.0.14/includes/admin/screens/class-general.php
r3458254 r3458299 33 33 * Save settings and register credentials with backend. 34 34 * 35 * @since 1.0.1 535 * @since 1.0.14 36 36 */ 37 37 public function save() { -
automatic-ffl-for-wc/tags/1.0.14/includes/api/class-restrictions-client.php
r3458254 r3458299 18 18 * product classifications (firearm, ammo, regular). 19 19 * 20 * @since 1.0.1 520 * @since 1.0.14 21 21 */ 22 22 class Restrictions_Client { … … 71 71 * Fetch restrictions for given product IDs from API. 72 72 * 73 * @since 1.0.1 573 * @since 1.0.14 74 74 * 75 75 * @param array $product_ids Array of product IDs to check. … … 113 113 * Fetch restrictions from the API. 114 114 * 115 * @since 1.0.1 5115 * @since 1.0.14 116 116 * 117 117 * @param array $product_ids Array of product IDs. … … 165 165 * Check if the last API call resulted in an error. 166 166 * 167 * @since 1.0.1 5167 * @since 1.0.14 168 168 * 169 169 * @param array $restrictions The restrictions array to check. … … 177 177 * Build the API URL with product IDs. 178 178 * 179 * @since 1.0.1 5179 * @since 1.0.14 180 180 * 181 181 * @param array $product_ids Array of product IDs. … … 201 201 * Clear cached restrictions for the current request. 202 202 * 203 * @since 1.0.1 5203 * @since 1.0.14 204 204 * 205 205 * @return void -
automatic-ffl-for-wc/tags/1.0.14/includes/blocks/class-store-api-extension.php
r3458254 r3458299 96 96 * Register the save for later REST API route. 97 97 * 98 * @since 1.0.1 598 * @since 1.0.14 99 99 * 100 100 * @return void … … 126 126 * Handle the save for later REST API request. 127 127 * 128 * @since 1.0.1 5128 * @since 1.0.14 129 129 * 130 130 * @param \WP_REST_Request $request Request object. -
automatic-ffl-for-wc/tags/1.0.14/includes/class-plugin.php
r3458254 r3458299 221 221 * and the shipping state requires FFL for ammunition. 222 222 * 223 * @since 1.0.1 5223 * @since 1.0.14 224 224 * 225 225 * @return void … … 271 271 * parameter and restores the saved items. 272 272 * 273 * @since 1.0.1 5273 * @since 1.0.14 274 274 * 275 275 * @return void … … 334 334 * The token stored in order meta allows reliable retrieval on the thank you page. 335 335 * 336 * @since 1.0.1 5336 * @since 1.0.14 337 337 * 338 338 * @param int|\WC_Order $order_or_id Order ID or order object. … … 359 359 * always cleaned up after order completion. 360 360 * 361 * @since 1.0.1 5361 * @since 1.0.14 362 362 * 363 363 * @return void … … 394 394 * the session-backed WC_Customer. 395 395 * 396 * @since 1.0.1 5396 * @since 1.0.14 397 397 * 398 398 * @param int $order_id The order ID. … … 442 442 * to both session and user meta. 443 443 * 444 * @since 1.0.1 5444 * @since 1.0.14 445 445 * 446 446 * @param \WC_Order $order The order object. … … 485 485 * Get shipping address from user meta, or empty strings for guests. 486 486 * 487 * @since 1.0.1 5487 * @since 1.0.14 488 488 * 489 489 * @param int $user_id The user ID (0 for guests). … … 503 503 * Get an empty shipping address array. 504 504 * 505 * @since 1.0.1 5505 * @since 1.0.14 506 506 * 507 507 * @return array Associative array with empty string values. … … 514 514 * Set shipping address properties on a WC_Customer instance. 515 515 * 516 * @since 1.0.1 5516 * @since 1.0.14 517 517 * 518 518 * @param \WC_Customer $customer The customer object. … … 530 530 * Update shipping address in user meta. 531 531 * 532 * @since 1.0.1 5532 * @since 1.0.14 533 533 * 534 534 * @param int $user_id The user ID. -
automatic-ffl-for-wc/tags/1.0.14/includes/helper/class-cart-analyzer.php
r3458254 r3458299 18 18 * product classifications and checkout requirements. 19 19 * 20 * @since 1.0.1 520 * @since 1.0.14 21 21 */ 22 22 class Cart_Analyzer { … … 46 46 * Constructor. 47 47 * 48 * @since 1.0.1 548 * @since 1.0.14 49 49 * 50 50 * @param Restrictions_Client|null $client Optional restrictions client instance. … … 57 57 * Analyze current cart contents using restrictions API. 58 58 * 59 * @since 1.0.1 559 * @since 1.0.14 60 60 * 61 61 * @return array Categorized product data with keys: firearms, ammo, regular, restrictions, api_error. … … 162 162 * Check if the Restrictions API is available. 163 163 * 164 * @since 1.0.1 5164 * @since 1.0.14 165 165 * 166 166 * @return bool True if API is available. … … 178 178 * Check if there was an API error during analysis. 179 179 * 180 * @since 1.0.1 5180 * @since 1.0.14 181 181 * 182 182 * @return bool True if there was an API error. … … 190 190 * Check if cart has any firearms. 191 191 * 192 * @since 1.0.1 5192 * @since 1.0.14 193 193 * 194 194 * @return bool True if cart contains firearms. … … 202 202 * Check if cart has any ammo products. 203 203 * 204 * @since 1.0.1 5204 * @since 1.0.14 205 205 * 206 206 * @return bool True if cart contains ammo. … … 214 214 * Check if cart contains only ammo products (no firearms, no regular). 215 215 * 216 * @since 1.0.1 5216 * @since 1.0.14 217 217 * 218 218 * @return bool True if cart is ammo-only. … … 227 227 * This combination should block checkout. 228 228 * 229 * @since 1.0.1 5229 * @since 1.0.14 230 230 * 231 231 * @return bool True if cart has both FFL and regular products. … … 245 245 * can proceed if shipping to a state that doesn't require FFL for ammo. 246 246 * 247 * @since 1.0.1 5247 * @since 1.0.14 248 248 * 249 249 * @return bool True if cart has ammo + regular but no firearms. … … 262 262 * ship to an FFL dealer and cannot be combined with regular products. 263 263 * 264 * @since 1.0.1 5264 * @since 1.0.14 265 265 * 266 266 * @return bool True if cart has firearms + regular products. … … 275 275 * Check if cart has any FFL products (firearms or ammo). 276 276 * 277 * @since 1.0.1 5277 * @since 1.0.14 278 278 * 279 279 * @return bool True if cart has FFL products. … … 287 287 * Returns the union of all restricted states across all ammo items. 288 288 * 289 * @since 1.0.1 5289 * @since 1.0.14 290 290 * 291 291 * @return array Array of unique state codes where FFL is required for ammo. … … 312 312 * Check if given state requires FFL for current cart's ammo products. 313 313 * 314 * @since 1.0.1 5314 * @since 1.0.14 315 315 * 316 316 * @param string $state_code Two-letter state code (e.g., 'CA', 'NY'). … … 325 325 * Get product IDs by category. 326 326 * 327 * @since 1.0.1 5327 * @since 1.0.14 328 328 * 329 329 * @param string $category Category: 'firearms', 'ammo', or 'regular'. … … 343 343 * Get total quantity of items by category. 344 344 * 345 * @since 1.0.1 5345 * @since 1.0.14 346 346 * 347 347 * @param string $category Category: 'firearms', 'ammo', or 'regular'. … … 361 361 * Clear cached analysis. 362 362 * 363 * @since 1.0.1 5363 * @since 1.0.14 364 364 * 365 365 * @return void … … 373 373 * Get the restrictions client instance. 374 374 * 375 * @since 1.0.1 5375 * @since 1.0.14 376 376 * 377 377 * @return Restrictions_Client -
automatic-ffl-for-wc/tags/1.0.14/includes/helper/class-config.php
r3458254 r3458299 70 70 * Build iframe URL with query parameters. 71 71 * 72 * @since 1.0.1 572 * @since 1.0.14 73 73 * 74 74 * @return string|false Returns URL string on success, false if required data is missing. … … 155 155 * Get the restrictions API URL. 156 156 * 157 * @since 1.0.1 5157 * @since 1.0.14 158 158 * 159 159 * @return string … … 169 169 * so it can fetch product/category data from the WooCommerce REST API. 170 170 * 171 * @since 1.0.1 5171 * @since 1.0.14 172 172 * 173 173 * @return void … … 220 220 * - licsSeq = last part (e.g., "23572") 221 221 * 222 * @since 1.0.1 5222 * @since 1.0.14 223 223 * 224 224 * @param string $ffl_id The FFL license number. … … 244 244 * Build the FFL certificate URL from UUID. 245 245 * 246 * @since 1.0.1 5246 * @since 1.0.14 247 247 * 248 248 * @param string $uuid The FFL UUID. … … 261 261 * Shared between classic and blocks checkout paths. 262 262 * 263 * @since 1.0.1 5263 * @since 1.0.14 264 264 * 265 265 * @param string $ffl_license The FFL license number. -
automatic-ffl-for-wc/tags/1.0.14/includes/helper/class-credentials.php
r3458254 r3458299 17 17 * product and category data from the merchant's WooCommerce store. 18 18 * 19 * @since 1.0.1 519 * @since 1.0.14 20 20 */ 21 21 class Credentials { … … 27 27 * Uses WordPress's built-in Application Passwords (WP 5.6+). 28 28 * 29 * @since 1.0.1 529 * @since 1.0.14 30 30 * 31 31 * @return array|\WP_Error Array with 'username' and 'password' keys, or WP_Error on failure. … … 84 84 * Get an admin user ID suitable for Application Password creation. 85 85 * 86 * @since 1.0.1 586 * @since 1.0.14 87 87 * 88 88 * @return int|null User ID or null if none found. -
automatic-ffl-for-wc/tags/1.0.14/includes/helper/class-messages.php
r3458254 r3458299 7 7 * 8 8 * @package AutomaticFFL 9 * @since 1.0.1 59 * @since 1.0.14 10 10 */ 11 11 -
automatic-ffl-for-wc/tags/1.0.14/includes/helper/class-saved-cart.php
r3458254 r3458299 23 23 * 4. CART: Token from URL used to retrieve and restore items 24 24 * 25 * @since 1.0.1 525 * @since 1.0.14 26 26 */ 27 27 class Saved_Cart { … … 61 61 * Uses a dedicated cookie that persists independently of WC session. 62 62 * 63 * @since 1.0.1 563 * @since 1.0.14 64 64 * 65 65 * @param bool $create Whether to create a new token if one doesn't exist. … … 85 85 * Set the token cookie. 86 86 * 87 * @since 1.0.1 587 * @since 1.0.14 88 88 * 89 89 * @param string $token The token to store. … … 109 109 * Clear the token cookie. 110 110 * 111 * @since 1.0.1 5111 * @since 1.0.14 112 112 * 113 113 * @return void … … 129 129 * Save items of a specific type and remove from cart. 130 130 * 131 * @since 1.0.1 5131 * @since 1.0.14 132 132 * 133 133 * @param string $item_type Type of items to save: 'ffl' or 'regular'. … … 224 224 * Extract custom cart item data (exclude standard keys). 225 225 * 226 * @since 1.0.1 5226 * @since 1.0.14 227 227 * 228 228 * @param array $cart_item Cart item array. … … 261 261 * for later retrieval during checkout. 262 262 * 263 * @since 1.0.1 5263 * @since 1.0.14 264 264 * 265 265 * @param string $token The token to store. … … 278 278 * This makes token retrieval reliable on the thank you page. 279 279 * 280 * @since 1.0.1 5280 * @since 1.0.14 281 281 * 282 282 * @param int $order_id The order ID. … … 311 311 * Used on thank you page to retrieve the token for building the redirect URL. 312 312 * 313 * @since 1.0.1 5313 * @since 1.0.14 314 314 * 315 315 * @param int $order_id The order ID. … … 330 330 * Uses the cookie-based token to check transient storage. 331 331 * 332 * @since 1.0.1 5332 * @since 1.0.14 333 333 * 334 334 * @return bool True if saved items exist. … … 347 347 * Get count of saved items for the current user. 348 348 * 349 * @since 1.0.1 5349 * @since 1.0.14 350 350 * 351 351 * @return int Number of saved items. … … 368 368 * Get saved items using a specific token. 369 369 * 370 * @since 1.0.1 5370 * @since 1.0.14 371 371 * 372 372 * @param string $token The token to use for lookup. … … 390 390 * Adjusts quantities if stock is insufficient. 391 391 * 392 * @since 1.0.1 5392 * @since 1.0.14 393 393 * 394 394 * @param array $saved_data The saved items data with 'items' key. … … 495 495 * Clear saved items using a specific token. 496 496 * 497 * @since 1.0.1 5497 * @since 1.0.14 498 498 * 499 499 * @param string $token The token to use for cleanup. -
automatic-ffl-for-wc/tags/1.0.14/includes/helper/class-us-states.php
r3458254 r3458299 15 15 * Provides a single source of truth for US state codes and names. 16 16 * 17 * @since 1.0.1 517 * @since 1.0.14 18 18 */ 19 19 class US_States { … … 81 81 * Get all US states. 82 82 * 83 * @since 1.0.1 583 * @since 1.0.14 84 84 * 85 85 * @return array Array of state codes => state names. … … 92 92 * Get state name by code. 93 93 * 94 * @since 1.0.1 594 * @since 1.0.14 95 95 * 96 96 * @param string $code Two-letter state code (e.g., 'CA'). … … 104 104 * Check if a state code is valid. 105 105 * 106 * @since 1.0.1 5106 * @since 1.0.14 107 107 * 108 108 * @param string $code Two-letter state code to validate. -
automatic-ffl-for-wc/tags/1.0.14/includes/views/class-cart.php
r3458254 r3458299 25 25 * Get SVG icon markup for notice banners. 26 26 * 27 * @since 1.0.1 527 * @since 1.0.14 28 28 * 29 29 * @param string $type Icon type: 'error', 'success', or 'info'. … … 45 45 * Called on woocommerce_before_cart_table hook. 46 46 * 47 * @since 1.0.1 547 * @since 1.0.14 48 48 * 49 49 * @return void … … 190 190 * Enqueue the save for later script. 191 191 * 192 * @since 1.0.1 5192 * @since 1.0.14 193 193 * 194 194 * @return void … … 222 222 * AJAX handler for saving items for later. 223 223 * 224 * @since 1.0.1 5224 * @since 1.0.14 225 225 * 226 226 * @return void … … 252 252 * Display informational notice for ammo-only carts. 253 253 * 254 * @since 1.0.1 5254 * @since 1.0.14 255 255 * 256 256 * @param Cart_Analyzer $analyzer Cart analyzer instance. … … 281 281 * - Restricted state: checkout blocked (must separate orders) 282 282 * 283 * @since 1.0.1 5283 * @since 1.0.14 284 284 * 285 285 * @param Cart_Analyzer $analyzer Cart analyzer instance. … … 404 404 * AJAX handler for setting ammo state in session. 405 405 * 406 * @since 1.0.1 5406 * @since 1.0.14 407 407 * 408 408 * @return void -
automatic-ffl-for-wc/tags/1.0.14/includes/views/class-checkout.php
r3458254 r3458299 32 32 * Get shared Cart_Analyzer instance (avoids duplicate API calls per request). 33 33 * 34 * @since 1.0.1 534 * @since 1.0.14 35 35 * 36 36 * @return Cart_Analyzer … … 49 49 * replacing the old Config::is_ffl_cart() which only checked post meta. 50 50 * 51 * @since 1.0.1 551 * @since 1.0.14 52 52 * 53 53 * @return bool True if FFL fields should be added to checkout. … … 300 300 * Allows customer to proceed with normal checkout. 301 301 * 302 * @since 1.0.1 5302 * @since 1.0.14 303 303 * 304 304 * @return void … … 392 392 * Display ammo-only checkout with state selector. 393 393 * 394 * @since 1.0.1 5394 * @since 1.0.14 395 395 * 396 396 * @param Cart_Analyzer $analyzer Cart analyzer instance. … … 425 425 * - Restricted state: Hide shipping fields, show FFL dealer selection 426 426 * 427 * @since 1.0.1 5427 * @since 1.0.14 428 428 * 429 429 * @param array $restricted_states Array of state codes where FFL is required. … … 447 447 * Hooked to woocommerce_checkout_before_customer_details (classic only). 448 448 * 449 * @since 1.0.1 5449 * @since 1.0.14 450 450 * 451 451 * @return void -
automatic-ffl-for-wc/tags/1.0.14/includes/views/class-thank-you.php
r3458254 r3458299 18 18 * that need to be restored after checkout. 19 19 * 20 * @since 1.0.1 520 * @since 1.0.14 21 21 */ 22 22 class Thank_You { … … 27 27 * Called on woocommerce_before_thankyou hook (top of page). 28 28 * 29 * @since 1.0.1 529 * @since 1.0.14 30 30 * 31 31 * @param int $order_id Order ID. -
automatic-ffl-for-wc/tags/1.0.14/templates/checkout/ammo-state-selector-js.php
r3458254 r3458299 7 7 * 8 8 * @package AutomaticFFL 9 * @since 1.0.1 59 * @since 1.0.14 10 10 * 11 11 * Available variables: -
automatic-ffl-for-wc/tags/1.0.14/templates/checkout/ammo-state-selector.php
r3458254 r3458299 8 8 * 9 9 * @package AutomaticFFL 10 * @since 1.0.1 510 * @since 1.0.14 11 11 * 12 12 * Available variables: -
automatic-ffl-for-wc/tags/1.0.14/templates/checkout/ffl-map-js.php
r3458254 r3458299 6 6 * 7 7 * @package AutomaticFFL 8 * @since 1.0.1 58 * @since 1.0.14 9 9 * 10 10 * Available variables: -
automatic-ffl-for-wc/tags/1.0.14/templates/checkout/ffl-map.php
r3458254 r3458299 6 6 * 7 7 * @package AutomaticFFL 8 * @since 1.0.1 58 * @since 1.0.14 9 9 * 10 10 * Available variables:
Note: See TracChangeset
for help on using the changeset viewer.