This question has been answered by multiple community members. See the first response.
<div class='product'>
<ul class="product_data">
<li>Product: [[+product_name]]</li>
<li>Description: [[+product_description]]</li>
<li>Price: [[+product_price]]</li>
</ul>
</div>$productId = isset($_GET['pid'])? $_GET['pid'] : 0;
$product = $modx->getObject('modProduct', $productId);
if ($product) {
$fields = $product->toArray();
} else {
return 'Product Not Found';
}
return $modx->getChunk('ProductTpl', $fields);
Could I create a plugin and listen for something like OnHandleRequest or OnWebPageInit to essentially catch the request and route it to my own custom controller/something similar? Just thinking out loud.
Make sure your custom database table has a primary key called id that is an autoincrement field.
&createSchema=`1` &createClasses=`0`
&createSchema=`0` &createClasses=`1`
<?php
// core/components/customrequest/configs/product.config.inc.php
$settings['product.show'] = array(
'resourceId' => 123,
'alias' => 'product/',
'urlParams' => array('productId')
);