AbanteCart Community

Shopping Cart Operations => Support => Topic started by: jesus_automatic on January 17, 2014, 03:02:18 PM

Title: category menu links
Post by: jesus_automatic on January 17, 2014, 03:02:18 PM
I have a strange problem that seems to be intermittent, and I cant see what it might relate to.
The links from the category menu keep coming up as the numerical ip address instead of the text address. For example
http://37.61.233.155/index.php?rt=product/category&path=49
instead of
http://www.figtreebeauty.com/index.php?rt=product/category&path=49

The links still go to the correct page but a problem arises when you log in or add a product to the cart because the browser cant find the security certificate. Also if you log in, then click one of these links it logs you out? I've tried from another computer in case it was my machine or browser but just the same.
And then its back to normal, only to start again the next day. I'm using 1.1.6 html5 template.

Have you come across anything similar?
Title: Re: category menu links
Post by: abantecart on January 17, 2014, 05:02:34 PM
This depends how you enter the site.
If you enter site with domain link all links will be constructed with your domain.

If you do not want allow IP based access you can add rewrite rule

See if this help you:
http://stackoverflow.com/questions/9985735/redirect-ip-to-domain
Title: Re: category menu links
Post by: jesus_automatic on January 23, 2014, 06:31:49 AM
Thanks for the reply.
I am starting off on the frontpage with the domain name, and only the category tabs are sending me to ip address pages, after that all pages come up with the ip . And the intermittent nature of it is driving me mad. Just when I think I am getting somewhere it stops and behaves as it should. I had a car like this once. It would run terribly but when I took it to the mechanic it would run like a dream and he would look at me like I was stupid.
Title: Re: category menu links
Post by: gordontaylor on January 23, 2014, 09:54:50 AM
Do a quick with your hosting company, they may have your security Cert installed wrong, it happened to me once. If you installed it, I'm sure they will install it for you for free.
Title: Re: category menu links
Post by: jesus_automatic on January 24, 2014, 06:45:00 AM
Thanks Gordon. They installed it themselves and all seemed fine until I changed from default template to html5. But I will check back with them.
Title: Re: category menu links
Post by: jesus_automatic on January 27, 2014, 12:45:30 PM
There doesn't appear to be a problem with the SSL.
I've checked from a couple of different devices here and the same. Enter at www.figtreebeauty.com but the category menu links point to  http://37.61.233.155/index.php?rt=product/category&path=64. And once there all further links stay with the numerical address. When you reach a page that requires https you get an error that the security certificate isn't valid etc.

Would someone be kind enough to have a look at my site and see they can replicate this?
And any ideas on why? I have not being doing anything structural to the site, just updating product info and the like.
Title: Re: category menu links
Post by: gordontaylor on January 27, 2014, 01:00:59 PM
I get the same thing, even when using the https:// prefix.

Some security certs DO NOT install in the www prefix, only the root prefix.

I'm using Global trust and they cover both www and the root.
Title: Re: category menu links
Post by: jesus_automatic on January 27, 2014, 01:15:58 PM
I get what you are saying, but the issue really is why those links direct to the root address. And why only some days? If they followed the rule that if you start from http://www.domainname it sticks with it then there wouldnt be a problem.
Title: Re: category menu links
Post by: gordontaylor on January 27, 2014, 01:35:30 PM
I can't explain it either, who is your hosting company?
Title: Re: category menu links
Post by: gordontaylor on January 27, 2014, 01:37:52 PM
OK, now it's weird. It's going to the named domain, not the IP of the domain.

Have you tried this in different browsers?

It's a good problem to solve!

It works correctly in IE, FF and Chrome for me now....but it didn't before.

Title: Re: category menu links
Post by: jesus_automatic on January 27, 2014, 01:44:09 PM
I have found in my tinkering that if I clear the store cache, then it corrects itself for a day or two, before the problem reappears. That explains the apparent random nature of it, but doesnt help me understand whats causing it.

Thanks for your help and input. I'm glad you like an interesting problem.
Title: Re: category menu links
Post by: gordontaylor on January 27, 2014, 01:45:38 PM
Ah, sounds like an issue with your install.

Have you upgraded to 1.1.8?

It's available today.
Title: Re: category menu links
Post by: jesus_automatic on January 27, 2014, 01:54:29 PM
Yes, I saw that. Problem is I had some of the files edited to get it to show wholesale prices when logged in as a wholesaler. I think upgrading will create a whole load of work. I'll leave it until I've got a free day. (in my dreams)
Title: Re: category menu links
Post by: jesus_automatic on March 11, 2014, 05:15:12 PM
I have been happily ignoring this problem for a couple of months. And that doesnt seem to have worked. Customers keep calling to let me know the links dont work on my site.
And most recently the link target has been giving the address as
localhost/index.php?rt=product/category&path=49
which doesnt return any page.
I know if I clear the category cache then the problem goes away for a while.
Can anyone tell me which file(s) generates this link address so I can try swapping it out for a clean copy?
Title: Re: category menu links
Post by: junkyard on March 12, 2014, 09:59:55 AM
These could be related:

