You've already forked wc-bootstrap
Implement Phase 9 & reusable components; skip Phase 8 (emails)
Phase 8 (Emails) skipped: WooCommerce email rendering uses wc_get_template_html() which bypasses the Twig pipeline entirely. Email customization deferred to plugins or block email editor. Phase 9 - Supplementary (7 templates): - Brand description with thumbnail, taxonomy archive delegate - Brands A-Z shortcode with alphabetical index navigation - Single brand thumbnail shortcode - REST API OAuth login and grant-access forms - Back-in-stock notification form with email input Reusable Components (6 templates): - price: product price display with sale handling - rating: star rating with Bootstrap Icons (filled/half/empty) - address-card: billing/shipping address card with edit link - status-badge: contextual order status badges - quantity-input: +/- input group widget - form-field: universal form field renderer (text/select/textarea/checkbox) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
65
templates/single-product/back-in-stock-form.html.twig
Normal file
65
templates/single-product/back-in-stock-form.html.twig
Normal file
@@ -0,0 +1,65 @@
|
||||
{#
|
||||
# Back in Stock Form (Bootstrap 5 Override)
|
||||
#
|
||||
# Notification signup form shown on out-of-stock product pages.
|
||||
#
|
||||
# Expected context:
|
||||
# product_id - Product ID
|
||||
# is_visible - Whether the form is visible (not hidden)
|
||||
# show_email_field - Whether to show the email input
|
||||
# show_checkbox - Whether to show the privacy opt-in checkbox
|
||||
# button_class - CSS class for the submit button
|
||||
#
|
||||
# WooCommerce PHP equivalent: single-product/back-in-stock-form.php
|
||||
#
|
||||
# @package WcBootstrap
|
||||
# @since 0.1.0
|
||||
#}
|
||||
|
||||
<div class="wc_bis_form card{% if not is_visible %} d-none{% endif %} mt-3"
|
||||
data-bis-product-id="{{ product_id }}">
|
||||
<div class="card-body">
|
||||
<h3 id="wc_bis_form_heading_{{ product_id }}" class="h6 mb-3">
|
||||
{{ __('Want to be notified when this product is back in stock?') }}
|
||||
</h3>
|
||||
|
||||
<form method="post" novalidate aria-labelledby="wc_bis_form_heading_{{ product_id }}">
|
||||
<div class="d-flex gap-2 mb-3">
|
||||
{% if show_email_field %}
|
||||
<label for="wc_bis_email_{{ product_id }}" class="visually-hidden">
|
||||
{{ __('Email address to be notified when this product is back in stock') }}
|
||||
</label>
|
||||
<input type="email"
|
||||
name="wc_bis_email"
|
||||
class="form-control"
|
||||
placeholder="{{ __('Enter your e-mail') }}"
|
||||
id="wc_bis_email_{{ product_id }}"
|
||||
required
|
||||
aria-required="true" />
|
||||
{% endif %}
|
||||
|
||||
<button type="submit"
|
||||
name="wc_bis_register"
|
||||
class="btn btn-primary flex-shrink-0">
|
||||
<i class="bi bi-bell me-1" aria-hidden="true"></i>
|
||||
{{ __('Notify me') }}
|
||||
</button>
|
||||
</div>
|
||||
|
||||
{% if show_checkbox %}
|
||||
<div class="form-check">
|
||||
<input type="checkbox"
|
||||
class="form-check-input"
|
||||
name="wc_bis_opt_in"
|
||||
id="wc_bis_opt_in_{{ product_id }}" />
|
||||
<label class="form-check-label small" for="wc_bis_opt_in_{{ product_id }}">
|
||||
{{ wc_replace_policy_page_link_placeholders(wc_get_privacy_policy_text('registration'))|wp_kses_post }}
|
||||
</label>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{{ wp_nonce_field('wc_bis_signup', 'wc_bis_nonce') }}
|
||||
<input type="hidden" name="wc_bis_product_id" value="{{ product_id }}" />
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
Reference in New Issue
Block a user