Jump to content

[SOLVED] Friendly URL not working - Product Categories / Product Variants


Recommended Posts

Hi there!

I have discovered some strange problems with our url structure / friendly url.
Overall its working but in certain cases it is not. 

Shop URL: https://cokocbd.com/
URL to product category: https://cokocbd.com/e-liquidos-28
URL to product: https://cokocbd.com/e-liquidos/super-skank-25
URL to product variant: https://cokocbd.com/e-liquidos/super-skank-25-107#/55-concentracion-300mg

1. Its not really a problem, i am just wondering:
The URL to a category has "-28" attached to it. If i only visit "/e-liquidos" its no longer working. Thats normal right? 

2. URLs to product variants are not working at all. 
In some cases like with the example given it links to a completely different product.
In most other cases it goes to 404 like with this product variant URL: https://cokocbd.com/aceites-cannabis/valeo-care-51-374#/79-concentracion-1500mg
As you can see, it is adding "-374" to the URL which causes it to no longer work. 

3. When adding any product to the shopping cart, the link to the product is not working since its url is including the product variant and therefor it no longer works.

4. The Search Bar is not working because of that. If you search for any product, the suggestion box is using URLs to products that do not work. I guess it is because it is linking to product variants. 

Is there a solution to this?

If not, is there a way to disable product variants showing up in the URL? That would fix it i guess.

Our route to products in Scheme URL is: {category:/}{rewrite}-{id}{-:id_product_attribute}

Thanks in advance! ❤️

 

Edited by laserloui (see edit history)
Link to comment
Share on other sites

I was able to fix the problem.
I changed the product route to "{category:/}{rewrite}-{id}{/:id_product_attribute}{ean13}" 

I added the slash (/) before product attribute.
This helped! Now URLs to product variants / product attributes are working.
Don't ask me why. I am just happy it works.

  • Like 2
  • Thanks 1
Link to comment
Share on other sites

  • 1 year later...
On 1/31/2020 at 10:36 PM, laserloui said:

I was able to fix the problem.
I changed the product route to "{category:/}{rewrite}-{id}{/:id_product_attribute}{ean13}" 

I added the slash (/) before product attribute.
This helped! Now URLs to product variants / product attributes are working.
Don't ask me why. I am just happy it works.

Thanks for that post @laserloui. I had 404 error after refreshing page with attribute and spend hours trying to repair that bug. Now it works corectly :)

 

Link to comment
Share on other sites

  • 6 months later...
  • 11 months later...
On 1/31/2020 at 10:36 PM, laserloui said:

I was able to fix the problem.
I changed the product route to "{category:/}{rewrite}-{id}{/:id_product_attribute}{ean13}" 

I added the slash (/) before product attribute.
This helped! Now URLs to product variants / product attributes are working.
Don't ask me why. I am just happy it works.

Thanks man, that did the trick!

Link to comment
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
×
×
  • Create New...