X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (https://forum.x-cart.com/forumdisplay.php?f=20)
-   -   Static page simulation. Search engine improvements (https://forum.x-cart.com/showthread.php?t=10128)

fernando 10-31-2004 10:43 AM

Static page simulation. Search engine improvements
 
I wrote a mod that will generate a page which lists all products of the store with its description, simulating a static page. It makes use of Apache Rewrite Engine (mod rewrite).

A page mycatalog.html is dynamically created, and will list the products in the following way:

Name of the first product

Description of the first product

Name of the second product

Description of the second product

and so forth for the whole catalog. You can see it at work in http://mascotasmexico.com/tienda/lista.html (and yes, this is dynamically created)

(thanks Gijs for your help on seeing into template variables, which helped me nail this in relatively short time).

03.03.05 EDIT Please check my newest version of this mod at: http://forum.x-cart.com/viewtopic.php?p=80454#80454

These are the steps to install it (you don't need to change any of the original programs):

1. Create new template skin1/SEO_listing.tpl

Code:

{* Smarty Template by Fernando Borcel. MascotasMexico.com 2004/10/31 *}

{foreach from=$products item=v key=k}
 

{$products[$k].product}

  {$products[$k].descr}</p>
{/foreach}


2. Create mycatalog.php on your xcart directory:

Code:

<?php

/* Search Engine Enhancement by Fernando Borcel. MascotasMexico.com */

require "./auth.php";

$qry = "SELECT * FROM " . $sql_tbl["products"] . " where forsale='Y'";
$result = db_query($qry);

$products = array();

while ($result_row = db_fetch_array($result)) {
  $products[] = $result_row;
}


$smarty->assign("products",$products);
func_display("SEO_listing.tpl", $smarty);

?>


3. Add the following lines to your .htaccess file on xcart directory, that will map your "html" files to the actual php scripts, without redirecting.

Code:

RewriteEngine on
Options +FollowSymlinks
RewriteBase /
RewriteRule ^(.*)-pid-([0-9]+)\.html$ /xcart/product.php?productid=$2
RewriteRule ^(.*)mycatalog.html$ /xcart/mycatalog.php


(change the /xcart/ directory if your webdir is something else)

4. Add a link somewhere in your customer/home.tpl or wherever you feel like, that might look something like:


Ideally this should not be a hidden link, but you want to place somewhere highly unlikely for users to click on it.

03.03.05 EDIT Please check my newest version of this mod at: http://forum.x-cart.com/viewtopic.php?p=80454#80454

I'd want to hear what you think of this, and if you have any improvements for it (which I'm sure there could be), I would be more than glad to hear from you!!

Regards

Gijs 10-31-2004 10:54 PM

Hi Fernando,

Works like a dream ... now !

First you have to check if the Rewrite module is loaded with Apache otherwise you'll get an internal server error.

Check at this section:
Quote:

# Dynamic Shared Object (DSO) Support
#
# To be able to use the functionality of a module which was built as a DSO you
# have to place corresponding `LoadModule' lines at this location so the
# directives contained in it are actually available _before_ they are used.
# Please read the file README.DSO in the Apache 1.3 distribution for more
# details about the DSO mechanism and run `apache -l' for the list of already
# built-in (statically linked and thus always available) modules in your Apache
# binary.

Personnally I would add categories and thumbs as well.

Nice Mod :wink:

Gijs

fernando 10-31-2004 11:05 PM

Good point. I'll update the mod so that it'll include all categories. I just finished a new mod so that customers will be able to see all the first-level sub-categories within the main category they're browsing. I'll post it here over the next few days ;) You can check it out @ my site.

Cheers,

Gijs 11-01-2004 12:08 AM

Re: Static page simulation. Search engine improvements
 
Quote:

Originally Posted by fernando
Ideally this should not be a hidden link, but you want to place somewhere highly unlikely for users to click on it.


I don't know what a hidden link is :?: :oops:

In CSS you could do the following and ... I hope this is not what you call a hiddenlink :lol:
Code:

.HiddenUrl {
        COLOR: #fbf6ce; TEXT-DECORATION: none;
}
.HiddenUrl:link {
        COLOR: #fbf6ce; TEXT-DECORATION: none;
}
.HiddenUrl:visited {
        COLOR: #fbf6ce; TEXT-DECORATION: none;
}
.HiddenUrl:hover {
        COLOR: #fbf6ce; TEXT-DECORATION: none;
}
.HiddenUrl:active  {
        COLOR: #fbf6ce; TEXT-DECORATION: none;


Match COLOR to the background colour of where you put the hyperlink (f.e. in bottom.tpl)
When hoovering you'll notice the "hand cursor" showing up for the rest it will be invisible.

<a class="HiddenUrl" href="mycatalog.html>Catalog</a>

xcell67 11-03-2004 12:44 AM

awesome mod

FYI, people using 3.5 and lower need to change

func_display("SEO_listing.tpl", $smarty);

to

$smarty->display("SEO_listing.tpl");

in mycatalog.php for this to work.

AJ-UKRS 11-12-2004 10:23 AM

Very nice mod... but can this be done in even a slightly better way...

shop is on domain1.com

but a page is generated on domain2.com and domain3.com etc

this way the all links can be put on the back of many high rank domains...

a suggestion...!

maybe a xml feed?

aop 11-15-2004 06:30 PM

Hi guys;
I'm running version 3.2.2, and I don't even have HTML Catalog feature.
This Mod seems can be very usable for me.
Any idea if would work in this old version 3.2.2 ?
Appreciate any help !
Thanks :)

PhilJ 11-23-2004 03:48 PM

Great mod - thank you - very versatile too. How can I display it within the xcart template?

fernando 11-23-2004 04:53 PM

Hi. I actually created it with search engines in mind, so applying a template wasn't of too much use. Maybe someone else will care to comment on this?

Regards

PhilJ 11-24-2004 05:05 AM

It's ok, I've found a way round it, thanks again.


All times are GMT -8. The time now is 07:35 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.