Forum
Runway and Shop 404 on product
Hi
This is only my second time on Runway and first using Runway and Shop and I'm getting a 404 when I try and view a product.
I'm using;
<?php perch_shop_products();?>
on the home page to display the products, and here is my list template;
<div class="col-sm-4 col-md-3">
<div class="product-box">
<div class="product-image">
<a href="/shop/products/<perch:shop id="slug" type="slug" />/"><img src="<perch:shop type="image" id="image" label="Image" width="200" height="200" density="1.6" crop="true" />" class="img-responsive rounded-corners" /></a>
</div>
<div class="product-box-text text-center">
<a class="btn btn-primary btn-lg btn-caps" href="/shop/products/<perch:shop id="slug" type="slug" />">VIEW</a>
</div>
</div>
</div>
and I've setup a Product page in Perch Runway which has;
<?php perch_shop_product(); ?>
with the url routing of 'shop/products'
In settings, Product url is set to '/shop/products/{slug}'
Summary information
Perch Runway: 3.0.4, PHP: 5.6.10, MySQL: mysqlnd 5.0.11-dev - 20120503 - $Id: 3c688b6bbc30d36af3ac34fdd4b7b5b787fe5555 $, with PDO
Server OS: Darwin, cgi-fcgi
Installed apps: content (3.0.4), assets (3.0.4), categories (3.0.4), perch_shop_orders (1.2), perch_shop_products (1.2), perch_shop (1.2), perch_members (1.6.1)
App runtimes: <?php $apps_list = array( 'content', 'categories', 'perch_members', 'perch_shop', );
PERCH_LOGINPATH: /perch
PERCH_PATH: /Users/hoops78/Documents/stotto/perch
PERCH_CORE: /Users/hoops78/Documents/stotto/perch/core
PERCH_RESFILEPATH: /Users/hoops78/Documents/stotto/perch/resources
Image manipulation: GD
PHP limits: Max upload 32M, Max POST 32M, Memory: 128M, Total max file upload: 32M
F1: 0c66c2e1f82f9e0b7617b2cb8270f2c7
Resource folder writeable: Yes
SCRIPT_NAME: /perch/core/settings/diagnostics/index.php
REQUEST_URI: /perch/core/settings/diagnostics/
DOCUMENT_ROOT: /Users/hoops78/Documents/stotto
HTTP_HOST: stotto
But I'm getting a 404 error when I try and view the product(s). Am I missing something you need to do with Runway?
Hi Wayne
Try using [slug:product] to get the product slug, rather than {slug}.
Jon
Thanks for the suggestion, but I still get a 404 doing that.
You probably also need to filter on the product function. I'm not sure what the default product function would do.
So something like:
Thanks, but still goes to a 404...
So you have /shop/product/ set as the product page path
And the routing pointing to shop/[slug:product]?
If so have you checked that you've got no other routes set to that path structure confusing the issue?
Thats correct... I have /shop/product/ on the product page and updated the setting to shop/[slug:product]. I haven't got far with the site, so there isn't any other routes setup at the moment. Thought I found out the issue, as list.html references shop/products rather than shop/product, but changing it still 404's.
New list.html
Are you sure your route is set to shop/product/[slug:product] and not shop/products/[slug:product] – you started off the thread quoting "products".
You might be wise to set up routing on a standard page and see if that works first. Judging by a previous post you've had issues setting Runway & Shop up and this may be an ongoing issue.
Hi Jonathan
It was with an 's', but I changed it to shop/product/[slug:product] and I'm still getting a 404...
What does debug say on the 404 page?
it says;
I know I need to edit the 404.php file as there are some regions missing that aren't needed.
Morning
I've tried re-looking at this with fresh eyes, but still getting a 404. As I've changed a few things, heres a re-cap;
I'm using;
<?php perch_shop_products();?>
on the home page to display the products, and here is my list template;Here is my list.html;
and I've setup a Product page in Perch Runway which has;
with the url routing of 'shop/products'
and the product url in settings is set to 'shop/product/[slug:product]'
Debug and Diagnostics are the same as before
What's the URL when you get a 404, and what does the corresponding route look like?
Hi Drew
The url is;
https://stotto/shop/product/ballast-stothg0004
for example, so it looks correct using the /shop/product/ starting and the product slug is correct.
Wayne
What's the route that you're trying to match them with?
Maybe thats what I'm missing. Is that something I should set?
I have setup a product page in Runway with the URL route of shop/product
Is this what you meant?
Hi Wayne
Are you sure you're not getting your page location settings the wrong way round? The route should contain the dynamic slug not the location path.
If your page path is shop/product/ then your route might be set to shop/product/[slug:product] as mentioned above a couple of days ago.
Here's a screengrab of the shop I am working on at the moment. Mine also has a brand page but it gives you the idea of how you might structure things.
Hi Jonathan
I did have them the wrong way around.... I've now fixed this and instead of getting 404's I'm getting a white blank screen,which hopefully I can sort out... but progress. Thanks
Edit: Typo in product.php was causing white screen, all fixed now.
Wayne