admin->get_data_byid( $location_id ); // New location flow (id=0): build an empty stdClass so isset() checks below don't blow up. if ( ! is_object( $location ) ) { $location = new stdClass(); } $cancel_url = admin_url( 'admin.php?page=local_pickup&tab=locations' ); $store_name = isset( $location->store_name ) ? stripslashes( $location->store_name ) : ''; // Address subtitle. $address_subtitle = ''; $country_setting = isset( $location->store_country ) ? $location->store_country : get_option( 'woocommerce_default_country' ); if ( strstr( $country_setting, ':' ) ) { $country_setting = explode( ':', $country_setting ); $country = current( $country_setting ); $state = end( $country_setting ); } else { $country = $country_setting; $state = ''; } if ( ! empty( $location->store_address ) ) { $address_subtitle .= esc_html( $location->store_address ); } if ( ! empty( $location->store_address_2 ) ) { $address_subtitle .= ', ' . esc_html( $location->store_address_2 ); } if ( ! empty( $location->store_city ) ) { $address_subtitle .= ', ' . esc_html( $location->store_city ); } if ( ! empty( $location->store_postcode ) ) { $address_subtitle .= ' - ' . esc_html( $location->store_postcode ); } if ( $country && ! empty( $location->store_name ) && isset( WC()->countries->countries[ $country ] ) ) { $address_subtitle .= ', ' . esc_html( WC()->countries->countries[ $country ] ) . '.'; } // PRO-locked sections to render below the editable ones. // This is the strongest settings-page upgrade surface (AST's top converter is // the equivalent), so it uses the canonical utm_content=plugin-setting. $alp_upgrade_url = alp_pro_upgrade_url( 'plugin-setting' ); $alp_pro_sections = array( array( 'title' => esc_html__( 'Pickup Appointments', 'advanced-local-pickup-for-woocommerce' ), 'sub' => esc_html__( 'Configure reservable customer booking time slots.', 'advanced-local-pickup-for-woocommerce' ), 'desc' => esc_html__( 'Let customers book a specific pickup time slot when placing the order. Configure days, intervals, and capacity per slot.', 'advanced-local-pickup-for-woocommerce' ), ), array( 'title' => esc_html__( 'Products', 'advanced-local-pickup-for-woocommerce' ), 'sub' => esc_html__( 'Restrict this pickup location to specific products or categories.', 'advanced-local-pickup-for-woocommerce' ), 'desc' => esc_html__( 'Make this location available only for selected products, categories, or exclude specific items entirely.', 'advanced-local-pickup-for-woocommerce' ), ), array( 'title' => esc_html__( 'Shipping Method', 'advanced-local-pickup-for-woocommerce' ), 'sub' => esc_html__( 'Excluded shipping methods for this location.', 'advanced-local-pickup-for-woocommerce' ), 'desc' => esc_html__( 'Configure which WooCommerce shipping methods should be hidden when this pickup location is selected.', 'advanced-local-pickup-for-woocommerce' ), ), array( 'title' => esc_html__( 'Payment Method', 'advanced-local-pickup-for-woocommerce' ), 'sub' => esc_html__( 'Excluded payment gateways at checkout.', 'advanced-local-pickup-for-woocommerce' ), 'desc' => esc_html__( 'Restrict which payment gateways are available when customers choose this pickup location.', 'advanced-local-pickup-for-woocommerce' ), ), array( 'title' => esc_html__( 'Price Adjustments', 'advanced-local-pickup-for-woocommerce' ), 'sub' => esc_html__( 'No markup or discounts on free tier.', 'advanced-local-pickup-for-woocommerce' ), 'desc' => esc_html__( 'Apply a percentage or flat discount, or a pickup fee, when this location is chosen.', 'advanced-local-pickup-for-woocommerce' ), ), array( 'title' => esc_html__( 'Notifications', 'advanced-local-pickup-for-woocommerce' ), 'sub' => esc_html__( 'Notify additional recipients about this location.', 'advanced-local-pickup-for-woocommerce' ), 'desc' => esc_html__( 'Send pickup notifications to additional store staff or location managers in addition to the customer.', 'advanced-local-pickup-for-woocommerce' ), ), array( 'title' => esc_html__( 'Automations', 'advanced-local-pickup-for-woocommerce' ), 'sub' => esc_html__( 'Status-change reminders and follow-ups.', 'advanced-local-pickup-for-woocommerce' ), 'desc' => esc_html__( 'Schedule automatic reminders before pickup, mark orders Picked Up after X days, and similar workflows.', 'advanced-local-pickup-for-woocommerce' ), ), array( 'title' => esc_html__( 'Curbside Pickup', 'advanced-local-pickup-for-woocommerce' ), 'sub' => esc_html__( 'Status: Disabled', 'advanced-local-pickup-for-woocommerce' ), 'desc' => esc_html__( 'Let customers notify the store when they have arrived for curbside delivery. Configure prompts, vehicle details, and arrival flow.', 'advanced-local-pickup-for-woocommerce' ), ), ); ?>