Diff -- /var/www/vhosts/3dshawn.com/shop.3dshawn.com/MODS/ShopCart/DefaultContent.pm
Diff

/var/www/vhosts/3dshawn.com/shop.3dshawn.com/MODS/ShopCart/DefaultContent.pm

added on local at 2026-07-01 22:09:37

Added
+118
lines
Removed
-0
lines
Context
0
unchanged
Blobs
from
to d18560ee24b9
Restore this content →
Unified diff
Naive LCS-based line diff. Additions in emerald, deletions in rose. Both sides decompressed live from BLOB_STORE.
1package MODS::ShopCart::DefaultContent;
2#======================================================================
3# ShopCart -- default seed text for new storefronts.
4#
5# Centralizes placeholder content so every new storefront starts with
6# the same useful drafts that prompt the creator to edit them. Each
7# generator takes the creator's display name and returns text with
8# that name substituted in.
9#
10# Used by storefront.cgi when seeding storefront_pages on first
11# creation, and by any future tool that resets a page to its default.
12#
13# To tweak the wording for ALL new users, edit the strings in this
14# file. Existing users' pages are not touched.
15#======================================================================
16use strict;
17use warnings;
18
19sub new {
20 my ($class) = @_;
21 return bless({}, $class);
22}
23
24#----------------------------------------------------------------------
25# about_body($store_name) -- body of the About page.
26#----------------------------------------------------------------------
27sub about_body {
28 my ($self, $name) = @_;
29 $name = 'this shop' unless defined $name && length $name;
30 return
31 "Welcome to $name. This is the placeholder text on your About page -- "
32 . "click anywhere in this paragraph to start editing it.\n\n"
33 . "Tell visitors how you got started, what kinds of items "
34 . "you sell, and what they can expect when they buy from you. A "
35 . "couple of paragraphs is enough -- buyers skim, so lead with the "
36 . "single sentence that makes your work feel different from anyone "
37 . "else's.\n\n"
38 . "Things worth mentioning here:\n"
39 . " - how you make or source what you sell\n"
40 . " - how often you release new items\n"
41 . " - where else people can find you (Patreon, Instagram, Discord)\n"
42 . " - your refund / support policy in plain language\n\n"
43 . "When you are done, hit Save changes at the top of the page editor.";
44}
45
46#----------------------------------------------------------------------
47# home_body($store_name) -- body slot for the Home page (most layouts
48# render the layout's own hero before this, so keep it short).
49#----------------------------------------------------------------------
50sub home_body {
51 my ($self, $name) = @_;
52 return "";
53}
54
55#----------------------------------------------------------------------
56# collection_body($store_name) -- body for the auto-created Catalog
57# page (page_type='collection'). The product grid renders below this
58# text automatically, so keep the body short and pitch-driven.
59#----------------------------------------------------------------------
60sub collection_body {
61 my ($self, $name) = @_;
62 $name = 'this shop' unless defined $name && length $name;
63 return "Every item from $name, in one place. Click an item to see "
64 . "details, options, and what's included.";
65}
66
67#----------------------------------------------------------------------
68# custom_page_body($store_name) -- placeholder when the user creates
69# a brand-new custom page from the editor.
70#----------------------------------------------------------------------
71sub custom_page_body {
72 my ($self, $name) = @_;
73 return "Start typing to replace this placeholder with your own content. "
74 . "Drag images right onto the page, paste screenshots from your "
75 . "clipboard, or use the toolbar on the left for formatting.";
76}
77
78#----------------------------------------------------------------------
79# details_body($store_name) -- body for the system-seeded "Listing
80# Details" page (page_type='product'). This page is template-driven
81# by listing_details.cgi -- the same layout renders for every product
82# on the storefront -- so the body here is informational copy telling
83# the seller what the page is and how to preview it. The Pages admin's
84# "View" button maps page_type='product' to listing_details.cgi with
85# the seller's first published model_id so the preview shows a real
86# product.
87#----------------------------------------------------------------------
88sub details_body {
89 my ($self, $name) = @_;
90 $name = 'this storefront' unless defined $name && length $name;
91 return "This is the per-item detail page template for $name. "
92 . "Buyers see this when they click any item card on your store -- "
93 . "hero image, gallery, description, files included, "
94 . "and an Add-to-Cart panel.\n\n"
95 . "There's nothing to edit on this page directly. Every item "
96 . "renders the same template with that listing's own title, "
97 . "description, files, and images. To change what appears for a "
98 . "specific item, edit the listing in My Listings. To preview "
99 . "this template with real data, click \"View\" on the right -- "
100 . "we'll open it for your first published item.";
101}
102
103#----------------------------------------------------------------------
104# Helper: escape a body string for inline-SQL insertion. Returns the
105# escaped scalar; the caller wraps it in quotes inside the qq~~ INSERT.
106#----------------------------------------------------------------------
107sub sql_escape {
108 my ($self, $s) = @_;
109 $s = '' unless defined $s;
110 $s =~ s/\\/\\\\/g;
111 $s =~ s/'/\\'/g;
112 $s =~ s/"/\\"/g;
113 $s =~ s/\n/\\n/g;
114 $s =~ s/\r//g;
115 return $s;
116}
117
1181;
Keyboard: j next diff k previous diff g top G bottom r restore c compile-check ? help