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

Single Product per category, straight to product description with clean URLs

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 12-01-2009, 05:18 AM
 
adeturner adeturner is offline
 

Newbie
  
Join Date: Nov 2007
Posts: 5
 

Default Single Product per category, straight to product description with clean URLs

Hi Guys

I've seen variations on this, but I'm hoping there is someway of acheiving both:

I am creating a store in 4.2.11 that will only ever have one product per category. When a user clicks a category, I'd like them to be directed directly to the product description.

I would also like to use clean URLs in the SEO mod.

I've seen the mod to acheive the desired effect when not using clean URLs, but not with. Can anyone help please!?
__________________
X-Cart 4.1.9
X-Cart 4.2.x
X-Cart 4.3
PHP 4.4.7
MySQL 4.1.22
Win2K3 / iis6
Redhat Enterprise Server 5.0
MySQL 5
PHP 5
Reply With Quote
  #2  
Old 12-01-2009, 05:26 AM
 
adeturner adeturner is offline
 

Newbie
  
Join Date: Nov 2007
Posts: 5
 

Default Re: Single Product per category, straight to product description with clean URLs

Answered it myself, just needed an extra slash:

Quote:

{if $products|@count eq 1}
{assign var="prodURL" value="product.php?productid=`$products.0.producti d`&cat=$cat&page=1"}
{php}
header( "Location: /" . $GLOBALS[smarty]->_tpl_vars[prodURL] );
{/php}
{/if}
__________________
X-Cart 4.1.9
X-Cart 4.2.x
X-Cart 4.3
PHP 4.4.7
MySQL 4.1.22
Win2K3 / iis6
Redhat Enterprise Server 5.0
MySQL 5
PHP 5
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



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 07:16 AM.

   

 
X-Cart forums © 2001-2020