Post by mindplay.dk » Tue Mar 31, 2009 11:36 pm

First, let me just say, this is easily the best shopping system I've seen - this system is infinitely better architected than any other shopping cart I've ever had to work with! Excellent work!

I have a couple of questions at this point.

I found the SVN repository at http://code.google.com/p/opencart/ ... is this the official repository? There does not appear to be any link to it from the home page.

Around the forum, I've seen older posts mentioning URL aliases as being a feature you turn on and off somewhere... But this does not seem to be part of the current version?

I need clean URLs for the site I'm developing, which will run on Apache, so I need some rewrites, at least.

Ideally, I would like to have search-engine friendly URLs, and I examined this add-on, but it appears to be totally outdated? None of the code in the index.php file resembles the code in that file in the current version. The CREATE TABLE statement for the url_alias table used by this contribution isn't even included in that zip file, so it seems pretty useless...

If I decide to put my own rewrites in place somehow, how do I get the system to compose clean URLs? I realize I could just edit system/library/url.php, but I was wondering if there's a cleaner way to do it? - I would like to keep an open upgrade path, and if I start to customize the system code, I might lose that option.

One other very minor thing puzzled me - in the config files, I see define('DB_PREFIX', 'cart_'); ... and the site works, but the tables in the database are not prefixed with "cart_", nor anything else ... I don't need a prefix, but is the prefix used for anything at all? Is it safe to remove? (will future versions start using it?) ... just wondering.

I would like to contribute to the codebase, if possible - I have 12 years of professional experience, and I'm pretty sure I could contribute useful things. I'm very concerned about things like avoiding bloat and overhead, and I understand (and love!) the code style of this project.

For example, I would really like to look into this URL stuff. Aliases really is missing for me, big time.
For starters, I just gave the Url class a quick once-over:

Code: Select all

<?php 

final class Url { 
  
  private function compose($route, $secure = false) {
    return ($secure ? HTTPS_SERVER : HTTP_SERVER) . 'index.php?route=' . str_replace('&', '&', $route);
  }
  
  public function http($route) {
    return $this->compose($route);
  }
  
  public function https($route) {
    return $this->compose($route, HTTPS_SERVER != '');
  }
}

?>
The existing class repeated the URL composition three times - not necessary, and will become a hinderance to an integrated URL alias system.

Just a quick example of my way of thinking. If you'd like to examine my coding style in general, you could take a look at my php template engine...

Newbie

Posts

Joined
Tue Mar 31, 2009 10:51 pm

Post by mindplay.dk » Wed Apr 01, 2009 2:19 am

Having talked to the developers of OpenCart Zero, this cleared up a couple of my questions.

For a number of reasons, I have decided to work with OpenCart rather than Zero.

The URL aliases package found in the contributions directory is not much use to me, so this will be my first goal, and I would be happy to share my work with anyone interested, and/or contribute to the project...

Newbie

Posts

Joined
Tue Mar 31, 2009 10:51 pm

Post by mindplay.dk » Wed Apr 01, 2009 8:30 am

In case anyone is reading this at all, just a note to say, URL aliasing support for OC is well under way.

I opted for a system where the user can manually enter URI components for each category and product - category URI components must be unique per category-level, and product URI components must be globally unique.

Aliases will then be auto-generated, based on these - for example, the Apple Cinema 30" by default maps to: "domain.com/components/monitors/apple-cinema-30" and "domain.com/apple-cinema-30".

There is still quite a bit of work to do - I'm working with SVN, so if anyone is interested, I could generate a patch when I'm done.

Newbie

Posts

Joined
Tue Mar 31, 2009 10:51 pm

Post by Qphoria » Wed Apr 01, 2009 8:34 am

mindplay.dk wrote: The URL aliases package found in the contributions directory is not much use to me
This is for Zero, as only zero suppots url alias at this time.

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by mindplay.dk » Wed Apr 01, 2009 8:01 pm

That's confusing - what's it doing in the archive on this site?

Newbie

Posts

Joined
Tue Mar 31, 2009 10:51 pm
Who is online

Users browsing this forum: Amazon [Bot] and 3 guests