Write theme file

ps_write_theme_file

Write · preview + approveTheme · switch, 24 hTellMyShop Pro onlySaves: Theme switch (24 h)Visible right after install

Changes a file of your shop's look, with a backup made first.

TellMyShop Free: No. This tool is only in TellMyShop Pro. TellMyShop Free has only ready reports that read your store.

Ask Claude

„Add a line "Free delivery over 250 PLN" under the price on the product page.”

Example preview

templates/catalog/_partials/product-prices.tpl
@@ line 88 @@
   {/block}
+  <p class="free-delivery">{l s='Free delivery over 250 PLN' d='Shop.Theme.Catalog'}</p>
Smarty validation: OK. New scripts: none. Backup will be created before saving.

Technical details

Changes a file of the ACTIVE theme (.tpl, .css, .js, .json): replaces a fragment (search -> replace; the fragment must appear exactly once) or writes the whole content (content, also a new file such as assets/css/custom.css). Small visual fixes are best done in assets/css/custom.css and assets/js/custom.js, which PrestaShop loads on every page. Before saving: validation (Smarty: allowed tags and modifiers only, plus compilation; JSON: syntax), warnings about new scripts and external domains, automatic backup. For module template overrides use ps_override_module_template. Saving needs the Theme switch.

Parameters

NameTypeRequiredDescription
pathstringyesPath in the active theme, for example templates/catalog/product.tpl. Max 300 characters.
searchstringnoExact fragment to replace (with whitespace, as in the file). Max 100,000 characters.
replacestringnoNew fragment (together with search). Max 100,000 characters.
contentstringnoWhole new file content (instead of search/replace). Max 500,000 characters.
confirmbooleannofalse (default) returns a preview and saves nothing. true executes, only after the user approved the preview, together with change_token.
change_tokenstringwhen: confirm=trueToken from the preview. Required with confirm=true. Valid 30 minutes, single use, bound to the previewed arguments and data state.

Limits

20 file writes per hour, shared by all file tools (adjustable in the Settings: security, alerts, limits card). Active theme only; the parent theme is read-only. Extensions .tpl, .css, .js, .json. After saving: ps_clear_cache and ps_inspect_page.

What you see before anything is saved

Claude first calls the tool without confirming it. The module returns a preview (current and new values) and a single-use token valid for 30 minutes. Claude shows you the preview and saves the change only after your yes.

Related tools

Use cases with this tool

Last updated: 2026-10-11