Closed Reedyn closed 10 years ago
/
/products/
/products/category_name/
/products/category_name/product_id/
/cart/
/cart/checkout/
/cart/payment/
/cart/finish/
/settings/
/settings/user/
/settings/orders/
/admin/
/admin/products/
/admin/users/
/admin/orders/
With this structure one possible url could be http://justanotherwebshop.se/products/consoles/2674330/super-nintendo/
This structure however requires us to only be able to show products for a single category. If we want to show products that are in a category and all sub-categories for that category we run into the problem where the url is confusing to the user.
If we want to be able to show products that in practice belong to several products we shouldn't have the category as a part of the products url. However we also lose some of the visual hierarchy.
The alternative would be to have /product/product_id/
as the url for products.
With some extra work we can have descriptive urls for products such as /product/product_id/product_name/
or /product/product_id-product_name/
. If we decide to never have two products with the same name (something we haven't implemented in the rest of the system) we can even have the nicest looking structure of /product/product_name/
which in practice would mean urls as nice as http://justanotherwebshop.se/product/super-nintendo/
With the following structure we will avoid most problems and keep most of the visual url hierarchy. Added draft on the structure of url-variables.
/
/products/
?products
/products/category-name/
?category=$category_name
/products/top-category-name/product-id/
?product=$product_id?product-name=$product_name?category=$top_category_name
/cart/
?cart
/cart/checkout/
?cart?checkout?
/cart/payment/
?cart?payment?
/cart/finish/
?page=cart?finish?
/settings/
?settings?
/settings/user/
?settings?user
/settings/orders/
settings?orders
/settings/orders/order-id
settings?order=$order_id
/admin/
?admin
/admin/products/
?admin?products
/admin/products/product-id
?admin?product=$product_id
/admin/users/
?admin?sub-page=users
/admin/users/user-id
?admin?product=$product_id
/admin/orders/
?admin?orders
/admin/orders/order-id
?admin?order=$order_id
Everything is pretty much finished. What is left is a function to translate a categoryName
to categoryId