v3.4.1 Phoenix Engineering
Forget complex templates. If you know HTML, CSS, and basic PHP, you are already qualified to build themes for PurifyCMS.
themes/
your-theme/
theme.json // Meta: Version, Author, Build Date
assets/ // CSS, JS, Images
src/ // Components: header.php, footer.php
pages/ // Routes: about.php, product.php, shop.php
Routing is automatic. Creating pages/services.php makes yourdomain.com/services available immediately.
The Global Data Matrix (v3.4.1 Refined)
PurifyCMS injects critical system data into every single page. You can invoke them anywhere using <?= $variable ?>.
-
$cfg_mainurlString Absolute URL. E.g., "https://nywhash.com" -
$cfg_enable_ecommerceBoolean Global E-commerce toggle. -
$cfg_ecommerce_currencyString Default currency code. "TRY", "USD", etc. -
$cfg_active_themeString Current theme folder name. -
$cfg_logolinkString Dynamic logo source path.
Phoenix E-Commerce (v3.4.1)
The v3.4.1 suite enables high-performance product management with SEO-friendly slugs.
Fetching Products (Dynamic Loop)
require_once __DIR__ . '/../../../inc/PurifyTrade.php';
$products_file = __DIR__ . '/../../../inc/data/ecommerce/products.json';
$products = file_exists($products_file) ? json_decode(file_get_contents($products_file), true) : [];
foreach($products as $id => $p) {
// Generate SEO Link
$link = $cfg_mainurl . '/product/' . ($p['slug'] ?? $id);
echo "<a href='$link'>" . $p['title'] . "</a>";
}
Product Detail Pattern
In product.php, the system automatically injects the $p variable if accessed via a slug. Use the following fields:
$p['title']: Rich product name.$p['price']: Net formatted price.$p['description']: HTML-enabled content (TinyMCE).$p['image']: Primary visual asset path.
Smart Variation Groups
Variations are now grouped by type. You must render them dynamically based on the group logic.
<?php foreach ($p['variation_groups'] as $vg): ?>
<h3><?= $vg['title'] ?></h3>
<?php if ($vg['type'] === 'single'): ?>
<select class="variation-select">
<?php foreach ($vg['options'] as $o): ?>
<option value='<?= json_encode($o) ?>'><?= $o['name'] ?></option>
<?php endforeach; ?>
</select>
<??php else: ?>
<?php foreach ($vg['options'] as $o): ?>
<input type="checkbox" value='<?= json_encode($o) ?>'> <?= $o['name'] ?>
<?php endforeach; ?>
<?php endif; ?>
<?php endforeach; ?>
Zero-Overhead Checkout API
Submit your cart payload to the following high-performance endpoint.
https://www.nywhash.com/api/ecommerce/checkout
const res = await fetch('https://www.nywhash.com/api/ecommerce/checkout', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
customer: { name, email, phone, address },
items: cartArray,
payment_method: 'paytr' // paytr, stripe, iyzico, bank
})
}).then(r => r.json());
// Handle modular gateway response
if (res.status === 'gateway') {
// Redirect or Inject Iframe Modal
}
Perfect Asset Linking
<link rel="stylesheet" href="<?= $cfg_mainurl ?>/themes/<?= $cfg_active_theme ?>/assets/main.css">
NywhashCaptcha Layer
Since v3.2.2, PurifyCMS includes an OCR-resistant Lethal PNG captcha system.
if (isset($cfg_enable_captcha) && $cfg_enable_captcha) {
echo NywhashCaptcha::render();
}