Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Static page simulation. Search engine improvements

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #1  
Old 10-31-2004, 10:43 AM
 
fernando fernando is offline
 

Member
  
Join Date: Oct 2004
Posts: 29
 

Default 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
__________________
Fernando
Sorry, I\'m not using x-cart anymore, so I am unable to reply to enquiries about modules. Thank you.
Reply With Quote
  #2  
Old 10-31-2004, 10:54 PM
  Gijs's Avatar 
Gijs Gijs is offline
 

eXpert
  
Join Date: Aug 2004
Location: Belgium
Posts: 295
 

Default

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

Gijs
__________________
X-cart 4.1.11
PHP 5 MySQL 5
www.wheelpalace.eu
Reply With Quote
  #3  
Old 10-31-2004, 11:05 PM
 
fernando fernando is offline
 

Member
  
Join Date: Oct 2004
Posts: 29
 

Default

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,
__________________
Fernando
Sorry, I\'m not using x-cart anymore, so I am unable to reply to enquiries about modules. Thank you.
Reply With Quote
  #4  
Old 11-01-2004, 12:08 AM
  Gijs's Avatar 
Gijs Gijs is offline
 

eXpert
  
Join Date: Aug 2004
Location: Belgium
Posts: 295
 

Default 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

In CSS you could do the following and ... I hope this is not what you call a hiddenlink
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>
__________________
X-cart 4.1.11
PHP 5 MySQL 5
www.wheelpalace.eu
Reply With Quote
  #5  
Old 11-03-2004, 12:44 AM
 
xcell67 xcell67 is offline
 

Senior Member
  
Join Date: Dec 2003
Posts: 149
 

Default

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.
Reply With Quote
  #6  
Old 11-12-2004, 10:23 AM
 
AJ-UKRS AJ-UKRS is offline
 

Advanced Member
  
Join Date: Jan 2004
Posts: 92
 

Default

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?
Reply With Quote
  #7  
Old 11-15-2004, 06:30 PM
 
aop aop is offline
 

Advanced Member
  
Join Date: Oct 2003
Location: los angeles
Posts: 96
 

Default

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
__________________
www.furniturevision.com
Version 3.2.2 retired
Updated to 4.0.8 - retired
Updated to 4.1.9 - retired
Updated to 4.4
Reply With Quote
  #8  
Old 11-23-2004, 03:48 PM
 
PhilJ PhilJ is offline
 

X-Guru
  
Join Date: Nov 2002
Posts: 4,094
 

Default

Great mod - thank you - very versatile too. How can I display it within the xcart template?
__________________
xcartmods.co.uk
Reply With Quote
  #9  
Old 11-23-2004, 04:53 PM
 
fernando fernando is offline
 

Member
  
Join Date: Oct 2004
Posts: 29
 

Default

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
__________________
Fernando
Sorry, I\'m not using x-cart anymore, so I am unable to reply to enquiries about modules. Thank you.
Reply With Quote
  #10  
Old 11-24-2004, 05:05 AM
 
PhilJ PhilJ is offline
 

X-Guru
  
Join Date: Nov 2002
Posts: 4,094
 

Default

It's ok, I've found a way round it, thanks again.
__________________
xcartmods.co.uk
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 12:04 AM.

   

 
X-Cart forums © 2001-2020