Build Dune shop catalogue and repair shared menu publication

This commit is contained in:
Codex 2026-11-16 17:43:19 +00:00
commit 69ac453b10
3 changed files with 33 additions and 1 deletions

View file

@ -42,7 +42,7 @@ final class DuneShopController extends Sceleton {
}
$out.='</section>';
}
$out.='<aside class="dune-store-preview"><strong>Collection preview</strong><p>Ordering is not open yet. Sashes are made to order, with a required preferred name. Standard side edging is included; silver side edging is +€50 and gold side edging is +€75. The bottom fringe is unchanged.</p></aside>';
$out.='<aside class="dune-store-preview"><strong>Test ordering</strong><p>The Season sash is available as a test order by bank transfer; do not transfer money for the test. Other products remain collection previews. Sashes are made to order, with a required preferred name. Standard side edging is included; silver side edging is +€50 and gold side edging is +€75. The bottom fringe is unchanged.</p></aside>';
return $this->renderContent($out);
}
}

View file

@ -27,3 +27,7 @@ Sashes are made to order with unlimited stock, a required preferred embroidery n
Shop customers map by central UUID. Verified contact email and username are synchronized after central sign-in; passwords are never retrieved, exposed or copied. Missing verified addresses retain a non-deliverable internal placeholder until a contact email is verified. Email collisions require support rather than silently merging customers. Native customer registration and password pages redirect to central sign-in, including currency-prefixed routes. Native backend roles remain untouched.
The shared menu and badge publisher strips legacy unmarked controllers before appending the current one. Regression coverage checks both publication idempotence and a single controller/observer.
## Season test-order exception
At the owner's request, `enable-season-test-order.py` restores the original Season sash artwork and makes ONLY that product orderable for testing. The native offline payment method is labelled Bank transfer — TEST ORDER, explicitly says not to transfer money, and leaves orders awaiting payment. The shop offers no online payment method. Sash shipping is EUR20 per order under the existing tax setup. No manufacturing or fulfillment integration is started. Other imports retain server-side preview guards. The preferred name and side-edging selections remain required.

View file

@ -0,0 +1,28 @@
from pathlib import Path
import subprocess,shutil
def q(s):return subprocess.check_output(['mysql','-N','dunerealms_oscommerce','-e',s],text=True).strip()
def run(s):subprocess.run(['mysql','dunerealms_oscommerce'],input="SET SESSION sql_mode='';"+s,text=True,check=True,capture_output=True)
pid=int(q('SELECT products_id FROM dune_catalog_import WHERE source_package_id=75'))
assert pid==91
stock=int(q("SELECT stock_indication_id FROM products_stock_indication WHERE stock_code='made-to-order' LIMIT 1"))
run(f"UPDATE products SET cart_button=1,manual_stock_unlimited=1,allow_backorder=1,products_status=1,stock_indication_id={stock} WHERE products_id={pid};UPDATE dune_product_requirements SET preview_only=0 WHERE products_id={pid};UPDATE products_stock_indication SET allow_out_of_stock_checkout=1,allow_out_of_stock_add_to_cart=1,allow_in_stock_notify=0 WHERE stock_indication_id={stock};")
settings={'MODULE_PAYMENT_INSTALLED':'offline.php','MODULE_PAYMENT_OFFLINE_STATUS':'True','MODULE_PAYMENT_OFFLINE_ZONE':'0','MODULE_PAYMENT_OFFLINE_ORDER_STATUS_ID':'100007','MODULE_PAYMENT_OFFLINE_SORT_ORDER':'1','MODULE_SHIPPING_INSTALLED':'flat.php','MODULE_SHIPPING_FLAT_STATUS':'True','MODULE_SHIPPING_FLAT_COST':'16.666667','MODULE_SHIPPING_FLAT_TAX_CLASS':'3','MODULE_SHIPPING_FLAT_ZONE':'0'}
for key,value in settings.items():
run("UPDATE platforms_configuration SET configuration_value='"+value+"' WHERE platform_id=7 AND configuration_key='"+key+"';")
run("UPDATE payment_offline SET status=0 WHERE platform_id=7;DELETE FROM payment_offline WHERE platform_id=7 AND payment_offline_id=9001;INSERT INTO payment_offline(payment_offline_id,platform_id,language_id,payment_offline_title,payment_offline_description,sort_order,status) VALUES(9001,7,1,'Bank transfer — TEST ORDER','TEST ORDER: no payment is required. Do not transfer money. The order remains awaiting payment; no manufacturing or fulfillment starts automatically.',0,1);")
for kind,code in [('payment','offline'),('shipping','flat')]:
run(f"INSERT INTO modules(type,code,state,platform_id,installed_admin_id,changed_admin_id) SELECT '{kind}','{code}',1,7,28,28 WHERE NOT EXISTS(SELECT 1 FROM modules WHERE type='{kind}' AND code='{code}' AND platform_id=7);UPDATE modules SET state=1 WHERE type='{kind}' AND code='{code}' AND platform_id=7;")
desc='<p>A keepsake of The Quest for Tavren II Aedrecht, with the lantern and map of an unfolding journey.</p><p><strong>Test ordering is available.</strong> This custom sash is made to order. Enter the preferred embroidery name and choose standard, silver (+€50) or gold (+€75) side edging. The bottom fringe stays unchanged.</p><p><strong>Bank transfer — test order:</strong> no payment is required for this example. Do not transfer money. Orders remain awaiting payment; no production or dispatch starts automatically.</p>'
run("UPDATE products_description SET products_description=CONVERT(0x"+desc.encode().hex()+" USING utf8mb4),products_description_short='Made-to-order Season sash · test ordering available' WHERE products_id=91;")
src=Path('/home/dunerealms/apps/azuriom/public/assets/img/merch/sash-season-tavren-ii-v1.png')
images=q('SELECT products_images_id FROM products_images WHERE products_id=91 ORDER BY default_image DESC').splitlines()
assert images
image=int(images[0]);name=src.name
run(f"UPDATE products_images SET image_status=1,default_image=IF(products_images_id={image},1,0) WHERE products_id=91;UPDATE products_images_description SET file_name='{name}',hash_file_name='{name}',orig_file_name='{name}',image_title='Season — The Quest for Tavren II Aedrecht Sash',image_alt='Season ceremonial sash',use_external_images=0 WHERE products_images_id={image};")
for dims in q("SELECT CONCAT(image_types_x,'x',image_types_y) FROM image_types").splitlines()+['originals']:
folder=Path('/home/dunerealms/apps/oscommerce/images/products/91')/str(image)/dims
for variant in [folder,folder/'en']:
variant.mkdir(parents=True,exist_ok=True);shutil.copyfile(src,variant/name)
subprocess.run(['chown','-R','dunerealms:dunerealms','/home/dunerealms/apps/oscommerce/images/products/91'],check=True)
run("UPDATE properties_values v JOIN properties_to_products p ON p.values_id=v.values_id AND p.properties_id=v.properties_id JOIN properties_description d ON d.properties_id=v.properties_id AND d.language_id=v.language_id SET v.values_text='Made to order · test ordering available by bank transfer. No payment required.' WHERE p.products_id=91 AND d.properties_name='Availability';")
print('Season image restored; only the Season sash is test-orderable. Offline bank transfer, awaiting-payment status, no automatic charge or fulfillment.')