core/helper/html.php
core/lib/menu_control_storefront.php
storefront/controller/common/menu.php
storefront/view/default_html5/template/blocks/category.tpl
storefront/view/default_html5/template/blocks/category_top.tpl

Also, see what you have in the public_html/system/cache dir -- look for specific files containing 37.61.233.155
And when had is started to happen?  once you have triggered the SEO URLs feature or something ?
Title: Re: category menu links
Post by: jesus_automatic on March 13, 2014, 04:54:54 PM
Thanks for the pointers. Bit of a mad week but I will investigate those files at the weekend.
The problem started when I switched from default template to html5. So maybe the .tpl files are the culprit.
Title: Re: category menu links
Post by: jesus_automatic on March 15, 2014, 02:25:29 PM
I have had look through the suggested files.
category_top.tpl looked relevant, but then the problem reoccurred in the main menu rather than the category menu. It all leaves me rather confused. I suspect it is not a problem with templates, menus or blocks, but whatever in the core generates the links. When the problem occurred in the main menu I had to reset the system and store cache to clear it. Previously resetting the category cache would do it - the file cache.category.details.0.1_0.1394910582 contains the urls.

???
Title: Re: category menu links
Post by: jesus_automatic on March 31, 2014, 04:01:21 PM
So I did the upgrade from 1.1.6 to 1.1.7 and the problem persists in the top menu - Login etc.

The source code taken from the home page looks like this
Code: [Select]
<ul id="main_menu_top" class="nav main_menu">
    <li  data-id="menu_login"  class="dropdown hover"><a  class="top menu_login"  href="http://37.61.233.155/index.php?rt=account/login" ><span>Login</span></a></li>
<li  data-id="menu_account"  class="dropdown hover"><a  class="top menu_account"  href="http://37.61.233.155/index.php?rt=account/account" ><span>Account</span></a></li>
<li  data-id="menu_cart"  class="dropdown hover"><a  class="top menu_cart"  href="http://37.61.233.155/index.php?rt=checkout/cart" ><span>Cart</span></a></li>
<li  data-id="menu_checkout"  class="dropdown hover"><a  class="top menu_checkout"  href="http://37.61.233.155/index.php?rt=checkout/shipping" ><span>Checkout</span></a></li>
</ul>
But all other links point to the www.etc.
Any more ideas?
Title: Re: category menu links
Post by: junkyard on April 01, 2014, 03:10:26 AM
Since you (evidently) already have the Store URL set correctly to your domain name in admin system > settings > details  (and this is the only directly related setting),  the AbanteCart is supposed to pick it up for these links generation.  Just look at how HTTP SERVER and HOST are being used in
 ~/public_html/core/init.php     (there's also your 'localhost' mentioned in it)     to render the links for the storefront in the php and passed to the tpls. Then at some point later the cache files come into play.   You do have supported PHP version, do you?

Quote
The problem started when I switched from default template to html5.
Quote
I know if I clear the category cache then the problem goes away for a while.

Sounds like a software bug triggered by the switch ? 
As the old default html template appears to be rarely used,  the switch could be overlooked QA scenario..
Maybe someone from Abantecart team could help figure out this one.
Title: Re: category menu links
Post by: jesus_automatic on April 01, 2014, 07:42:45 AM
Yes the system setting is correct.
The error log in 1.1.7 seems to show more details

2014-03-17 10:44:30 - App Warning:  AbanteCart core v.1.1.7 Warning: Accessing store with unconfigured or unknown domain ( localhost/ ).
 Check setting of your store domain URL in System Settings . Loading default store configuration for now. in /home/figtreeb/public_html/core/lib/config.php on line 169

2014-03-25 21:28:54 - App Warning:  AbanteCart core v.1.1.7 Warning: Accessing store with unconfigured or unknown domain ( FIGTREEBEAUTY.COM/ ).

And most commonly
2014-04-01 10:25:13 - App Warning:  AbanteCart core v.1.1.7 Warning: Accessing store with unconfigured or unknown domain ( 37.61.233.155/ ).

Though strangely this last one is from this morning and the site is functioning correctly.
The server supports PHP v. 5.3.26, which I believe is ok.

I will have a look at the core/init.php and see if I can understand any of it, and post back later
Title: Re: category menu links
Post by: jesus_automatic on April 01, 2014, 10:24:29 AM
Well that definitely where the address is controlled from, but I am none the wiser where this intermittent problem is coming from. I checked the file I have against a clean copy of 1.1.7 just to check it hadnt been messed with. Its an exact match.

If someone with better understanding of the structure of abantecart core could apply some thought to  this problem I would be grateful.
Title: Re: category menu links
Post by: jesus_automatic on April 03, 2014, 08:10:58 AM
The only other entry in the error log is

2014-04-03 0:49:04 - warning:  AbanteCart core v.1.1.7 preg_grep() [<a href='function.preg-grep'>function.preg-grep</a>]: Compilation failed: nothing to repeat at offset 0 in <b>/home/figtreeb/public_html/core/engine/language.php</b> on line <b>232</b>

but that doesnt appear to be related.

Any ideas anyone?