Post by supak111 » Fri Mar 22, 2024 3:57 pm

Hi I just realized that encoded URL's don't work, so say changing = into %3D destroys the URL. Many websites encode URLS so the backlinks from those sites are kinda useless as they don't go where they should.

Went and tested it on OC.com demo site and it doesn't work there either. Is there anyway to fix this?

THIS WORKS AS IT SHOULD:

Code: Select all

https://demo.opencart.com/index.php?route=product/product&product_id=40
THIS DOES NOT:

Code: Select all

https://demo.opencart.com/index.php?route=product/product&product_id%3D40

~ OC 3.0.3.2 and OCmods only ~


User avatar
Active Member

Posts

Joined
Fri Feb 13, 2015 12:09 pm

Post by ADD Creative » Fri Mar 22, 2024 6:38 pm

No, because that would be incorrect. Instead of "product_id" being equal to "40", you are saying "product_id=40" is equal to "". = reserved character and should only be encoded if it's data and not used to delimit parameters and parameter values.

You can see the difference by using the the PHP function parse_str.

Code: Select all

route=product/product&product_id=40
array(2) {
  ["route"]=>
  string(15) "product/product"
  ["product_id"]=>
  string(2) "40"
}

Code: Select all

route=product/product&product_id%3D40
array(2) {
  ["route"]=>
  string(15) "product/product"
  ["product_id=40"]=>
  string(0) ""
}
You would need to get the site linking to yours to fix the issue.

www.add-creative.co.uk


Guru Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by supak111 » Fri Mar 22, 2024 8:42 pm

I don't understand the difference, sorry totally php newbie here.

The site is actually google shopping and its sending the URL like this, and that doesn't work on opencart

Code: Select all

https://demo.opencart.com/index.php%3Froute%3Dproduct%2Fproduct%26product_id%3D40

~ OC 3.0.3.2 and OCmods only ~


User avatar
Active Member

Posts

Joined
Fri Feb 13, 2015 12:09 pm

Post by paulfeakins » Fri Mar 22, 2024 8:51 pm

supak111 wrote:
Fri Mar 22, 2024 3:57 pm
backlinks from those sites are kinda useless
Get them to fix their links then, this isn't an OC problem.

UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk


User avatar
Legendary Member
Online

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - London Gatwick, United Kingdom

Post by ADD Creative » Fri Mar 22, 2024 9:04 pm

I don't see any links encoded like that on Google Shopping. How are you sending your products to Google Shopping?

www.add-creative.co.uk


Guru Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by supak111 » Sat Mar 23, 2024 7:04 am

The new BUY NOW button under the product was doing this. Instead of sending the customer straight to OC checkout with item already in the cart, it was just sending them to 404 error page.

Uploaded via google shopping XML file.

Right now since I updated my items/xml file I can't find them on google shopping so I can't confirm if I fixed it or not. I will report back as soon as my items are visible again

.

~ OC 3.0.3.2 and OCmods only ~


User avatar
Active Member

Posts

Joined
Fri Feb 13, 2015 12:09 pm
Who is online

Users browsing this forum: Bing [Bot] and 19 guests