diff --git a/website/node/integration-shop-profile.mjs b/website/node/integration-shop-profile.mjs new file mode 100644 index 00000000..afe57c3a --- /dev/null +++ b/website/node/integration-shop-profile.mjs @@ -0,0 +1,5 @@ +export async function shopAccountProfile(db,userId,client){ + if(client!=='oscommerce')return {}; + const contact=await db.prepare('SELECT address,verified_at FROM site_contact_emails WHERE user_id=?').bind(userId).first(); + return {email:contact?.verified_at?contact.address:null,emailVerified:!!contact?.verified_at}; +} diff --git a/website/node/integration-sso.mjs b/website/node/integration-sso.mjs index 3b145b56..2edfe52a 100644 --- a/website/node/integration-sso.mjs +++ b/website/node/integration-sso.mjs @@ -1,3 +1,4 @@ +import {shopAccountProfile} from './integration-shop-profile.mjs'; import {nativeAgentIdentity} from './organisation-native-projection.mjs'; import {communityBadgeVisible} from './community-badges.mjs'; import {publicProfileFor} from './profile.mjs'; @@ -30,7 +31,7 @@ export function createIntegrationSSO(db,settings={}){ if(url.pathname.endsWith('/identity')){ if(!/^[0-9a-f]{64}$/.test(body.sessionRef||''))return json({message:'Unauthorized'},401); const user=await db.prepare('SELECT a.id,a.username,a.display_name,a.role FROM site_sessions s JOIN site_accounts a ON a.id=s.user_id WHERE s.token_hash=? AND s.expires_at>?').bind(body.sessionRef,Date.now()).first(); - return user?describe(user,body.sessionRef):json({message:'Session expired'},401); + return user?describe(user,body.sessionRef,body.client):json({message:'Session expired'},401); } if(!Object.hasOwn(clients,body.client)||!/^[A-Za-z0-9_-]{43}$/.test(body.code||''))return json({message:'Invalid request'},400); const codeHash=hash(body.code),record=await db.prepare('SELECT user_id,session_ref FROM integration_sso_codes WHERE code_hash=? AND client_id=? AND expires_at>?').bind(codeHash,body.client,Date.now()).first(); @@ -39,13 +40,13 @@ export function createIntegrationSSO(db,settings={}){ if(!removed.meta.changes)return json({message:'Expired or already used'},401); const user=await db.prepare('SELECT a.id,a.username,a.display_name,a.role FROM site_sessions s JOIN site_accounts a ON a.id=s.user_id WHERE s.token_hash=? AND s.expires_at>?').bind(record.session_ref,Date.now()).first(); if(!user)return json({message:'Account unavailable'},401); - return describe(user,record.session_ref); - async function describe(user,sessionRef){ + return describe(user,record.session_ref,body.client); + async function describe(user,sessionRef,client){ const access=await accessFor(db,user),link=await db.prepare('SELECT minecraft_uuid FROM site_game_links WHERE user_id=?').bind(user.id).first(); const age=await db.prepare('SELECT age_band FROM site_age_declarations WHERE user_id=?').bind(user.id).first(); const policy=await db.prepare('SELECT service_uuid,game_link_exempt FROM site_account_policies WHERE user_id=?').bind(user.id).first(); const native=nativeAgentIdentity(user,access); - return json({id:user.id,username:user.username,displayName:user.display_name,publicProfile:await publicProfileFor(db,user.id,settings.CP_ORIGIN||'https://cp.dunerealms.com'),role:access.rank,ranks:access.ranks,rankLabel:access.label,rankLevel:access.level,communityBadges:(await badgesFor(db,user.id)).filter(k=>communityBadgeVisible(k,access.ranks)),linked:!!link?.minecraft_uuid,gameLinkExempt:!!policy?.service_uuid&&Number(policy.game_link_exempt)===1,forumAllowed:age?.age_band!=='under15',permissions:native.permissions,...(native.nativePermissionManagement===false?{nativePermissionManagement:false}:{}),sessionRef}); + return json({...await shopAccountProfile(db,user.id,client),id:user.id,username:user.username,displayName:user.display_name,publicProfile:await publicProfileFor(db,user.id,settings.CP_ORIGIN||'https://cp.dunerealms.com'),role:access.rank,ranks:access.ranks,rankLabel:access.label,rankLevel:access.level,communityBadges:(await badgesFor(db,user.id)).filter(k=>communityBadgeVisible(k,access.ranks)),linked:!!link?.minecraft_uuid,gameLinkExempt:!!policy?.service_uuid&&Number(policy.game_link_exempt)===1,forumAllowed:age?.age_band!=='under15',permissions:native.permissions,...(native.nativePermissionManagement===false?{nativePermissionManagement:false}:{}),sessionRef}); } }; } diff --git a/website/ops/oscommerce/DuneAccount.php b/website/ops/oscommerce/DuneAccount.php index 81930418..7a90f7da 100644 --- a/website/ops/oscommerce/DuneAccount.php +++ b/website/ops/oscommerce/DuneAccount.php @@ -2,6 +2,10 @@ namespace frontend\components; use Yii; final class DuneAccount { + private static function email(array $identity):string { + $email=$identity['email']??null; + return ($identity['emailVerified']??false)===true&&is_string($email)&&strlen($email)<=254&&filter_var($email,FILTER_VALIDATE_EMAIL)?$email:$identity['id'].'@accounts.dunerealms.invalid'; + } private static function token(): string { return rtrim(strtr(base64_encode(random_bytes(32)), '+/', '-_'), '='); } private static function cookie(string $name,string $value,int $expires):void { setcookie($name,$value,['expires'=>$expires,'path'=>'/','secure'=>true,'httponly'=>true,'samesite'=>'Lax']); } private static function api(string $operation,array $payload):array { @@ -35,7 +39,9 @@ final class DuneAccount { $db=$app->db;$transaction=$db->beginTransaction(); try{ $id=$db->createCommand('SELECT customer_id FROM dune_account_links WHERE account_id=:id FOR UPDATE',[':id'=>$identity['id']])->queryScalar(); - $email=$identity['id'].'@accounts.dunerealms.invalid'; + $email=self::email($identity); + $collision=$db->createCommand('SELECT customers_id FROM customers WHERE customers_email_address=:email AND customers_id<>:id',[':email'=>$email,':id'=>(int)$id])->queryScalar(); + if($collision)throw new \yii\web\HttpException(409,'This email is linked to another shop customer. Please contact support to link the accounts.'); if(!$id){ $db->createCommand("SET SESSION sql_mode=''")->execute(); $db->createCommand()->insert('customers',['customers_firstname'=>mb_substr($identity['username']??'Player',0,32),'customers_lastname'=>'','customers_email_address'=>$email,'customers_password'=>password_hash(bin2hex(random_bytes(32)),PASSWORD_BCRYPT),'customers_status'=>1,'platform_id'=>\common\classes\platform::currentId()])->execute(); @@ -43,13 +49,18 @@ final class DuneAccount { $db->createCommand()->insert('dune_account_links',['account_id'=>$identity['id'],'customer_id'=>$id])->execute(); $db->createCommand()->insert('customers_info',['customers_info_id'=>$id,'customers_info_date_account_created'=>gmdate('Y-m-d H:i:s')])->execute(); } - $db->createCommand()->update('customers',['customers_firstname'=>mb_substr($identity['username']??'Player',0,32)],['customers_id'=>$id])->execute(); + $db->createCommand()->update('customers',['customers_firstname'=>mb_substr($identity['username']??'Player',0,32),'customers_email_address'=>$email],['customers_id'=>$id])->execute(); $transaction->commit();return (int)$id; }catch(\Throwable $e){$transaction->rollBack();throw $e;} } private static function handle($app):void { $app->response->headers->set('Referrer-Policy','no-referrer'); $path=parse_url($_SERVER['REQUEST_URI']??'/',PHP_URL_PATH); + if(empty($_GET['action'])&&preg_match('#^/catalog/(?:[A-Z]{3}/)?$#',$path)){ + $currency=$_GET['currency']??'EUR'; + if(!is_string($currency)||!in_array($currency,['EUR','GBP','USD'],true))$currency='EUR'; + self::redirect($app,'/catalog/dune-shop?currency='.$currency); + } if($path==='/dune-login.php'){ if(!isset($_GET['code']))self::start($app); $state=$_GET['state']??'';$nonce=$_COOKIE['__Host-dune_osc_state']??''; @@ -68,7 +79,7 @@ final class DuneAccount { if(is_string($token)&&preg_match('/^[A-Za-z0-9_-]{43}$/',$token)){ $row=$app->db->createCommand('SELECT account_id,session_ref FROM dune_sso_sessions WHERE token_hash=:token AND expires_at>:now',[':token'=>hash('sha256',$token),':now'=>time()])->queryOne(); if($row){ - try{$identity=self::api('identity',['sessionRef'=>$row['session_ref']]);}catch(\yii\web\HttpException $e){if($e->statusCode!==401)throw $e;} + try{$identity=self::api('identity',['sessionRef'=>$row['session_ref'],'client'=>'oscommerce']);}catch(\yii\web\HttpException $e){if($e->statusCode!==401)throw $e;} if(($identity['id']??null)!==$row['account_id'])$identity=null; } } @@ -78,11 +89,11 @@ final class DuneAccount { if(!$app->user->isGuest){$app->user->logout(false);global $cart;if(is_object($cart)&&is_callable([$cart,'reset']))$cart->reset();} $app->session->regenerateID(true); $customer=new \common\components\Customer(\common\components\Customer::LOGIN_WITHOUT_CHECK); - if(!$customer->loginCustomer($identity['id'].'@accounts.dunerealms.invalid',$id))throw new \yii\web\ForbiddenHttpException('Account link failed'); + if(!$customer->loginCustomer(self::email($identity),$id))throw new \yii\web\ForbiddenHttpException('Account link failed'); } }elseif(!$app->user->isGuest){$app->user->logout(false);self::cookie('__Host-dune_oscommerce','',time()-3600);} - if(preg_match('#^/catalog/account/(login|create|password|password-forgotten)#',$path))self::start($app); - if(preg_match('#^/catalog/account/?$#',$path))self::redirect($app,'https://cp.dunerealms.com/'); - if(preg_match('#^/catalog/checkout#',$path)&&!$identity)self::start($app,$path); + if(preg_match('#^/catalog/(?:[A-Z]{3}/)?account/(login|create|password|password-forgotten)#',$path))self::start($app); + if(preg_match('#^/catalog/(?:[A-Z]{3}/)?account/?$#',$path))self::redirect($app,'https://cp.dunerealms.com/'); + if(preg_match('#^/catalog/(?:[A-Z]{3}/)?checkout#',$path)&&!$identity)self::start($app,$path); } } diff --git a/website/ops/oscommerce/DuneProductRules.php b/website/ops/oscommerce/DuneProductRules.php new file mode 100644 index 00000000..8f6b8e95 --- /dev/null +++ b/website/ops/oscommerce/DuneProductRules.php @@ -0,0 +1,37 @@ +80 || preg_match('/[\x00-\x1F\x7F<>]/u',$value)) { + throw new \InvalidArgumentException('Enter a preferred name of 1–80 characters, without markup or control characters.'); + } + return $value; + } + public static function validateCartRequest(): void { + if ((\Yii::$app->controller->action->id??'')==='error') return; + $action=$_GET['action']??''; + if (!in_array($action,['add_product','add_all','add_quote','add_quote_all','add_sample','buy_now'],true)) return; + $rows=\Yii::$app->db->createCommand('SELECT products_id,option_id,preview_only FROM dune_product_requirements')->queryAll(); + foreach($rows as $row) { + $id=(int)$row['products_id']; + $single=(int)($_POST['products_id']??$_GET['products_id']??0)===$id; + $listed=isset($_POST['listqty'][$id]) || isset($_POST['listid'][$id]); + if (!$single && !$listed) continue; + $value=$single?($_POST['attr_text'][$row['option_id']]??null):($_POST['listattr_text'][$id][$row['option_id']]??null); + if((int)$row['option_id']>0){ + try { self::preferredName($value); } + catch(\InvalidArgumentException $e) { self::reject(422,$e->getMessage()); } + } + if($row['preview_only']) self::reject(409,'Collection preview: ordering is currently unavailable.'); + } + } + private static function reject(int $status,string $message): never { + $response=\Yii::$app->response; + $response->statusCode=$status; + $response->format=\yii\web\Response::FORMAT_JSON; + $response->data=['error'=>$message]; + $response->send();\Yii::$app->end();exit; + } +} diff --git a/website/ops/oscommerce/DuneShopController.php b/website/ops/oscommerce/DuneShopController.php new file mode 100644 index 00000000..283e94c3 --- /dev/null +++ b/website/ops/oscommerce/DuneShopController.php @@ -0,0 +1,48 @@ +view->title='DuneRealms Shop'; + $rows=Yii::$app->db->createCommand("SELECT p.products_id,p.products_price,p.products_tax_class_id,pd.products_name,pd.products_description_short,d.kind FROM products p JOIN platforms_products pp ON pp.products_id=p.products_id AND pp.platform_id=7 JOIN products_description pd ON pd.products_id=p.products_id AND pd.language_id=1 AND pd.platform_id=7 LEFT JOIN dune_catalog_import d ON d.products_id=p.products_id WHERE p.products_status=1 ORDER BY p.products_date_added DESC,p.products_id DESC")->queryAll(); + $saleIds=Yii::$app->db->createCommand("SELECT DISTINCT products_id FROM specials WHERE EXISTS(SELECT 1 FROM products active JOIN platforms_products pp ON pp.products_id=active.products_id AND pp.platform_id=7 WHERE active.products_id=specials.products_id AND active.products_status=1 AND specials.specials_new_products_priceNOW())")->queryColumn(); + $featuredIds=Yii::$app->db->createCommand("SELECT DISTINCT products_id FROM featured WHERE EXISTS(SELECT 1 FROM products active JOIN platforms_products pp ON pp.products_id=active.products_id AND pp.platform_id=7 WHERE active.products_id=featured.products_id AND active.products_status=1) AND status=1 AND (start_date IS NULL OR start_date='0000-00-00 00:00:00' OR start_date<=NOW()) AND (expires_date IS NULL OR expires_date='0000-00-00 00:00:00' OR expires_date>NOW())")->queryColumn(); + $sashes=count(array_filter($rows,fn($r)=>$r['kind']==='sash'));$ranks=count(array_filter($rows,fn($r)=>$r['kind']==='rank')); + $base=fn($route)=>Html::encode(\yii\helpers\Url::to([$route])); + $out='
THE DUNEREALMS EMPORIUM

Carry a piece of the realms.

Ceremonial sashes, personal keepsakes and ways to support the community.

Browse the collection
'; + $tiles=[['Sale',count($saleIds)?'Explore current offers':'No sales active right now','catalog/sales','nav-exchange-v2.webp',''],['Ceremonial sashes',$sashes.' designs · made to order','catalog/all-products','nav-clan-v2.webp','sash'],['Donor ranks',$ranks.' ways to support the realms','catalog/all-products','nav-account-v2.webp','rank']]; + $out.=''; + foreach([['Sale','Current offers from the emporium',array_values(array_filter($rows,fn($r)=>in_array($r['products_id'],$saleIds))),'catalog/sales'],['Featured','Selected pieces from the realms',array_values(array_filter($rows,fn($r)=>in_array($r['products_id'],$featuredIds))),'catalog/featured-products'],['New arrivals','Recently added to the collection',array_slice($rows,0,6),'catalog/products-new']] as [$title,$sub,$items,$route]){ + $sectionClass=$title==='Sale'?' dune-store-section--sale':($title==='Featured'?' dune-store-section--featured':''); + $out.='

'.($title==='Sale'?'SALE ':'').$title.'

'.$sub.'

View all ↗
'; + if(!$items)$out.='
'.($title==='Sale'?'There are no active sale offers.':'Featured products have not been selected yet.').'
'; + else{ + $out.='
'; + foreach(array_slice($items,0,6) as $p){ + $url=Html::encode(\yii\helpers\Url::to(['catalog/product','products_id'=>$p['products_id']])); + $image=Html::encode(\common\classes\Images::getImageUrl($p['products_id'],'Small',1)); + $currencies=Yii::$container->get('currencies');$tax=\common\helpers\Tax::get_tax_rate($p['products_tax_class_id']); + $normal=\common\helpers\Product::get_products_price($p['products_id'],1,$p['products_price']); + $special=\common\helpers\Product::get_products_special_price($p['products_id'],1); + $price=$currencies->display_price($normal,$tax); + if($special!==false&&$special!==null&&(float)$special>=0&&(float)$special<(float)$normal){ + $saving=(int)round((1-(float)$special/(float)$normal)*100); + $price=''.$price.''.$currencies->display_price($special,$tax).'Save '.$saving.'%'; + } + $out.=''; + } + $out.='
'; + } + $out.='
'; + } + $out.=''; + return $this->renderContent($out); + } +} diff --git a/website/ops/oscommerce/README.md b/website/ops/oscommerce/README.md index 966a273c..85c5e2d8 100644 --- a/website/ops/oscommerce/README.md +++ b/website/ops/oscommerce/README.md @@ -12,3 +12,22 @@ Frontend account linking uses the existing API with a dedicated oscommerce SSO c PHP-FPM pool and TLS vhost are separate from Azuriom. Installer paths, .git, configuration, SQL and downloads are denied at the web server. No credentials belong in this directory. Backend theme proposal: Tabler (https://tabler.io), MIT licensed. This requires an adapter; it has not been installed over the native backend. + + +## Catalogue and storefront update + +The portal now embeds `/catalog/dune-shop?currency=EUR`. `DuneShopController.php` belongs in `lib/frontend/controllers/`; `dune-shop-cards.css` is served at the app root and linked by the portal publisher's native layout adapter. + +`import-shop-catalog.py` imports the 12 original sash products and the four mapped donor packages from the preserved Azuriom schema. `dune_catalog_import` records source package IDs and prevents duplicates. The user's existing Aerdrecht product is retained as product 76, including its artwork. Donor manufacturer is DuneRealms; existing rank delivery mappings are recorded, but this importer never grants ranks. + +Sashes are made to order with unlimited stock, a required preferred embroidery name, and standard/silver (+EUR50)/gold (+EUR75) SIDE edging. These options do not alter the bottom cord/fringe. Prices use the installation's current 20% tax setup and source EUR display prices; review real tax and shipping configuration before enabling checkout. All imported products remain previews: no purchasing or fulfillment is enabled. + +`DuneProductRules.php` belongs in `lib/frontend/components/`; `install-sash-rules.py` hooks validation into native cart handling. `finish-catalog-edging.py` and `final-shop-settings.py` complete native option/stock setup. These are controlled, existing-installation migrations, not automatic scripts to run against an arbitrary osCommerce database. + +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. diff --git a/website/ops/oscommerce/dune-shop-cards.css b/website/ops/oscommerce/dune-shop-cards.css new file mode 100644 index 00000000..21bbdc01 --- /dev/null +++ b/website/ops/oscommerce/dune-shop-cards.css @@ -0,0 +1,36 @@ +/* DuneRealms dev alpha storefront: readable framed cards and specification rows. */ +html,body{height:auto!important;min-height:0!important}.main-content{min-height:280px!important} +.w-logo,.warrantyProduct,.tripleBanner,#box-110187{display:none!important} +.main-content .title,.main-content .heading,.main-content .categories-title,.main-content strong{color:#e8d39b!important} +.w-product-model,.w-product-description-short,.w-product-description,.w-product-properties,.productNavigation{background:linear-gradient(135deg,#1b3d30,#102a21)!important;border:1px solid #8e7b48!important;border-radius:13px!important;box-shadow:0 7px 22px #0002!important;padding:20px!important;margin-bottom:16px!important;box-sizing:border-box!important} +.productNavigation{border-top:3px solid #c5a65a!important}.productNavigation .block{background:transparent!important} +.w-product-description-short{line-height:1.7!important}.w-product-model{font-size:13px!important;letter-spacing:.025em;color:#c4cfbc!important} +.w-product-attributes .select-box{display:block!important;padding:0 0 18px!important;margin:0 0 18px!important;border-bottom:1px solid #526341!important}.w-product-attributes .attr-title{display:block!important;font-size:14px!important;font-weight:600!important;color:#e7d7b0!important;margin-bottom:10px!important;line-height:1.5!important} +.w-product-attributes input[type=text],.w-product-attributes select:not([style*="display:none"]){width:100%!important;min-height:46px!important;padding:12px 14px!important;box-sizing:border-box!important;background:#091f18!important;border:1px solid #9f8c55!important;border-radius:8px!important;color:#fff0cb!important;font-size:15px!important}.w-product-attributes input::placeholder{color:#a3b6a5!important}.w-product-attributes input:focus{outline:2px solid #d8b65e!important;outline-offset:3px} +.w-product-price,.w-product-price *,.product-price-current,.price-current,#product-price-current,#product-price-current *{color:#f1d58a!important;opacity:1!important}.w-product-price{font-size:30px!important;font-weight:700!important;margin:12px 0!important}.w-product-stock{color:#e4c890!important}.w-product-quantity input{color:#f4ead2!important} +.w-product-properties{max-width:none!important;padding:0!important;overflow:hidden!important}.product-properties{width:100%!important;max-width:none!important;font-size:14px!important;line-height:1.65!important} +.product-properties .properties-table,.product-properties .property-ul{display:grid!important;grid-template-columns:minmax(140px,28%) minmax(0,1fr)!important;gap:0!important;width:100%!important;margin:0!important;padding:0!important;list-style:none!important;border-bottom:1px solid #3b5745!important;background:#143227!important;box-sizing:border-box!important} +.product-properties .property-ul:nth-child(even),.product-properties .properties-table:nth-child(even){background:#193a2c!important}.product-properties li{float:none!important;display:block!important;width:auto!important;max-width:none!important;padding:13px 18px!important;margin:0!important;box-sizing:border-box!important;text-align:left!important}.product-properties li:first-child{background:#0d251d80!important;border-right:1px solid #3b5745!important}.product-properties a,.product-properties span{color:#dce6d3!important;text-decoration:none!important}.product-properties strong,.product-properties strong span{color:#ddc586!important;font-weight:600!important} +.w-product-images{padding:18px!important;background:radial-gradient(ellipse,#274b35,#10271e 75%)!important;border:1px solid #746943!important;border-radius:14px!important;box-sizing:border-box!important}.w-product-images .img-holder,.w-product-images .produst-image{height:380px!important;max-height:380px!important;padding-top:0!important;overflow:hidden!important}.w-product-images img{height:360px!important;max-height:360px!important;width:auto!important;max-width:100%!important;object-fit:contain!important;cursor:zoom-in}.w-product-images .additional-images img{height:64px!important;max-height:64px!important}.w-product-images a[data-fancybox-group]{display:flex!important;justify-content:center;align-items:center;height:100%!important} +.w-product-images:after{content:'Click image to view full size';display:block;text-align:center;font-size:11px;color:#b9c9ad;padding-top:12px;letter-spacing:.035em}.main-content .btn,.main-content button{min-height:38px!important;font-size:13px!important} +@media(max-width:680px){.product-properties .properties-table,.product-properties .property-ul{grid-template-columns:1fr!important}.product-properties li:first-child{border-right:0!important;padding-bottom:4px!important}.product-properties li+li{padding-top:4px!important}.w-product-images .img-holder,.w-product-images .produst-image{height:300px!important}.w-product-images img{height:280px!important;max-height:280px!important}} +/* Balanced product columns with independent, consistently spaced cards. */ +#box-110822{display:grid!important;grid-template-columns:minmax(250px,30%) minmax(0,1fr)!important;gap:24px!important;max-width:1200px!important;margin:24px auto!important;padding:0!important;align-items:start!important}#box-110822>.block,#box-110830>.block{float:none!important;width:auto!important;min-width:0!important;padding:0!important;margin:0!important}#box-110830{display:grid!important;grid-template-columns:minmax(190px,1fr) minmax(270px,1.25fr)!important;gap:24px!important;padding:0!important;align-items:start!important}#box-110838,#box-110841{padding:0!important}#box-110839{width:100%!important;margin:0!important;padding:22px!important}.w-product-model,.w-product-description-short{text-align:center!important;margin:0 0 18px!important}.w-product-images{margin:0!important}.w-product-name{text-align:center!important}#product-attributes{display:flex!important;flex-direction:column!important;gap:18px!important}.w-product-attributes .select-box{float:none!important;clear:both!important;width:100%!important;min-width:0!important;margin:0!important;padding:0 0 18px!important;box-sizing:border-box!important}.w-product-attributes .textinput,.w-product-attributes .js-attr-text-input{display:block!important;width:100%!important;max-width:none!important}.w-product-attributes select{width:100%!important;max-width:none!important}.w-product-price,.w-product-stock,.w-product-quantity,.w-product-buttons{text-align:center!important}.main-content:has(input[name="products_id"][value="76"]) .w-product-quantity{display:none!important}.main-content:has(input[name="products_id"][value="76"]) .productNavigation:after{content:'Collection preview · ordering is not open';display:block;margin-top:18px;padding:12px;border:1px solid #6f7149;border-radius:8px;background:#253f2d;color:#e4d6ad;font-size:12px;line-height:1.5;text-align:center} +@media(max-width:1050px){#box-110822{grid-template-columns:minmax(220px,35%) minmax(0,1fr)!important;gap:20px!important}#box-110830{grid-template-columns:1fr!important;gap:0!important}}@media(max-width:650px){#box-110822{grid-template-columns:1fr!important;gap:20px!important}.w-product-images{max-width:340px!important;width:100%!important;margin:auto!important}#box-110839{padding:18px!important}} +/* Dev alpha table rhythm: alternating rows and a restrained hover highlight. */ +.main-content table{border:1px solid #756b45!important;border-collapse:separate!important;border-spacing:0!important;border-radius:11px!important;overflow:hidden!important;width:100%!important}.main-content table th{background:#244b36!important;color:#e8cd87!important;font-size:12px!important;letter-spacing:.035em!important;padding:13px 16px!important;text-align:left!important}.main-content table tbody tr:nth-child(odd){background:#102b21!important}.main-content table tbody tr:nth-child(even){background:#1b3a2c!important}.main-content table td{color:#e0e7d6!important;padding:13px 16px!important;border-bottom:1px solid #355340!important}.main-content table tbody tr:hover{background:#294a34!important}.product-properties .property-ul:nth-child(odd),.product-properties>.properties-table:nth-child(odd){background:#102b21!important}.product-properties .property-ul:nth-child(even),.product-properties>.properties-table:nth-child(even){background:#1b3a2c!important}.product-properties .property-ul:hover,.product-properties .properties-table:hover{background:#294a34!important;transition:background .15s} +/* Product tabs use the same dev-alpha card treatment, including every state. */ +.w-tabs>.tab-navigation{display:flex!important;gap:12px!important;padding:0 0 16px!important;background:transparent!important;border:0!important}.w-tabs>.tab-navigation>.tab-li{flex:1!important;float:none!important;margin:0!important;border:0!important;background:transparent!important}.w-tabs .tab-navigation .tab-a,.w-tabs .accordion-heading{display:block!important;padding:16px 20px!important;border:1px solid #756c45!important;border-radius:10px!important;background:linear-gradient(135deg,#1c3e2e,#10291f)!important;color:#d8c391!important;font-size:15px!important;font-weight:600!important;line-height:1.4!important;text-align:center!important;box-shadow:0 4px 14px #0002!important}.w-tabs .tab-navigation .active .tab-a,.w-tabs .tab-navigation .tab-li.active .tab-a,.w-tabs .tab-navigation .tab-a.active,.w-tabs .accordion-heading.active{background:linear-gradient(135deg,#315238,#1a3828)!important;border-color:#cfaf59!important;color:#fff0c4!important;box-shadow:inset 0 2px #d6b35c,0 4px 14px #0002!important}.w-tabs .tab-navigation .tab-a:hover{background:#294b34!important;color:#fff0c4!important}.w-tabs>.block{background:transparent!important;border:0!important;padding:0!important}.w-tabs .tab-navigation .tab-a:focus-visible{outline:2px solid #e2c06c!important;outline-offset:3px}@media(max-width:500px){.w-tabs>.tab-navigation{gap:8px!important}.w-tabs .tab-navigation .tab-a{padding:12px 8px!important;font-size:13px!important}} +/* Catalogue cards keep tall artwork at thumbnail scale. */ +.products-listing{display:grid!important;grid-template-columns:repeat(auto-fill,minmax(235px,1fr))!important;gap:22px!important;align-items:start!important}.products-listing>.item{float:none!important;clear:none!important;width:auto!important;max-width:340px!important;margin:0 auto!important;padding:0!important;box-sizing:border-box!important;border:1px solid #7a7047!important;border-radius:13px!important;overflow:hidden!important;background:linear-gradient(140deg,#1e402f,#10281f)!important;box-shadow:0 8px 22px #0002!important}.products-listing .item-holder,.products-listing .item-wrapper,.products-listing .item-content{background:transparent!important}.products-listing .item-content{padding:18px!important;text-align:center!important}.products-listing .image{height:270px!important;display:flex!important;align-items:center!important;justify-content:center!important;margin:0 0 16px!important;background:radial-gradient(ellipse,#294b35,transparent 75%)!important}.products-listing .image a,.products-listing .image picture{display:flex!important;align-items:center!important;justify-content:center!important;height:100%!important;width:100%!important}.products-listing .image img{height:250px!important;max-height:250px!important;max-width:100%!important;width:auto!important;object-fit:contain!important}.products-listing .price,.products-listing .price *{color:#f1d58a!important;font-size:24px!important;font-weight:700!important;opacity:1!important}.products-listing .name h2{font-size:18px!important;line-height:1.4!important;margin:12px 0!important}.products-listing .description{color:#bdcfbb!important;font-size:13px!important;line-height:1.6!important}.products-listing .item-nav{display:flex!important;align-items:center!important;justify-content:center!important;gap:14px!important;background:#10291f!important;padding:14px!important;border-top:1px solid #465d41!important}.products-listing .compare{font-size:11px!important;color:#bac9ae!important}.products-listing .out-stock{color:#c9b779!important;font-size:12px!important}.w-catalog-title h1{font-size:28px!important}.leftCategories,.leftCategories a,.w-catalog-counts-items{color:#d9d6ba!important} +.header-middle .w-image{display:none!important}.header-middle{background:linear-gradient(110deg,#102d22ec,#153629de),url('https://www.dunerealms.com/assets/sietch.webp') center 45%/cover!important;padding:22px!important;border:1px solid #7a7047!important;border-radius:12px!important}.header-middle>.block{gap:22px!important}.header-middle .w-search{flex:1!important;min-width:180px!important}.header-middle .search-input{background:#0a2019!important;border:1px solid #8f8050!important;border-radius:8px!important;color:#eee4c9!important;min-height:44px!important}.w-cart .cart-icon,.w-account .account-icon{background:#294a32!important;color:#e0c47a!important}.header-menu-holder a{font-size:13px!important;letter-spacing:.04em!important;color:#e1cc94!important}.header-menu-holder a:hover{background:#294a32!important}.footer-bottom{background:#10271e!important;color:#9db39e!important}.w-catalog-view .active{background:#34563b!important;color:#f0d692!important}.w-catalog-view a{color:#dac381!important}.w-search input{color:#f3e8cc!important}.w-languages,.w-currencies{color:#dfd5b9!important} +/* Commercial storefront home, using real catalogue data. */ +.dune-store-welcome{display:flex;align-items:center;justify-content:space-between;gap:28px;border:1px solid #9a8349;border-radius:16px;padding:40px;margin:0 auto 24px;background:linear-gradient(100deg,#0b261aec,#173c2cc7),url('https://www.dunerealms.com/assets/sietch.webp') center/cover;box-shadow:0 12px 30px #0003}.dune-store-welcome small{color:#ceb36e;letter-spacing:.16em;font-size:11px}.dune-store-welcome h1{font-size:clamp(28px,3vw,43px);line-height:1.15;margin:14px 0!important;max-width:600px}.dune-store-welcome p{font-size:15px;line-height:1.7;color:#ccd9c4;max-width:570px;margin-bottom:24px}.dune-store-welcome>img{width:155px;height:155px;object-fit:contain;filter:drop-shadow(0 8px 18px #0008)}.dune-store-button{display:inline-flex!important;align-items:center;justify-content:center;padding:11px 18px;border:1px solid #b79a53;border-radius:8px;background:linear-gradient(#385b39,#23422c);color:#f5e1ad!important;font-size:13px;font-weight:600;text-decoration:none!important;box-shadow:0 4px 12px #0003}.dune-store-button:hover{background:#416345;transform:translateY(-1px)} +.dune-store-categories{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:18px;margin-bottom:34px}.dune-store-categories>a{display:flex;align-items:center;gap:16px;padding:22px;border:1px solid #6e7046;border-radius:12px;background:linear-gradient(130deg,#21412e,#112b20);text-decoration:none!important;transition:border-color .15s,transform .15s}.dune-store-categories>a:hover{border-color:#d4b369;transform:translateY(-2px)}.dune-store-categories img{width:58px;height:58px;object-fit:contain}.dune-store-categories h2{font-size:17px!important;margin:0 0 6px!important}.dune-store-categories p{margin:0;color:#afc2aa;font-size:12px;line-height:1.5}.dune-store-categories span{margin-left:auto;color:#dfc37f;font-size:20px}.dune-store-section{margin:0 0 32px;border:1px solid #486143;border-radius:13px;padding:24px;background:#102a20}.dune-store-section>header{display:flex;align-items:center;justify-content:space-between;gap:18px;margin-bottom:22px;padding-bottom:16px;border-bottom:1px solid #425b40}.dune-store-section h2{font-size:23px!important;margin:0 0 7px!important}.dune-store-section header p{margin:0;color:#aabea5;font-size:12px}.dune-store-section header>a{font-size:12px;color:#d9be7b!important;white-space:nowrap}.dune-store-products{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:20px}.dune-store-products article{display:flex;flex-direction:column;align-items:center;text-align:center;border:1px solid #536a47;border-radius:11px;background:linear-gradient(145deg,#1b3b29,#0c251b);padding:18px;box-sizing:border-box}.dune-store-product-art{display:flex;align-items:center;justify-content:center;width:100%;height:230px;margin-bottom:16px;background:radial-gradient(ellipse,#2f5033,transparent 72%)}.dune-store-product-art img{display:block!important;height:220px!important;max-height:220px!important;max-width:100%!important;width:auto!important;object-fit:contain}.dune-store-products small{font-size:9px;letter-spacing:.12em;color:#b8a66e}.dune-store-products h3{font-size:16px!important;line-height:1.45;margin:10px 0!important}.dune-store-products h3 a{color:#e6d5a3!important;text-decoration:none}.dune-store-price{font-size:23px;font-weight:700;color:#f1d28a;margin:auto 0 16px;padding-top:8px}.dune-store-products .dune-store-button{width:100%;box-sizing:border-box}.dune-store-empty{border:1px dashed #566849;border-radius:9px;padding:26px;color:#afc1a5;text-align:center;font-size:13px;background:#183223}.dune-store-preview{border-left:3px solid #b99850;border-radius:9px;background:#243c28;padding:20px 24px;color:#cad5ba;font-size:13px;line-height:1.7}.dune-store-preview strong{color:#e1c785}.dune-store-preview p{margin:6px 0 0} +@media(min-width:1500px){.dune-store-products{grid-template-columns:repeat(4,minmax(0,1fr))}}@media(max-width:900px){.dune-store-categories{grid-template-columns:1fr}.dune-store-products{grid-template-columns:repeat(2,minmax(0,1fr))}.dune-store-welcome{padding:28px}.dune-store-welcome>img{width:110px;height:110px}}@media(max-width:550px){.dune-store-welcome{padding:24px;gap:12px}.dune-store-welcome>img{display:none}.dune-store-products{grid-template-columns:1fr}.dune-store-section{padding:18px}.dune-store-section>header{align-items:flex-start}.dune-store-product-art{height:210px}.dune-store-product-art img{height:200px!important}.header-middle>.block{flex-wrap:wrap!important;justify-content:center!important}.header-middle .w-search{flex-basis:100%!important}} +/* Catalogue navigation, filtering and pagination share the framed dev-alpha system. */ +#box-110903{padding:0!important;background:transparent!important}#box-110904{padding:20px!important;border:1px solid #6b7048!important;border-radius:12px!important;background:linear-gradient(145deg,#1a3b2b,#10291f)!important;box-sizing:border-box!important}#box-110904 h2,#box-110904 h3,#box-110904 .title,.leftCategories .title{color:#e5ce8e!important;font-size:16px!important;font-weight:600!important}.leftCategories ul{list-style:none!important;padding:0!important}.leftCategories a,.w-categories a,.w-menu-simple a{display:block;padding:10px 12px!important;border-radius:7px;color:#d5dfca!important;font-size:13px!important;text-decoration:none!important}.leftCategories a:hover,.w-categories a:hover,.w-menu-simple a:hover{background:#2c4c34!important;color:#f3dd9d!important}.w-catalog-sorting,.w-catalog-items-on-page,.w-catalog-listing-look,.w-catalog-compare-button{padding:10px 12px!important;background:#112b20!important;border:1px solid #4f6544!important;border-radius:8px!important;color:#bfcfb5!important;font-size:12px!important;box-sizing:border-box!important}.w-catalog-sorting select,.w-catalog-items-on-page select{padding:8px 10px!important;border:1px solid #8b7b4b!important;border-radius:7px!important;min-height:36px!important;background:#0b2119!important;color:#eadbb2!important}.w-catalog-counts-items{padding:12px 0!important;font-size:12px!important;color:#aabfa4!important}.w-catalog-paging a,.w-catalog-paging span{border-color:#687146!important;border-radius:6px!important;color:#dfca90!important;background:#163223!important}.w-catalog-paging .active,.w-catalog-paging .current{background:#355237!important;border-color:#bea058!important;color:#fff0c4!important}.w-catalog-listing-look a{color:#e1cb8e!important}.products-listing .item-nav,.products-listing .compare label{color:#bfccb3!important;background:#10291f!important}.products-listing .view-button{min-width:85px!important}.products-listing .instock,.products-listing .in-stock{color:#b6d6ad!important;font-size:12px!important}.w-catalog-b2b-add-button{display:none!important}.w-catalog-title h1{color:#eed99e!important;padding:4px 0!important}.main-content .filter-box,.main-content .filters{border:1px solid #4b6241!important;border-radius:9px!important;padding:14px!important;background:#102b20!important;color:#d3dec7!important}.main-content input[type=checkbox]{accent-color:#b59a53!important}.products-listing .item{transition:border-color .15s,box-shadow .15s}.products-listing .item:hover{border-color:#c5a75c!important;box-shadow:0 10px 28px #0004!important} +/* Active promotions get a restrained commercial sale treatment. */ +.dune-store-category--sale{background:linear-gradient(125deg,#542e2a,#292d21)!important;border-color:#b08855!important}.dune-store-category--sale>span{font-size:10px!important;letter-spacing:.1em!important;background:#a24636;border:1px solid #ce8f63;border-radius:5px;padding:6px 8px;color:#fff0cb!important}.dune-store-section--sale{background:linear-gradient(120deg,#38281f,#172e21 65%)!important;border-color:#b08a53!important;border-top:3px solid #b77949!important;box-shadow:0 8px 24px #0003}.dune-store-section--sale>header{border-color:#805b40!important}.dune-store-sale-label{display:inline-block;vertical-align:middle;font-size:10px;line-height:1.2;letter-spacing:.1em;background:#a54737;color:#fff1cf;padding:6px 9px;border:1px solid #d48b60;border-radius:5px;margin-right:8px}.dune-store-section--sale article{border-color:#8c7147!important;background:linear-gradient(145deg,#302f20,#10271b)!important}.dune-store-price del{display:block;color:#a9b3a1;font-size:13px;font-weight:400;margin-bottom:5px}.dune-store-price strong{display:block;color:#f3d28a!important}.dune-store-saving{display:inline-block;font-size:10px;font-weight:600;letter-spacing:.025em;background:#8f3d2e;color:#ffe6b3;border:1px solid #bd7850;border-radius:4px;padding:4px 7px;margin-top:8px} +/* Featured collection: warm gold, distinct from active sale promotions. */ +.dune-store-section--featured{border:1px solid #baa15d!important;border-top:3px solid #dfc575!important;background:radial-gradient(ellipse at 35% 0,#7b6b3038,transparent 65%),linear-gradient(125deg,#263d27,#142b1e)!important;box-shadow:0 8px 28px #cfa74612!important}.dune-store-section--featured>header{border-bottom-color:#8d7b47!important}.dune-store-section--featured h2{color:#f3da92!important}.dune-store-section--featured header>a{color:#edd18b!important}.dune-store-section--featured article{border-color:#9a854c!important;background:linear-gradient(145deg,#31462b,#112a1e)!important}.dune-store-section--featured .dune-store-product-art{background:radial-gradient(ellipse,#8b7a394d,transparent 70%)}.dune-store-section--featured .dune-store-button{background:linear-gradient(#655d2e,#3a4829)!important;border-color:#c4a65c!important;color:#fff0c3!important}.dune-store-section--featured .dune-store-empty{border-color:#99844a!important;background:#37492a!important;color:#decf9c!important} diff --git a/website/ops/oscommerce/enable-season-test-order.py b/website/ops/oscommerce/enable-season-test-order.py new file mode 100644 index 00000000..ccc9be76 --- /dev/null +++ b/website/ops/oscommerce/enable-season-test-order.py @@ -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='

A keepsake of The Quest for Tavren II Aedrecht, with the lantern and map of an unfolding journey.

Test ordering is available. 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.

Bank transfer — test order: no payment is required for this example. Do not transfer money. Orders remain awaiting payment; no production or dispatch starts automatically.

' +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.') diff --git a/website/ops/oscommerce/final-shop-settings.py b/website/ops/oscommerce/final-shop-settings.py new file mode 100644 index 00000000..2e05337b --- /dev/null +++ b/website/ops/oscommerce/final-shop-settings.py @@ -0,0 +1,31 @@ +from pathlib import Path +import subprocess,shutil,re +app=Path('/home/dunerealms/apps/oscommerce');repo=Path('/home/dunerealms/oscommerce-integration/website') +sql="""INSERT INTO products_stock_indication(sort_order,is_default,stock_code,allow_out_of_stock_checkout,allow_out_of_stock_add_to_cart,allow_in_stock_notify,display_price_options) +SELECT 10,0,'made-to-order',0,0,0,0 WHERE NOT EXISTS(SELECT 1 FROM products_stock_indication WHERE stock_code='made-to-order'); +INSERT IGNORE INTO products_stock_indication_text(stock_indication_id,language_id,stock_indication_text,stock_indication_short_text) +SELECT stock_indication_id,1,'Made to order','Made to order' FROM products_stock_indication WHERE stock_code='made-to-order'; +UPDATE products p JOIN dune_catalog_import d ON d.products_id=p.products_id AND d.kind='sash' SET p.stock_indication_id=(SELECT stock_indication_id FROM products_stock_indication WHERE stock_code='made-to-order' LIMIT 1),p.manual_stock_unlimited=1; +INSERT IGNORE INTO dune_product_requirements SELECT products_id,0,1 FROM dune_catalog_import WHERE kind='rank'; +UPDATE meta_tags SET meta_tags_value='The collection' WHERE meta_tags_key='HEAD_H1_TAG_PRODUCTS_ALL' AND language_id=1 AND platform_id=7; +UPDATE meta_tags SET meta_tags_value='New arrivals' WHERE meta_tags_key='HEAD_H1_TAG_WHATS_NEW' AND language_id=1 AND platform_id=7; +UPDATE meta_tags SET meta_tags_value='Featured products' WHERE meta_tags_key='HEAD_H1_TAG_FEATURED' AND language_id=1 AND platform_id=7; +""" +subprocess.run(['mysql','dunerealms_oscommerce'],input=sql,text=True,check=True,capture_output=True) +# Use a visible label for native selectable options as well as the custom-name field. +p=app/'lib/frontend/themes/basic/boxes/product/attributes/select.tpl';s=p.read_text() +needle=' 0)}{$item.title|escape:'html'}{/if}\n