=== Factorize Storefront ===
Contributors: webyoungstown
Tags: woocommerce, storefront, map, shortcode, local-store
Requires at least: 6.2
Tested up to: 6.7
Stable tag: 1.0.1
Requires PHP: 7.4
License: Factorize License (proprietary)
License URI: https://factorize.webyoungstown.com/license/

Home-page storefront sections for local WooCommerce stores: a photo band with tagline overlay and a visit block with map, hours, and directions.

== Description ==

Your store is real — customers can walk in, look around, and drive home with the deal — but most WooCommerce home pages never show it. Factorize Storefront puts the physical store front and center: a full-width photo band of the actual storefront with a tagline overlay, a store-visit section with an embedded map, address, hours, one-tap driving directions, and a click-to-call button, plus hero-photo wiring so your theme can fade a storefront photo into the page with pure CSS. It was extracted from a real liquidation store, where "come see it in person" is the whole pitch.

= Features =

* `[empire_storefront]` shortcode — a full-width storefront photo band with a tagline and sub-line overlaid on the photo. Both lines are overridable per use via the `tagline` and `sub` shortcode attributes.
* Media Library photo management — the band's photo is an attachment ID stored in the `et_storefront_image` option, so you swap the photo from the media library without touching code or rebuilding the page.
* `[empire_visit]` shortcode — a store-visit block with an embedded Google Map, street address, opening hours, a note about how routing works, and two action buttons.
* Keyless Google Maps embed — uses Google's free embed iframe, so there is no API key to create and no billing account to attach. The iframe is lazy-loaded and sent with a `no-referrer-when-downgrade` referrer policy.
* Geolocation-free directions — the Start Route button opens Google Maps with only the destination pre-filled; Maps supplies the visitor's own location and drive time, so your site never has to ask for a geolocation permission.
* Click-to-call button — a plain `tel:` link that dials the store from a phone.
* Configurable map zoom — the `maps_zoom` config key controls the embed's zoom level.
* Hero-photo wiring — publishes the hero image URL as the `--et-hero-photo` CSS custom property in a small `<style>` tag on `wp_head`, so a theme can build the photo fade/mask entirely in CSS instead of inline markup. The hero image is the `et_hero_image` attachment ID option.
* Graceful empty states — with no storefront image set, `[empire_storefront]` outputs nothing (no broken image); with no hero image set, the style tag is simply omitted.
* Theme-friendly markup — clean, stable CSS classes (`.et-storefront*`, `.et-visit*`, `.et-btn`) with all styling left to your theme, so the plugin never fights your design.
* `empire_tools_store_image( 'hero' | 'storefront' )` helper function for theme or plugin code that needs the same attachment IDs.
* Escaped, translation-ready output (text domain `factorize-storefront`).
* Registers a Storefront card on the shared Factorize admin hub.
* Lightweight by design — no custom database tables, no cron jobs, no front-end JavaScript. Two shortcodes, one head style tag, and a handful of options.

Honesty note: in 1.0.0 the address, opening hours, and phone number inside `[empire_visit]` are fixed in the template (the plugin was extracted from a single-location store). Configurable and multiple locations are first on the roadmap below.

= Works standalone, better together =

Factorize is a modular WooCommerce toolkit for liquidation, bin, discount, and open-box stores, built and battle-tested on a real 950-product store. Every plugin works completely standalone; any of them alone stands up the shared "Factorize" admin hub, and together they fill it with category tabs (Insights / Selling / Customers / Storefront). Install Factorize Storefront by itself and you get the full hub with its Storefront card; add more Factorize plugins later and they slot into the same hub.

= Configuration =

Behavior defaults live in `config.php` and can be overridden without editing files:

* `maps_zoom` (default `10`) — the `z=` zoom level of the Google Maps embed inside `[empire_visit]`.

Override any subset of keys by saving an array to the `factorize-storefront_options` option, e.g. `update_option( 'factorize-storefront_options', array( 'maps_zoom' => 12 ) )`, or filter the merged configuration at runtime with the `factorize-storefront_config` filter. Sites migrating from the old Empire naming keep working: the legacy `empire-storefront-sections_options` option is still read as a fallback.

