How to get rid of the '2-', 'q-' and 't-' in the SEF urls?

short answer

you can't

long answer

the url contains vital information to display the correct items from your database. The keywords in the url must match the location of the keyword in the database. Therefore you can't simply remove the numbers in the url. Same goes for the title parameter ( 't-'), it indicates that the query is on the title and not a category, and the 'q-' indicating a com_datafeeds search.

There are options to remove some of the unwanted parameters, however there is no generic solution. Below is a brief  description on how to customize the template.

Removing the t-

In the module and component templates you will find the code used to generate the url to a product (title), example:

$product_url=JRoute::_( $this->where['baselink']."&". make_urlencoded(array("qt"=>$item['title'])));

(not all templates have a product link, and the code might differ look for the qt)

Create a new template and create your own url to replace to old one:

$product_url="/Product/".urlencode($item['title']);

Now add a rule to your .htaccess

RewriteRule /?Product/(.*) index.php?option=com_datafeeds&view=items&Itemid=2&qt=$1&q1= [QSA]

where the '2' must be changed to the correct menu item id and the empty q1 is to fool the joomla router

Tweaking other fields

The same can be achieved for single fields, for example a list of 'Brands' on a fashion site, url :

"/Merk/'.urlencode($item['Select9'])

in the menu configuration the field Select9 is mapped to the menu level 6, so the rewrite rule becomes:

Rewriterule /?Merk/(.*) index.php?option=com_datafeeds&view=items&Itemid=4&q6=$1&q1= [QSA]

 

Removing the q-

you can't with modifying core code

Removing the numeric id

you can't

The URI of a com_datafeeds menu defines the input for the database query. Each position in the URI maps to a field defined in the menu configuration. If the path is complete there will be no numbers:

http://www.badmode.co/online/Heren/Zwembroeken/Diesel.html

If the URI contains gaps the numbers are needed to map correctly, in the example mapping the keyword 'Adidas' to the menu level 3:

http://www.badmode.co/online/3-Adidas.html

to avoid the numbers:

  1. do not use the module template 'search', 'ajax' and similar pull-down menu's
  2. when using the default menu module template  ( and similar ) set levels to 1, this suppresses direct links to deeper menu levels.

Whenever a keyword contains a dash, the numeric value is added as well, due to joomla core behaviour.


 

 

 

 

 

 

 

The component can import any CSV formatted file delimited with tab, ',', ';' or '|' and enclosed with '"' (optional). The CSV files must have a header row:

Tradetracker

 

A new feed is created by selecting 'Add feed' or 'New' from the components->datafeeds menu selection in the joomla administrator.

First visit the affiliate company's website and retrieve the feed url. Copy the feed url and past it into the 'feed url' field of the feedconfiguration.  Give this configuration a (unique) name.

Selecting the class

Each type of feed has it's own parser class.  You must select the correct class for a correct import. The default setting is 'auto detect', this will work for most XML feeds, however 'auto detect' will not work correctly for most CSV feeds. When using CSV feeds select the correct version (using the right delimiter) manually.

Below shows the picture for Legwear International a webgains feed.

hit the apply button, the feed should be fetched and the right hand should show data. The next step is to specifiy the mapping of the feed to the database using the 'Field Selection' sub menu. The component will try to prefill fields.

Groups and select fields

The database compromises 10 fields for categories, the first field 'Select0' or 'Group' is a fixed value entered in the feed configuration. The Select0 is the main category topic of the feed.

The other nine fields are mapped from the actual feed. For this tutorial the setup as to groups 'Fashion' and 'Accommodation', for this field the correct value for the Select0 field would be 'Fashion'. If you website is just a single topic the Select0 field is probably less relevant as a 'grouping' parameter, however you could use it the create a group of 'Premium' and a group of 'Normal' feeds. ( and use a module later to have a top pick from the premium feeds )

To the component the 10 fields have no specific meaning. Whenever starting a new group you must determine first how you want to use the fields ( and stick to it ). This tutorial will create a website with two groups, the mapping for the groups will be:

Select0 Fashion Accommodation
Select1 Category
Country
Select2 Sub Category
Region
Select3 Sub Sub
City
Select4

Select5

Select6 Size
Select7 Color
Select8 Gender
Select9 Brand

The order of the fields is not important, however life will be easier if you keep them in some common sense order.

 

For the Legwear International feed the mapping will look like:

Hit the Save button, and click 'Cron/Import data' the actually import the feed.

The callback function in the feed configuration allows the parse all items thru a filter, manipulating the data. This will be covered in another article.

 

The examples for the other three feeds of this tutorial:

 

Lingerie.co.uk (affiliatewindow)

 

Bellvilla ( Tradetracker)


Waytostay (Tradetracker)

 

 

After adding and importing (cron) the feeds, you should see the feeds in the feed submenu and some information about the imported items in the 'overview' and 'items' sub menu's.

Demo:

best4shopping.co.uk

Next step Adding a menu

Finding identical products

The real problem creating a price comparison website using joomla or any other script is finding identical products. For some product ranges price comparison is possible using unique codes like the EAN or ISBN code. Although even these codes are not as unique as you might hope they a quit good base for price comparison. In some fields like holidays or fashion ean codes are less common or not supplied in the datafeed. Finding identical (or even similar) product required some creative thinking, for accommodations the 'accommodation name' might be good option to use, for mobile phone the brand and type are indicators for more or less identical phones.

 

Siblings

Whatever your choice of 'identical products' is, the component supports finding siblings with the exact same 'key'

How to use

In the feed configuration assign the desired key to a 'Select' field. For example assign the ean field to select7. Assign the same key to the same select field for all your feeds ( at least feeds used in the same group/Select0) . The example below show the 'ean' field from the feed assigned to the database field 'Select 8'

In the menu configuration select assigned field for siblings (in the advanced tab) and the number of siblings to show.

In the example below the items are related using the 'Select 8' database field. For each item a maximum of 5 siblings are shown. For each feed ( = 'Merchant') only one item is show. And the siblings are order, thus this configuration will show the five cheapest merchants.

 

Creating a layout

In the layout use

$this->assignRef('siblings', $this->get( 'Siblings')); 

to get a list of siblings of the displayed items. Loop throught the array to display each sibling.

A layout is not included in the distribution. An example layout and help setting it up can be obtained as part of a support license

 

Example Samsung GSM Telefoons

Example LCD Televisie

 

Preparation

for webgains a username and password are required to download the feeds. It's best to add an extra user for this. Follow the link 'Manage Users' under 'Account' in the menu bar. Pick a nice username and password and select the access level 'none ( no login)'

 

The following pages will depict the setup of a complete joomla affiliatefeeds site The result will be best4shopping.co.uk

The description is for a site with two groups :

fashion and accommodation with each two feeds.