Jump to content

Welcome, Guest!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

  • 0

Unique Product Friendly URL problem


I decided to post it here, but from what i saw on forums, it may not be seen as issue on TB. I'm a web developer and I'm working on Prestashop since late 1.3, I create and sell modules etc.

I really like idea of TB, because I'm against where Prestashop is going and was considering of forking 1.6 myself, after finding out about TB i felt relieved I don't have to.

After playing a little bit with TB I really like it, but there is one thing that is almost unacceptable for me. Meaning: Friendly urls in TB (I'm an enemy of all "remove id from link/url" modules).

If you ask why, then:

  • It does not improve SEO - I tested it... and alot of 1st places in google are with trashy links (like "/c/1" and "category-1" or "product/1" etc.)
  • It forces shop users to acually remember every product to have unique ID (TB does not even notify about duplicates when adding new product)
  • Cannonical Redirects stop working - Prestashop (didnt check code, but I belive it wasn't removed in TB) have built in cannonical redirects that automatically redirect product to new link (based on Product ID)
  • Causes problems - especially while importing stuff automatically - in PS it works, cause it does not matter what I put into friendly url link and if it duplicates, to make my wholesaler integrations work I would need to create random rubish ids in URL's that deny whole purpouse of those "friendly urls" in first place.
    • Can't imagine saying to client: Hey, TB is cool, but after every import of products remember to check "Duplicates" tab and fix duplicates by hand! GL HF!
  • Disallows merchant to edit friendly urls
  • or Requires him to write manual redirects

From what I saw in Friendly url configuration, ID requirement was removed and TB requires "rewrite*" instead of "id*"

I completly understand that some may want to enable those friendly urls, if they want to fix them "by hand" (yeah..right... especially after you import 10 000 products into shop)

But (by me) it SHOULD be an option to enable and merchant should be informed of risks and additional duties.

For example, while importing new products into shop I can think only about 2 ways:

  • Add option "Prefix/suffix product name with md5 hash or something (Only needed on thirtyBees, and your links will be even uglier than with ID)"
  • Add option to update product friendly url after saving product with generated product ID - "Dear Customer, our integration works slower in thirty bees, because we need to save each product twice!"
  • Ignore problem and tell customers "Hey, you have very specific friendly links in your system, please edit them on your own/redesign url system/switch back to prestashop/live with it"

Hope my essay will be heard and maybe it Will be considered in 1.0.9...

PS: Wonder, what will happend if I migrate from Prestashop with "/1-productlink" urls to TB "/productlink". Seems any client I would convience to move to TB will lose all urls (Tested, adding ID to url does not redirect).

As little as or as much as this... this "feature" (for me its a big flaw - can't say its a bug as it's intended... ) it's a dealbreaker. No matter how much I would want to move anyone to TB, It cannot ensure basic URL redirects.

Maybe I'm missing something... enlight me if it's not a huge flaw/step back in TB design

Share this post

Link to post
Share on other sites

4 answers to this question

Recommended Posts

  • 0

Hm what is the problem, if you use tb with the id? Nobody force you to use the clean urls! Just define your urls structure inΒ AdminMeta with ids.

Share this post

Link to post
Share on other sites
  • 0

My bad... I assumed, since:

" id*, rewrite, ean13, category, categories, reference, meta_keywords, meta_title, manufacturer, supplier, price, tags "


id, rewrite*, ean13, category, categories, reference, meta_keywords, meta_title, manufacturer, supplier, price, tags

It would only look by rewrite instead of ID. Just tested, even tho {id} is not required as identifier but {rewrite} TB has ability to search for products by id_product.

Didn't investigate code untill now... and here is this small diamond πŸ’ŽπŸ’ŽπŸ’ŽπŸ’Ž

if ($route['controller'] === 'product') {
  if (isset($m['id']) && $m['id']) {
  	$idProduct = (int) $m['id'];
  } else {
    $idProduct = $this->productID($m['rewrite'], $uri); // <<<<<<<<<<<<<<<<<<<<
    if (!$idProduct) {
      $idProduct = in_array('id_product', $m) ? (int) $m['id_product'] : 0;
      if (!$idProduct) {
  $_GET['id_product'] = $idProduct;

Even with performance consideration from dev ❀️❀️❀️❀️

PS: Not sure why rewrite is required and not "either require or id is required", but it none of concern then πŸ˜‰

@wakabayashi Thx for making me dig into code πŸ™‚

Share this post

Link to post
Share on other sites
  • 0

What a huge posting.

  • There's a module Duplicate URLs, which detects, well, duplicate URLs.
  • URLs can get edited. Back office -> Catalog -> Product -> (click on product) -> tab SEO -> field Friendly URL.
  • When migrating from PS, URLs with ID are kept. Those which used a friendly URL module before (every shop I migrated so far), have to deal with this manually. Obviously.

==> everything fine. Any fear left?

  • Thanks 1

Share this post

Link to post
Share on other sites
  • 0

@Traumflug Huge posting because I think Prestashop is one of the best eCommerce platforms out there, and 1.7 is a "Fall of Prestashop" πŸ™‚ TB is my light in a tunnel πŸ™‚

Sorry, for making ruckus, as I wrote in my second post, i had no idea it was backward compatible with {id} and that {id} had priority πŸ™‚ - which is super fine πŸ™‚

  • Like 2

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now