X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   Show clickable manufacturer in description of product (https://forum.x-cart.com/showthread.php?t=28100)

Warwick 01-17-2007 06:44 AM

Show clickable manufacturer in description of product
 
I have added the following code in product.tpl:

Code:

<a href="manufacturers.php?manufacturerid={$v.manufacturerid}"><u>{$product.manufacturer}</u></a>

This shows the manufacturer name of the product shown and it's clickable but the url goes to manufacturers.php?manufacturerid= without the manufacturer's id behind it; is there a way to get this done?

wjbrewer 01-17-2007 06:52 AM

Re: Show clickable manufacturer in description of product
 
Try this:

HTML Code:

<a href="manufacturers.php?manufacturerid={$product.manufacturerid}"><u>{$product.manufacturer}</u></a>

Warwick 01-17-2007 06:57 AM

Re: Show clickable manufacturer in description of product
 
You're the man Bill! Working great :)

Thanks,
Pieter

Warwick 01-17-2007 07:03 AM

Re: Show clickable manufacturer in description of product
 
Do you also know how to get clickable search keywords? (see also: http://forum.x-cart.com/showthread.php?t=26481)

I know how to display them on the product page (by adding {$product.keywords}) but I want them to be clickable so that the search function is used with the clicked word.

Imagine something looking like this:

Related search terms: blue, medium, cotton

when you click on let's say 'blue' the search engine is used displaying all products found with 'blue' as search keyword. I hope this makes sense?

wjbrewer 01-17-2007 09:52 AM

Re: Show clickable manufacturer in description of product
 
I'm not sure, I will work something out and post it for you later today.

Warwick 01-17-2007 02:52 PM

Re: Show clickable manufacturer in description of product
 
That would be great!

wjbrewer 01-17-2007 05:19 PM

Re: Show clickable manufacturer in description of product
 
First you will need to configure your search to work with URL queries. You can try this mod (I have never used this mod, so it may or may not work).

http://forum.x-cart.com/showthread.php?t=18488

Then you will have to separate your keywords with just a space (so they be separated and placed into an array).

Open product.php.

After this:

PHP Code:

if (!empty($active_modules["Special_Offers"])) {
    include 
$xcart_dir."/modules/Special_Offers/product_offers.php";



Add these lines

PHP Code:

$keywords preg_split("/\W+/"$product_info['keywords']);
$smarty->assign('keywords'$keywords); 


Then add this to your product.tpl wherever you want the links:

HTML Code:

<p>
{foreach from=$keywords item=keyword}
<a href="search.php?search={$keyword}">{$keyword}</a><br />
{/foreach}
</p>


Let me know if the search by URL mod doesn't work for 4.1.x

Warwick 01-17-2007 11:38 PM

Re: Show clickable manufacturer in description of product
 
You're not the man you're the master! Works great :)
Thanks a million.

Warwick 01-18-2007 05:36 AM

Re: Show clickable manufacturer in description of product
 
Final question; is it also possible to get the search keywords that are in the 'international description' of the product?

i.e. to make it multilanguage (english keywords shown when English is selected as language; french keywords shown when French language is selected by visitor).

Now it is showing the search keywords from the 'Product details' in the backoffice.

Warwick 02-09-2007 01:42 PM

Re: Show clickable manufacturer in description of product
 
Is there anybody outthere who can help me with this?


All times are GMT -8. The time now is 10:06 PM.

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