View Single Post
  #147  
Old 11-20-2006, 08:13 AM
 
Miniature-Giant Miniature-Giant is offline
 

Advanced Member
  
Join Date: Oct 2006
Posts: 71
 

Default Re: XC SEO v1.1.0 Released

I made two edits -- for two different feature additions:
1) to include the "sku" in the url, I edited the function _product_filename by adding the line:
if ($options['sku'] && !defined("IS_ROBOT"))
$options['result_title'] .= $this->_sku_prefix.$options['sku'];
after the similar line for the $options['printable']

2) I have JavaScript on my home page that randomly cycles through products in my catalog, showing them off. I wanted the customer to be able to click on these images and be taken to the corresponding product. But, I did not have an easy way in JavaScript to translate the SKU (which is what I used to name the images) to productid values. So, I added the following line as the first code line in the same function:
if ( ($options['productid']=="1") && $options['sku']){
$options['productid'] = func_query_first_cell("SELECT productid
FROM $sql_tbl[products]
WHERE productcode = '".$options['sku']."'");
}

In my system, there is no product with a productid of "1", so, if one is requested, this code uses the sku to lookup the correct productid in the db. This way I could have all my auto-generated images have anchor tags to product.php?productid=1&sku=<sku number>

Works like a charm.
(I'm in the final stages of testing, but you are welcome to see it at www.miniature-giant.com )

Hope the above makes sense -- if not, let me know and I'll elaborate,
Thanks,
James
__________________
X-Cart Gold v 4.1.3
Reply With Quote