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

Extra Field Search From product.tpl

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #21  
Old 07-21-2009, 03:33 PM
 
mrerotic mrerotic is offline
 

eXpert
  
Join Date: Feb 2009
Posts: 264
 

Default Re: Extra Field Search From product.tpl

ok the following is what I added to product.php
PHP Code:
// TEST ADDITION //
$product_cat func_query("SELECT category FROM $sql_tbl[categories] WHERE categoryid IN (SELECT categoryid FROM $sql_tbl[products_categories] WHERE productid ='$productid')"); 
if (!empty(
$product_cat)) {
foreach (
$product_cat as $c => $d) {
$explode_cats[] = $d['category'];
}
 
$smarty->assign("explode_cats"$explode_cats);
}
// END TEST ADDITION // 

And in product.tpl I added:
------------------------------
<div>
{foreach from=$explode_cats item=c}
<a href="search.php?mode=search&including=any&categor yid=1" title="{$c}">{$c}</a> |
{/foreach}
</div>

How can I pass the category id's to product.tpl in above so each href is correct for each categoryid? I have the categories passing correctly, I just can't figure out how to get the id's.

Thanks
__________________
x-cart 4.2.3
AlteredCart Smart Search
Auto Featured Products Mod (Personal Mod)
BCSE Product Importer Pro & Drop Shipper Pro
CDSEO Pro
CMS EZRecommends
EE slider login (Personal Mod)
Next Prev Link Mod (Customized)
ShadowBox Detailed Images (Personal Mod)
Shop By Price (Customized)
Social Media (Personal Mod)
Switch Layout View (Personal Mod)
Special Offers
Testimonials (Personal Mod)
Whats New (Customized)
Reply With Quote
  #22  
Old 07-21-2009, 04:54 PM
 
mrerotic mrerotic is offline
 

eXpert
  
Join Date: Feb 2009
Posts: 264
 

Default Re: Extra Field Search From product.tpl

OK I got this to work:

In product.php I have:
PHP Code:
# Start show categories for each product (ADD-ON)
$product_cat func_query("SELECT category, categoryid FROM $sql_tbl[categories] WHERE categoryid IN (SELECT categoryid FROM $sql_tbl[products_categories] WHERE productid ='$productid')");  
if (!empty(
$product_cat)) {
 foreach (
$product_cat as $c => $d) {
  
$explode_cats[] = $d;
 }
 
 
$smarty->assign("explode_cats"$explode_cats);
}
# end add to show categories for each product (ADD-ON) 

Then in product.tpl I have the following:
---------------------------------------
<div>
{foreach from=$explode_cats item=c}
{assign var=Pcatid value=$c.categoryid}
{assign var=Pcatname value=$c.category}
<a href="search.php?mode=search&including=any&categor yid={$Pcatid}" title="{$Pcatname}">{$Pcatname}</a> |
{/foreach}
</div>

I HOPE THIS HELPS SOMEONE...

THANKS FOR ALL THE HELP
__________________
x-cart 4.2.3
AlteredCart Smart Search
Auto Featured Products Mod (Personal Mod)
BCSE Product Importer Pro & Drop Shipper Pro
CDSEO Pro
CMS EZRecommends
EE slider login (Personal Mod)
Next Prev Link Mod (Customized)
ShadowBox Detailed Images (Personal Mod)
Shop By Price (Customized)
Social Media (Personal Mod)
Switch Layout View (Personal Mod)
Special Offers
Testimonials (Personal Mod)
Whats New (Customized)
Reply With Quote
  #23  
Old 04-21-2010, 02:44 AM
 
flamers flamers is offline
 

Advanced Member
  
Join Date: Nov 2004
Posts: 51
 

Default Re: Extra Field Search From product.tpl

Hi mrerotic, I also want to explode extra field items (a performer list, exactly the same as your initial query on this thread) but I am having a little difficulty following the code changes needed. Could you possibly post the coding changes that you carried out to make a hyperlink for each performer name?

Thanks in advance.
__________________
X-Cart V 4.0.18
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 02:26 PM.

   

 
X-Cart forums © 2001-2020