The two photos are separate attachment-ID options: `et_hero_image` (hero card photo) and `et_storefront_image` (photo band).

= Roadmap =

Planned for future releases — none of these are in 1.0.0 yet:

* Multiple store locations
* Opening-hours schema.org rich results
* Holiday hours
* Photo gallery band
* Announcement bar

== Installation ==

1. Upload the `factorize-storefront` folder to `/wp-content/plugins/`, or install the zip via Plugins → Add New → Upload Plugin, then activate it.
2. On activation a Factorize menu appears in the admin sidebar (created by whichever Factorize plugin loads first) with a Storefront status card. This plugin has no separate settings screen — everything is options and shortcodes.
3. Upload your storefront photo (and optionally a hero photo) to the Media Library and note each attachment ID.
4. Point the plugin at the photos: with WP-CLI run `wp option update et_storefront_image 123` and `wp option update et_hero_image 456` (using your real IDs), or use a one-line `update_option()` call.
5. Add `[empire_storefront]` and `[empire_visit]` to your home page — any block editor, widget area, or page builder that renders shortcodes works.
6. Optional: change the map zoom by saving `array( 'maps_zoom' => 12 )` to the `factorize-storefront_options` option.

== Frequently Asked Questions ==

= Does it work without the other Factorize plugins? =

Yes. Every Factorize plugin is fully standalone — this one calls no functions from its siblings and needs none of them. On its own it also creates the shared Factorize admin hub; other Factorize plugins installed later appear in the same hub as additional cards and tabs.

= Does any data leave my server? =

The plugin itself makes no remote requests and collects nothing. The `[empire_visit]` block embeds a Google Maps iframe, which the visitor's browser loads directly from google.com (subject to Google's terms and privacy policy), and the Start Route button links out to Google Maps. No API key is used, and your site never requests the visitor's geolocation.

= Where is my data stored? =

In regular WordPress options: `et_hero_image` and `et_storefront_image` (Media Library attachment IDs) and `factorize-storefront_options` (config overrides). No custom database tables are created, and deactivating the plugin leaves your media untouched.

= Why does [empire_storefront] output nothing? =

The `et_storefront_image` option is not set, or points to a deleted attachment. That empty state is deliberate — no broken image, no empty band. Set the option to a valid attachment ID and the band appears.

= Why do the sections look unstyled on my theme? =

By design the plugin outputs markup with stable classes (`.et-storefront*`, `.et-visit*`, `.et-btn`) and ships no CSS, so it can never fight your theme. The companion theme it was extracted from styles everything, including the dark-map effect (Google's keyless embed only serves a light map; the dark look is a CSS filter). On other themes, style those classes yourself.

= Can I change the address, hours, or phone number? =

Not from settings yet. In 1.0.0 they are fixed in the `[empire_visit]` template, matching the store the plugin was built for; changing them means editing the shortcode markup. Multiple, configurable store locations are first on the roadmap.

== Screenshots ==

1. The [empire_storefront] photo band on the home page — full-width storefront photo with the tagline and sub-line overlay.
2. The [empire_visit] store-visit block — dark map embed, address, opening hours, and the Start Route and Call buttons.
3. Google Maps directions opened by Start Route — destination pre-filled, with Maps showing the visitor's own location and drive time.
4. The hero card photo fading into the page background via the --et-hero-photo CSS custom property.
5. The Factorize admin hub with the Storefront card registered by this plugin.

== Changelog ==

= 1.0.0 =
* Initial release.
* [empire_storefront] storefront photo band with tagline/sub overlay and Media Library photo swapping.
* [empire_visit] store-visit block: keyless Google Maps embed, address, hours, Start Route and Call buttons.
* Geolocation-free directions — Start Route sends only the destination to Google Maps.
* Hero photo published as the --et-hero-photo CSS custom property on wp_head.
* maps_zoom config key with factorize-storefront_options / factorize-storefront_config overrides (legacy Empire option name still honored).
* Factorize admin hub card — the hub is created even when this plugin runs alone.
