Post by uksitebuilder » Wed Aug 24, 2011 8:40 pm

It is definitely a problem with the core code somewhere, just trying to figure it out.

ImageImageImageImageImage

For Friendly Professional Support - Click Here


User avatar
Guru Member

Posts

Joined
Thu Jun 09, 2011 11:37 pm
Location - United Kindgom

Post by asphole » Wed Aug 24, 2011 9:14 pm

Yes I think you're right. I'll have a look later too as im a bit tied up at the moment so hopefully it can be resolved.

Active Member

Posts

Joined
Mon Mar 14, 2011 9:33 am

Post by asphole » Thu Aug 25, 2011 1:43 am

Well it looks ike the error is with the seo_urls.php script but not sure where yet!

Tried a few things such as:
SEO URLS > OFF (All links on all pages/domains now follow normal oc structure.)

Turn on SEO Urls and it breaks again.
Links in the html are being shown as: <a href="://index.php/my-account">My Account</a> whereas working links show as <a href="http://www.domain.co.uk/shopping-cart">Shopping Cart</a> (On multistore domains the working links correctly show the current domain)

So... I can only assume the issue is somewhere in the seo_urls.php. I'll have a dig around and let you know if I come up with anything.

Active Member

Posts

Joined
Mon Mar 14, 2011 9:33 am

Post by asphole » Thu Aug 25, 2011 3:21 am

return $url_data['scheme'] . '://' . $url_data['host'] . (isset($url_data['port']) ? ':' . $url_data['port'] : '') . str_replace('/index.php', '', $url_data['path']) . $url . $query; is not returning the correct url for multistore sites on some links. eg:

http://www.domain.co.uk/wishlist
://index.php/my-account
http://www.domain.co.uk/shopping-cart
://index.php/checkout

Seems that $url_data['host'] is empty for only some links on multistore domains. Any ideas where that would be getting its data?

Active Member

Posts

Joined
Mon Mar 14, 2011 9:33 am

Post by uksitebuilder » Thu Aug 25, 2011 4:48 am

The following line get it's data from $link

$url_data = parse_url(str_replace('&', '&', $link));

Now to find where link get's it's data from for the malformed url's on multi-stores

ImageImageImageImageImage

For Friendly Professional Support - Click Here


User avatar
Guru Member

Posts

Joined
Thu Jun 09, 2011 11:37 pm
Location - United Kindgom

Post by asphole » Thu Aug 25, 2011 5:50 am

I've hacked together a quick fix which seems to work, so unless you see anything else I can live with it!

For info here's my change:
in seo_urls.php

Find:

Code: Select all

return $url_data['scheme'] . '://' . $url_data['host'] . (isset($url_data['port']) ? ':' . $url_data['port'] : '') . str_replace('/index.php', '', $url_data['path']) . $url . $query;
And replace with:

Code: Select all

if( false !== strpos( $url_data['path'], "/" ) ){ 

            return $url_data['scheme'] . '://' . $url_data['host'] . (isset($url_data['port']) ? ':' . $url_data['port'] : '') . str_replace('/index.php', '', $url_data['path']) . $url . $query;
} else {
	        return 'http://' . $_SERVER["HTTP_HOST"] . str_replace('index.php', '', $url_data['path']) . $url . $query;			
}
Seems to work ok but i'm open to suggestions?

Active Member

Posts

Joined
Mon Mar 14, 2011 9:33 am

Post by uksitebuilder » Thu Aug 25, 2011 5:57 am

I was looking at something similar but dumped it due to being unable to determine which links should have https scheme like my account when viewed from a standard page

I am determined to find the root cause of this and will revisit on the morrow after catching some much needed zzzz's

ImageImageImageImageImage

For Friendly Professional Support - Click Here


User avatar
Guru Member

Posts

Joined
Thu Jun 09, 2011 11:37 pm
Location - United Kindgom

Post by asphole » Thu Aug 25, 2011 6:04 am

Yes, sorry I forgot to add that I dont use ssl so as $url_data['scheme'] was empty for those links I just hard coded it. All payments are taken offsite at processor so never felt need for one. Certainly doesn't seem to affect business.

I'd still be interested in finding out root cause so may play around bit more 2m evening. Will report back.

Active Member

Posts

Joined
Mon Mar 14, 2011 9:33 am

Post by asphole » Thu Aug 25, 2011 6:55 am

I did also notice that in catalog/controller/common/header.php

the urls that dont work in seo_urls are actually constructed differently:

$this->data['account'] = $this->url->link('account/account', '', 'SSL'); = Doesn't rewrite
$this->data['account'] = $this->url->link('account/account'); = Does rewrite.

Any idea why this would be?

Active Member

Posts

Joined
Mon Mar 14, 2011 9:33 am

Post by asphole » Thu Aug 25, 2011 8:46 am

Ok, decided to keep digging!

I changed the following code:

system>library>url.php

Changed:
public function link($route, $args = '', $connection = 'NONSSL') {
if ($connection == 'NONSSL') {
$url = $this->url;
} else {
$url = $this->ssl;
}
To:

public function link($route, $args = '', $connection = 'SSL') {
if ($connection == 'SSL') {
$url = $this->url;
} else {
$url = $this->ssl;
}
All urls now work on main domain and all multistores.

Active Member

Posts

Joined
Mon Mar 14, 2011 9:33 am
Who is online

Users browsing this forum: No registered users and 44 guests