diff --git a/deploy/deploy.sh b/deploy/deploy.sh index a7f2543..53f0a6d 100755 --- a/deploy/deploy.sh +++ b/deploy/deploy.sh @@ -129,6 +129,12 @@ echo "==> enabling WooCommerce HPOS (custom order tables)" $WP option update woocommerce_custom_orders_table_enabled yes $WP option update woocommerce_custom_orders_table_data_sync_enabled yes +# Membership\Registration hooks onto WooCommerce's own My Account +# registration form (design doc §07) rather than a bespoke signup form — +# it's disabled by default, so nothing shows up without this. +echo "==> enabling WooCommerce account registration (member signup)" +$WP option update woocommerce_enable_myaccount_registration yes + # WooCommerce's default (unset -> '1:1') force-crops every product # thumbnail to a square — confirmed directly: a 335x500 portrait book cover # was landing at a hard-cropped 300x300 shop-grid thumbnail, cutting off diff --git a/wp-content/plugins/bookstore-core/bookstore-core.php b/wp-content/plugins/bookstore-core/bookstore-core.php index 373ad83..1286622 100644 --- a/wp-content/plugins/bookstore-core/bookstore-core.php +++ b/wp-content/plugins/bookstore-core/bookstore-core.php @@ -13,7 +13,7 @@ defined('ABSPATH') || exit; define('BSC_PLUGIN_FILE', __FILE__); define('BSC_PLUGIN_DIR', plugin_dir_path(__FILE__)); define('BSC_VERSION', '0.2.0'); -define('BSC_SCHEMA_VERSION', '2'); +define('BSC_SCHEMA_VERSION', '3'); spl_autoload_register(function (string $class) { $prefix = 'Bookstore\\Core\\'; @@ -59,6 +59,15 @@ add_filter('woocommerce_shipping_methods', function (array $methods) { return $methods; }); +// Membership tiers/benefits: design doc §07 extension (see includes/Membership/). +\Bookstore\Core\Membership\MemberDiscount::register(); +\Bookstore\Core\Membership\Registration::register(); + +add_filter('woocommerce_get_settings_pages', function (array $settings) { + $settings[] = new \Bookstore\Core\Admin\TierSettings(); + return $settings; +}); + add_action('init', function () { \Bookstore\Core\Taxonomy\TagTaxonomies::register(); }); diff --git a/wp-content/plugins/bookstore-core/includes/Admin/TierSettings.php b/wp-content/plugins/bookstore-core/includes/Admin/TierSettings.php new file mode 100644 index 0000000..b4e4b46 --- /dev/null +++ b/wp-content/plugins/bookstore-core/includes/Admin/TierSettings.php @@ -0,0 +1,158 @@ + Settings > Membership Tiers. WooCommerce's Settings API + * has no built-in repeater field for a dynamic tier/benefit list, so + * rather than fighting it, output()/save() are fully overridden with + * plain hand-rolled markup/POST handling instead of the usual + * get_settings()-array approach — WC_Admin_Settings still wraps our tab + * in its own