Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ability to remove anchor from product link when using URL smarty helper function #11041

Closed
Tracked by #18402
tlhuillier opened this issue Oct 17, 2018 · 8 comments · Fixed by #22223
Closed
Tracked by #18402
Assignees
Labels
Combinations Product type: issue about products with combinations Fixed Resolution: issue closed because fixed Improvement Type: Improvement PM ✔️ Status: check done, behavior approved SEO & URLs Label: Which BO under menu is concerned
Milestone

Comments

@tlhuillier
Copy link

When creating a product link (with product attribute) from the Smarty helper function url, it is not possible to define wether or not to add the anchor at the end or the URL.
https://your-website.com/cat/1-1-product.html#/product-attribute

It is possible to do so when using directly the instance of Link object, but it's deprecated.

We should add the anchor parameter to the url Smarty helper function.

@khouloudbelguith
Copy link
Contributor

Hi @tlhuillier,

Thanks for your report.
@eternoendless, @colinegin @PrestaShop/prestashop-core-developers what do you think of his suggestion.
Thanks!

@khouloudbelguith khouloudbelguith added Improvement Type: Improvement SEO & URLs Label: Which BO under menu is concerned Combinations Product type: issue about products with combinations Needs Specs Status: issue needs to be specified labels Oct 17, 2018
@tlhuillier
Copy link
Author

Edit:
I was wrong.
We didn't have the ability to remove the anchor, even using Link::getProductLink, but only hide IDs.

@khouloudbelguith
Copy link
Contributor

Hi, @tlhuillier,

So do you want to delete the IDs from the URL?
We are working on improving many of the outstanding SEO issues the community has been raising for some time.
If you don't like having IDs at the start of the slug, you can change that on your back office so that they are at the end of the URL. Go to Shop Parameters > Traffic & Seo, scroll down the page to find the "Schema of URLs" section, then change "Route to products" to something like this:
{category:/}{rewrite}{id}{:id_product_attribute}{-:ean13}.html
Thanks!

@colinegin colinegin added the Waiting for PM Status: action required, waiting for product feedback label Oct 26, 2018
@colinegin colinegin self-assigned this Nov 6, 2018
@colinegin
Copy link

Hello @tlhuillier ,

Thanks for your feedback. Unfortunately, it's not easy to move from one URL format to another during minor versions as there are risks to break things down when upgrading.

We will be rethinking the URL format for the next major version. Do not hesitate to share your ideas !
In the meantime, you can find different modules available on the Addons marketplace which enable you to remove IDs from product pages.

Regards,

@colinegin colinegin added PM ✔️ Status: check done, behavior approved and removed Waiting for PM Status: action required, waiting for product feedback labels Nov 12, 2018
@khouloudbelguith
Copy link
Contributor

Hi,

As suggested by @yannicka in this issue: #16413

Is this anchor needed?

$anchor = $ipa ? $product->getAnchor((int) $ipa, (bool) $addAnchor) : '';

I've replaced this line by:

$anchor = '';

And everything seems to be working fine.

This anchor generates a URL that seems longer than necessary. Perhaps this anchor should be removed or an option should be given to enable/disable it globally if necessary

Thanks!

@colinegin colinegin added the Waiting for dev Status: action required, waiting for tech feedback label Mar 13, 2020
@PierreRambaud PierreRambaud removed the Waiting for dev Status: action required, waiting for tech feedback label Oct 12, 2020
@PierreRambaud
Copy link
Contributor

Hi everyone,

We should be able to remove anchor when it's not needed 👍

@PierreRambaud PierreRambaud added Ready Status: Issue is ready to be worked on and removed Needs Specs Status: issue needs to be specified labels Oct 12, 2020
@kpodemski
Copy link
Contributor

@PierreRambaud you can check this PR

#19400

maybe you will find a way to avoid BC break 👍

@PierreRambaud
Copy link
Contributor

@PierreRambaud you can check this PR

#19400

maybe you will find a way to avoid BC break

I think I have an idea :) Thanks

PrestaShop 1.7.8.0 automation moved this from To be tested to Done Jan 12, 2021
@prestashop-issue-bot prestashop-issue-bot bot removed the Ready Status: Issue is ready to be worked on label Jan 12, 2021
@eternoendless eternoendless added the Fixed Resolution: issue closed because fixed label Jun 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Combinations Product type: issue about products with combinations Fixed Resolution: issue closed because fixed Improvement Type: Improvement PM ✔️ Status: check done, behavior approved SEO & URLs Label: Which BO under menu is concerned
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

7 participants