Forum

Thread tagged as: Runway, Shop

Product page template is blank

Diagnostics

Perch Runway: 3.0.5, PHP: 7.0.10, MySQL: mysqlnd 5.0.12-dev - 20150407 - $Id: 241ae00989d1995ffcbbf63d579943635faf9972 $, with PDO
Server OS: WINNT, apache2handler
Installed apps: content (3.0.5), assets (3.0.5), categories (3.0.5), perch_forms (1.9), perch_gallery (2.8.9), perch_shop_orders (1.2.1), perch_shop_products (1.2.1), perch_shop (1.2.1), chirp_seo (1.1), perch_members (1.6.2), perch_mailchimp (3.1)
App runtimes: <?php $apps_list = [ 'perch_members', 'perch_forms', 'perch_shop', 'perch_mailchimp', 'perch_gallery', 'chirp_seo', ];
PERCH_LOGINPATH: /perch
PERCH_PATH: D:\wamp\www\perch
PERCH_CORE: D:\wamp\www\perch\core
PERCH_RESFILEPATH: D:\wamp\www\perch\resources
Image manipulation: GD
PHP limits: Max upload 64M, Max POST 8M, Memory: 128M, Total max file upload: 8M
F1: 0c66c2e1f82f9e0b7617b2cb8270f2c7
Resource folder writeable: Yes
HTTP_HOST: 127.0.0.1:80
DOCUMENT_ROOT: D:\wamp\www
REQUEST_URI: /perch/core/settings/diagnostics/
SCRIPT_NAME: /perch/core/settings/diagnostics/index.php

Product.php

<?php perch_layout('global.header'); ?>

<?php
perch_shop_product(perch_get('sku'), [
'template' => 'product.html'
]);
?>

<?php perch_layout('global.footer'); ?>

And doesn't matter what the product template has. Nothing is returned.

Debug

SELECT p.pagePath, pr.routePattern, pr.routeRegExp, p.pageTemplate, pr.routeOrder, s.settingValue AS siteOffline FROM perch3_pages p LEFT JOIN perch3_page_routes pr ON p.pageID=pr.pageID LEFT JOIN perch3_settings s ON s.settingID='siteOffline' UNION SELECT NULL AS pagePath, pr2.routePattern, pr2.routeRegExp, pr2.templatePath AS pageTemplate, pr2.routeOrder, NULL AS siteOffline FROM perch3_page_routes pr2 WHERE templateID!=0 ORDER BY routeOrder ASC, pagePath ASC
Matched route: producto/[productSlug:s]
Using master page: \templates\pages\producto.php
Page arguments:
Array
(
    [0] => /product/570
    [s] => 570
    [1] => 570
)
. . .
Using template: \templates\shop\products\product.html

Page is empty. With headers and footer of course. Routes are set up in runway.php and the URL pattern is set as

product/[productSlug:s]

Lexi McGee

Lexi McGee 3 points

  • 4 years ago
Rachel Andrew

Rachel Andrew 394 points
Perch Support

producto/[productSlug:s]

producto?

Yeah sorry. Fixed and still the same result.

Drew McLellan

Drew McLellan 2638 points
Perch Support

You're using perch_get('sku') but you've named the argument s so they don't match.

Confused the SKU number with the actual product slug which was ''SKU-and-product-name-here''. My bad.