Plugin Directory

Changeset 3458299


Ignore:
Timestamp:
02/10/2026 05:37:27 PM (8 weeks ago)
Author:
refactoredgroup
Message:

Ammo Feature, Map, Save For Later Feature For Mixed Carts, Block-Based Checkout Compatibility, FFL Certificates In Orders, eZcheck Link In Orders, Improvements

Location:
automatic-ffl-for-wc/tags/1.0.14
Files:
21 edited

Legend:

Unmodified
Added
Removed
  • automatic-ffl-for-wc/tags/1.0.14/assets/js/blocks/ffl-dealer-selection/components/SaveForLaterButtons.js

    r3458254 r3458299  
    55 * WooCommerce Blocks checkout.
    66 *
    7  * @since 1.0.15
     7 * @since 1.0.14
    88 */
    99
  • automatic-ffl-for-wc/tags/1.0.14/assets/js/save-for-later.js

    r3458254 r3458299  
    55 * when customers have mixed carts (FFL items + regular items).
    66 *
    7  * @since 1.0.15
     7 * @since 1.0.14
    88 */
    99
  • automatic-ffl-for-wc/tags/1.0.14/automaticffl-for-woocommerce.php

    r3458254 r3458299  
    66 * Author: Refactored Group
    77 * Author URI: http://refactored.group
    8  * Version: 1.0.15
     8 * Version: 1.0.14
    99 * Tested up to: 6.9
    1010 * WC tested up to: 10.4.3
     
    2525defined( 'ABSPATH' ) || exit;
    2626define( '_AFFL_LOADER_', __FILE__ );
    27 define( 'AFFL_VERSION', '1.0.15' );
     27define( 'AFFL_VERSION', '1.0.14' );
    2828define( 'AFFL_TEMPLATES_PATH', plugin_dir_path( __FILE__ ) . 'templates/' );
    2929
  • automatic-ffl-for-wc/tags/1.0.14/includes/admin/class-product-ffl-meta.php

    r3458254 r3458299  
    1818 * - Bulk/Quick edit functionality
    1919 *
    20  * @since 1.0.15
     20 * @since 1.0.14
    2121 */
    2222class Product_FFL_Meta {
     
    2525     * Constructor - registers all hooks.
    2626     *
    27      * @since 1.0.15
     27     * @since 1.0.14
    2828     */
    2929    public function __construct() {
     
    3434     * Register all hooks for FFL product meta handling.
    3535     *
    36      * @since 1.0.15
     36     * @since 1.0.14
    3737     *
    3838     * @return void
     
    6565     * Add FFL Required checkbox to product type options.
    6666     *
    67      * @since 1.0.15
     67     * @since 1.0.14
    6868     *
    6969     * @param array $product_type_options Existing product type options.
     
    8686     * Save FFL Required meta when product is saved.
    8787     *
    88      * @since 1.0.15
     88     * @since 1.0.14
    8989     *
    9090     * @param int $id Product ID.
     
    100100     * Add FFL Required column to export columns.
    101101     *
    102      * @since 1.0.15
     102     * @since 1.0.14
    103103     *
    104104     * @param array $columns Export columns.
     
    113113     * Get FFL Required data for export.
    114114     *
    115      * @since 1.0.15
     115     * @since 1.0.14
    116116     *
    117117     * @param mixed       $value   Default value.
     
    126126     * Add FFL Required to import mapping options.
    127127     *
    128      * @since 1.0.15
     128     * @since 1.0.14
    129129     *
    130130     * @param array $options Import mapping options.
     
    139139     * Add default column mapping for FFL Required import.
    140140     *
    141      * @since 1.0.15
     141     * @since 1.0.14
    142142     *
    143143     * @param array $columns Default column mappings.
     
    153153     * Process FFL Required data during import.
    154154     *
    155      * @since 1.0.15
     155     * @since 1.0.14
    156156     *
    157157     * @param \WC_Product $object Product object being imported.
     
    169169     * Add FFL Required checkbox to Bulk/Quick Edit.
    170170     *
    171      * @since 1.0.15
     171     * @since 1.0.14
    172172     *
    173173     * @return void
     
    194194     * Save FFL Required from Bulk/Quick Edit.
    195195     *
    196      * @since 1.0.15
     196     * @since 1.0.14
    197197     *
    198198     * @param \WC_Product $product Product object.
  • automatic-ffl-for-wc/tags/1.0.14/includes/admin/screens/class-general.php

    r3458254 r3458299  
    3333     * Save settings and register credentials with backend.
    3434     *
    35      * @since 1.0.15
     35     * @since 1.0.14
    3636     */
    3737    public function save() {
  • automatic-ffl-for-wc/tags/1.0.14/includes/api/class-restrictions-client.php

    r3458254 r3458299  
    1818 * product classifications (firearm, ammo, regular).
    1919 *
    20  * @since 1.0.15
     20 * @since 1.0.14
    2121 */
    2222class Restrictions_Client {
     
    7171     * Fetch restrictions for given product IDs from API.
    7272     *
    73      * @since 1.0.15
     73     * @since 1.0.14
    7474     *
    7575     * @param array $product_ids Array of product IDs to check.
     
    113113     * Fetch restrictions from the API.
    114114     *
    115      * @since 1.0.15
     115     * @since 1.0.14
    116116     *
    117117     * @param array $product_ids Array of product IDs.
     
    165165     * Check if the last API call resulted in an error.
    166166     *
    167      * @since 1.0.15
     167     * @since 1.0.14
    168168     *
    169169     * @param array $restrictions The restrictions array to check.
     
    177177     * Build the API URL with product IDs.
    178178     *
    179      * @since 1.0.15
     179     * @since 1.0.14
    180180     *
    181181     * @param array $product_ids Array of product IDs.
     
    201201     * Clear cached restrictions for the current request.
    202202     *
    203      * @since 1.0.15
     203     * @since 1.0.14
    204204     *
    205205     * @return void
  • automatic-ffl-for-wc/tags/1.0.14/includes/blocks/class-store-api-extension.php

    r3458254 r3458299  
    9696     * Register the save for later REST API route.
    9797     *
    98      * @since 1.0.15
     98     * @since 1.0.14
    9999     *
    100100     * @return void
     
    126126     * Handle the save for later REST API request.
    127127     *
    128      * @since 1.0.15
     128     * @since 1.0.14
    129129     *
    130130     * @param \WP_REST_Request $request Request object.
  • automatic-ffl-for-wc/tags/1.0.14/includes/class-plugin.php

    r3458254 r3458299  
    221221     * and the shipping state requires FFL for ammunition.
    222222     *
    223      * @since 1.0.15
     223     * @since 1.0.14
    224224     *
    225225     * @return void
     
    271271     * parameter and restores the saved items.
    272272     *
    273      * @since 1.0.15
     273     * @since 1.0.14
    274274     *
    275275     * @return void
     
    334334     * The token stored in order meta allows reliable retrieval on the thank you page.
    335335     *
    336      * @since 1.0.15
     336     * @since 1.0.14
    337337     *
    338338     * @param int|\WC_Order $order_or_id Order ID or order object.
     
    359359     * always cleaned up after order completion.
    360360     *
    361      * @since 1.0.15
     361     * @since 1.0.14
    362362     *
    363363     * @return void
     
    394394     * the session-backed WC_Customer.
    395395     *
    396      * @since 1.0.15
     396     * @since 1.0.14
    397397     *
    398398     * @param int $order_id The order ID.
     
    442442     * to both session and user meta.
    443443     *
    444      * @since 1.0.15
     444     * @since 1.0.14
    445445     *
    446446     * @param \WC_Order $order The order object.
     
    485485     * Get shipping address from user meta, or empty strings for guests.
    486486     *
    487      * @since 1.0.15
     487     * @since 1.0.14
    488488     *
    489489     * @param int $user_id The user ID (0 for guests).
     
    503503     * Get an empty shipping address array.
    504504     *
    505      * @since 1.0.15
     505     * @since 1.0.14
    506506     *
    507507     * @return array Associative array with empty string values.
     
    514514     * Set shipping address properties on a WC_Customer instance.
    515515     *
    516      * @since 1.0.15
     516     * @since 1.0.14
    517517     *
    518518     * @param \WC_Customer $customer The customer object.
     
    530530     * Update shipping address in user meta.
    531531     *
    532      * @since 1.0.15
     532     * @since 1.0.14
    533533     *
    534534     * @param int   $user_id The user ID.
  • automatic-ffl-for-wc/tags/1.0.14/includes/helper/class-cart-analyzer.php

    r3458254 r3458299  
    1818 * product classifications and checkout requirements.
    1919 *
    20  * @since 1.0.15
     20 * @since 1.0.14
    2121 */
    2222class Cart_Analyzer {
     
    4646     * Constructor.
    4747     *
    48      * @since 1.0.15
     48     * @since 1.0.14
    4949     *
    5050     * @param Restrictions_Client|null $client Optional restrictions client instance.
     
    5757     * Analyze current cart contents using restrictions API.
    5858     *
    59      * @since 1.0.15
     59     * @since 1.0.14
    6060     *
    6161     * @return array Categorized product data with keys: firearms, ammo, regular, restrictions, api_error.
     
    162162     * Check if the Restrictions API is available.
    163163     *
    164      * @since 1.0.15
     164     * @since 1.0.14
    165165     *
    166166     * @return bool True if API is available.
     
    178178     * Check if there was an API error during analysis.
    179179     *
    180      * @since 1.0.15
     180     * @since 1.0.14
    181181     *
    182182     * @return bool True if there was an API error.
     
    190190     * Check if cart has any firearms.
    191191     *
    192      * @since 1.0.15
     192     * @since 1.0.14
    193193     *
    194194     * @return bool True if cart contains firearms.
     
    202202     * Check if cart has any ammo products.
    203203     *
    204      * @since 1.0.15
     204     * @since 1.0.14
    205205     *
    206206     * @return bool True if cart contains ammo.
     
    214214     * Check if cart contains only ammo products (no firearms, no regular).
    215215     *
    216      * @since 1.0.15
     216     * @since 1.0.14
    217217     *
    218218     * @return bool True if cart is ammo-only.
     
    227227     * This combination should block checkout.
    228228     *
    229      * @since 1.0.15
     229     * @since 1.0.14
    230230     *
    231231     * @return bool True if cart has both FFL and regular products.
     
    245245     * can proceed if shipping to a state that doesn't require FFL for ammo.
    246246     *
    247      * @since 1.0.15
     247     * @since 1.0.14
    248248     *
    249249     * @return bool True if cart has ammo + regular but no firearms.
     
    262262     * ship to an FFL dealer and cannot be combined with regular products.
    263263     *
    264      * @since 1.0.15
     264     * @since 1.0.14
    265265     *
    266266     * @return bool True if cart has firearms + regular products.
     
    275275     * Check if cart has any FFL products (firearms or ammo).
    276276     *
    277      * @since 1.0.15
     277     * @since 1.0.14
    278278     *
    279279     * @return bool True if cart has FFL products.
     
    287287     * Returns the union of all restricted states across all ammo items.
    288288     *
    289      * @since 1.0.15
     289     * @since 1.0.14
    290290     *
    291291     * @return array Array of unique state codes where FFL is required for ammo.
     
    312312     * Check if given state requires FFL for current cart's ammo products.
    313313     *
    314      * @since 1.0.15
     314     * @since 1.0.14
    315315     *
    316316     * @param string $state_code Two-letter state code (e.g., 'CA', 'NY').
     
    325325     * Get product IDs by category.
    326326     *
    327      * @since 1.0.15
     327     * @since 1.0.14
    328328     *
    329329     * @param string $category Category: 'firearms', 'ammo', or 'regular'.
     
    343343     * Get total quantity of items by category.
    344344     *
    345      * @since 1.0.15
     345     * @since 1.0.14
    346346     *
    347347     * @param string $category Category: 'firearms', 'ammo', or 'regular'.
     
    361361     * Clear cached analysis.
    362362     *
    363      * @since 1.0.15
     363     * @since 1.0.14
    364364     *
    365365     * @return void
     
    373373     * Get the restrictions client instance.
    374374     *
    375      * @since 1.0.15
     375     * @since 1.0.14
    376376     *
    377377     * @return Restrictions_Client
  • automatic-ffl-for-wc/tags/1.0.14/includes/helper/class-config.php

    r3458254 r3458299  
    7070     * Build iframe URL with query parameters.
    7171     *
    72      * @since 1.0.15
     72     * @since 1.0.14
    7373     *
    7474     * @return string|false Returns URL string on success, false if required data is missing.
     
    155155     * Get the restrictions API URL.
    156156     *
    157      * @since 1.0.15
     157     * @since 1.0.14
    158158     *
    159159     * @return string
     
    169169     * so it can fetch product/category data from the WooCommerce REST API.
    170170     *
    171      * @since 1.0.15
     171     * @since 1.0.14
    172172     *
    173173     * @return void
     
    220220     * - licsSeq = last part (e.g., "23572")
    221221     *
    222      * @since 1.0.15
     222     * @since 1.0.14
    223223     *
    224224     * @param string $ffl_id The FFL license number.
     
    244244     * Build the FFL certificate URL from UUID.
    245245     *
    246      * @since 1.0.15
     246     * @since 1.0.14
    247247     *
    248248     * @param string $uuid The FFL UUID.
     
    261261     * Shared between classic and blocks checkout paths.
    262262     *
    263      * @since 1.0.15
     263     * @since 1.0.14
    264264     *
    265265     * @param string $ffl_license     The FFL license number.
  • automatic-ffl-for-wc/tags/1.0.14/includes/helper/class-credentials.php

    r3458254 r3458299  
    1717 * product and category data from the merchant's WooCommerce store.
    1818 *
    19  * @since 1.0.15
     19 * @since 1.0.14
    2020 */
    2121class Credentials {
     
    2727     * Uses WordPress's built-in Application Passwords (WP 5.6+).
    2828     *
    29      * @since 1.0.15
     29     * @since 1.0.14
    3030     *
    3131     * @return array|\WP_Error Array with 'username' and 'password' keys, or WP_Error on failure.
     
    8484     * Get an admin user ID suitable for Application Password creation.
    8585     *
    86      * @since 1.0.15
     86     * @since 1.0.14
    8787     *
    8888     * @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  
    77 *
    88 * @package AutomaticFFL
    9  * @since 1.0.15
     9 * @since 1.0.14
    1010 */
    1111
  • automatic-ffl-for-wc/tags/1.0.14/includes/helper/class-saved-cart.php

    r3458254 r3458299  
    2323 * 4. CART: Token from URL used to retrieve and restore items
    2424 *
    25  * @since 1.0.15
     25 * @since 1.0.14
    2626 */
    2727class Saved_Cart {
     
    6161     * Uses a dedicated cookie that persists independently of WC session.
    6262     *
    63      * @since 1.0.15
     63     * @since 1.0.14
    6464     *
    6565     * @param bool $create Whether to create a new token if one doesn't exist.
     
    8585     * Set the token cookie.
    8686     *
    87      * @since 1.0.15
     87     * @since 1.0.14
    8888     *
    8989     * @param string $token The token to store.
     
    109109     * Clear the token cookie.
    110110     *
    111      * @since 1.0.15
     111     * @since 1.0.14
    112112     *
    113113     * @return void
     
    129129     * Save items of a specific type and remove from cart.
    130130     *
    131      * @since 1.0.15
     131     * @since 1.0.14
    132132     *
    133133     * @param string $item_type Type of items to save: 'ffl' or 'regular'.
     
    224224     * Extract custom cart item data (exclude standard keys).
    225225     *
    226      * @since 1.0.15
     226     * @since 1.0.14
    227227     *
    228228     * @param array $cart_item Cart item array.
     
    261261     * for later retrieval during checkout.
    262262     *
    263      * @since 1.0.15
     263     * @since 1.0.14
    264264     *
    265265     * @param string $token The token to store.
     
    278278     * This makes token retrieval reliable on the thank you page.
    279279     *
    280      * @since 1.0.15
     280     * @since 1.0.14
    281281     *
    282282     * @param int $order_id The order ID.
     
    311311     * Used on thank you page to retrieve the token for building the redirect URL.
    312312     *
    313      * @since 1.0.15
     313     * @since 1.0.14
    314314     *
    315315     * @param int $order_id The order ID.
     
    330330     * Uses the cookie-based token to check transient storage.
    331331     *
    332      * @since 1.0.15
     332     * @since 1.0.14
    333333     *
    334334     * @return bool True if saved items exist.
     
    347347     * Get count of saved items for the current user.
    348348     *
    349      * @since 1.0.15
     349     * @since 1.0.14
    350350     *
    351351     * @return int Number of saved items.
     
    368368     * Get saved items using a specific token.
    369369     *
    370      * @since 1.0.15
     370     * @since 1.0.14
    371371     *
    372372     * @param string $token The token to use for lookup.
     
    390390     * Adjusts quantities if stock is insufficient.
    391391     *
    392      * @since 1.0.15
     392     * @since 1.0.14
    393393     *
    394394     * @param array $saved_data The saved items data with 'items' key.
     
    495495     * Clear saved items using a specific token.
    496496     *
    497      * @since 1.0.15
     497     * @since 1.0.14
    498498     *
    499499     * @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  
    1515 * Provides a single source of truth for US state codes and names.
    1616 *
    17  * @since 1.0.15
     17 * @since 1.0.14
    1818 */
    1919class US_States {
     
    8181     * Get all US states.
    8282     *
    83      * @since 1.0.15
     83     * @since 1.0.14
    8484     *
    8585     * @return array Array of state codes => state names.
     
    9292     * Get state name by code.
    9393     *
    94      * @since 1.0.15
     94     * @since 1.0.14
    9595     *
    9696     * @param string $code Two-letter state code (e.g., 'CA').
     
    104104     * Check if a state code is valid.
    105105     *
    106      * @since 1.0.15
     106     * @since 1.0.14
    107107     *
    108108     * @param string $code Two-letter state code to validate.
  • automatic-ffl-for-wc/tags/1.0.14/includes/views/class-cart.php

    r3458254 r3458299  
    2525     * Get SVG icon markup for notice banners.
    2626     *
    27      * @since 1.0.15
     27     * @since 1.0.14
    2828     *
    2929     * @param string $type Icon type: 'error', 'success', or 'info'.
     
    4545     * Called on woocommerce_before_cart_table hook.
    4646     *
    47      * @since 1.0.15
     47     * @since 1.0.14
    4848     *
    4949     * @return void
     
    190190     * Enqueue the save for later script.
    191191     *
    192      * @since 1.0.15
     192     * @since 1.0.14
    193193     *
    194194     * @return void
     
    222222     * AJAX handler for saving items for later.
    223223     *
    224      * @since 1.0.15
     224     * @since 1.0.14
    225225     *
    226226     * @return void
     
    252252     * Display informational notice for ammo-only carts.
    253253     *
    254      * @since 1.0.15
     254     * @since 1.0.14
    255255     *
    256256     * @param Cart_Analyzer $analyzer Cart analyzer instance.
     
    281281     * - Restricted state: checkout blocked (must separate orders)
    282282     *
    283      * @since 1.0.15
     283     * @since 1.0.14
    284284     *
    285285     * @param Cart_Analyzer $analyzer Cart analyzer instance.
     
    404404     * AJAX handler for setting ammo state in session.
    405405     *
    406      * @since 1.0.15
     406     * @since 1.0.14
    407407     *
    408408     * @return void
  • automatic-ffl-for-wc/tags/1.0.14/includes/views/class-checkout.php

    r3458254 r3458299  
    3232     * Get shared Cart_Analyzer instance (avoids duplicate API calls per request).
    3333     *
    34      * @since 1.0.15
     34     * @since 1.0.14
    3535     *
    3636     * @return Cart_Analyzer
     
    4949     * replacing the old Config::is_ffl_cart() which only checked post meta.
    5050     *
    51      * @since 1.0.15
     51     * @since 1.0.14
    5252     *
    5353     * @return bool True if FFL fields should be added to checkout.
     
    300300     * Allows customer to proceed with normal checkout.
    301301     *
    302      * @since 1.0.15
     302     * @since 1.0.14
    303303     *
    304304     * @return void
     
    392392     * Display ammo-only checkout with state selector.
    393393     *
    394      * @since 1.0.15
     394     * @since 1.0.14
    395395     *
    396396     * @param Cart_Analyzer $analyzer Cart analyzer instance.
     
    425425     * - Restricted state: Hide shipping fields, show FFL dealer selection
    426426     *
    427      * @since 1.0.15
     427     * @since 1.0.14
    428428     *
    429429     * @param array $restricted_states Array of state codes where FFL is required.
     
    447447     * Hooked to woocommerce_checkout_before_customer_details (classic only).
    448448     *
    449      * @since 1.0.15
     449     * @since 1.0.14
    450450     *
    451451     * @return void
  • automatic-ffl-for-wc/tags/1.0.14/includes/views/class-thank-you.php

    r3458254 r3458299  
    1818 * that need to be restored after checkout.
    1919 *
    20  * @since 1.0.15
     20 * @since 1.0.14
    2121 */
    2222class Thank_You {
     
    2727     * Called on woocommerce_before_thankyou hook (top of page).
    2828     *
    29      * @since 1.0.15
     29     * @since 1.0.14
    3030     *
    3131     * @param int $order_id Order ID.
  • automatic-ffl-for-wc/tags/1.0.14/templates/checkout/ammo-state-selector-js.php

    r3458254 r3458299  
    77 *
    88 * @package AutomaticFFL
    9  * @since 1.0.15
     9 * @since 1.0.14
    1010 *
    1111 * Available variables:
  • automatic-ffl-for-wc/tags/1.0.14/templates/checkout/ammo-state-selector.php

    r3458254 r3458299  
    88 *
    99 * @package AutomaticFFL
    10  * @since 1.0.15
     10 * @since 1.0.14
    1111 *
    1212 * Available variables:
  • automatic-ffl-for-wc/tags/1.0.14/templates/checkout/ffl-map-js.php

    r3458254 r3458299  
    66 *
    77 * @package AutomaticFFL
    8  * @since 1.0.15
     8 * @since 1.0.14
    99 *
    1010 * Available variables:
  • automatic-ffl-for-wc/tags/1.0.14/templates/checkout/ffl-map.php

    r3458254 r3458299  
    66 *
    77 * @package AutomaticFFL
    8  * @since 1.0.15
     8 * @since 1.0.14
    99 *
    1010 * Available variables:
Note: See TracChangeset for help on using the changeset viewer.