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

help displaying hidden products SKU.

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 09-30-2011, 06:06 PM
 
plnewton plnewton is offline
 

Advanced Member
  
Join Date: Sep 2011
Posts: 65
 

Default help displaying hidden products SKU.

I've added this; {$hidden_products.productcode} to my customer_manufacturer_products.tpl , and inside manufacturers.php I have added this code;

$newtons_query = "SELECT * FROM $sql_tbl[products] WHERE forsale = 'H' "; $hidden_products = func_query($newtons_query); //Assign the hidden_products variable (array) $smarty->assign('hidden_products', $hidden_products);



Can someone explain why this won't work? How can I display my hidden product's SKU's FOR THIS MANUFACTURER ONLY? Which files do I need to edit? What do I need to do? Someone, please help me! Thank you.
__________________
Version 4.4.3
Reply With Quote
  #2  
Old 10-01-2011, 06:37 AM
  rogue's Avatar 
rogue rogue is offline
 

X-Adept
  
Join Date: Apr 2007
Location: Loveland, Ohio
Posts: 770
 

Default Re: help displaying hidden products SKU.

Then on the TPL where you want to show them you need something like:

{foreach from=$hidden_products.products item=v key=k)}
{$v<br>}
{/foreach}
__________________
Richard Williams
Rogue Wave Limited

Initial Inventory Imports
Daily Inventory Updates
Daily Inventory Reports
Drop Ship Support
Order Export to Shipper/Supplier
Shopping Feeds That Work
Programming for X-Cart

richard@roguewavelimited.com
http://www.roguewavelimited.com
Reply With Quote

The following user thanks rogue for this useful post:
plnewton (10-01-2011)
  #3  
Old 10-01-2011, 06:52 AM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,201
 

Default Re: help displaying hidden products SKU.

In manufacturers.php before // Assign the current location line

Code:
if ($manufacturerid) { // get hidden products array $hidden_products = func_query("SELECT * FROM $sql_tbl[products] WHERE forsale = 'H' AND manufacturerid = '$manufacturerid'"); //Assign the hidden_products variable (array) to smarty $smarty->assign('hidden_products', $hidden_products); }

In the tpl where need to show result

Code:
{foreach from=$hidden_products item=i} SKU: <a href="product.php?productid={$i.productid}">{$i.productcode}</a> <br /> {/foreach}

Note that the way you started it this will work only if you go to any manufacturer page otherwise the code will just not execute and hidden_products array will be empty so nothign to show
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote

The following user thanks cflsystems for this useful post:
plnewton (10-01-2011)
  #4  
Old 10-01-2011, 01:46 PM
 
plnewton plnewton is offline
 

Advanced Member
  
Join Date: Sep 2011
Posts: 65
 

Default Re: help displaying hidden products SKU.

Very cool! I think I understand more about x-cart now. Thank you so much for your help!!!!!!!!!!!!!!
__________________
Version 4.4.3
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