I am creating a product catalog using this Silverstripe Module:
https://github.com/luisdias/silverstripe-productcatalog Which is based on this module https://github.com/arambalakjian/DataObject-as-Page
I have an issue that friendly URLs are appearing as: www.mysite.com/product-page/category/1 or www.mysite.com/product-page/show/1/1 as apposed to their title or url segment. www.mysite.com/product-page/show/my-category/my-product
I've tried changing the code from Product.php to
//Return the link to view this category
public function Link() {
$Action = 'show/' . $this->ID . '/' . $this->URLSegment;
return $Action;
}
from
//Return the link to view this category
public function Link() {
$Action = 'show/' . $this->ID . '/' . $this->CategoryID;
return $Action;
}
Which works, but not for the category titles and is the url has spaces it generates %20 instead of _.
It seems like a simple change which I can't work out..
I also want to be able to have sub-categories. So everything in a category can be divided into say their "Size". At present All products are divided just once. Products > Categories I would like Products > Categories > Sub-Categories can any one help me achieve this? thanks