View Single Post
  #1  
Old 01-06-2004, 04:46 PM
 
jordan0 jordan0 is offline
 

Advanced Member
  
Join Date: Oct 2003
Location: San Francisco, CA
Posts: 77
 

Default How to display the price of a specific productid?

hi Б─⌠ i've got an easy one:
How do i simply display the price of a specified item in the catalog?
I've tried
Code:
{include file="currency.tpl" value=$products[393].price}
with no success. I guess the $products array doesn't use the productid's to identify the items in it?

I am trying to display the price of the item with the xcart-given productid of 393. This is in a customized products.tpl template that is loaded with the following command:
Code:
{include file="customer/main/products_struc_stripstick.tpl" products=$products}
I'm hard-coding all of the price references because I don't think I could wrap my head around trying to automatically generate a chart like this with smarty. The inventory is hardly ever going to change anyway...

Y'all can see what I'm talking about: http://www.kitkraft.biz/customer/home.php?cat=35

*** Update (removed first one Б─⌠ no longer relevant) ***

So I found how to get the prices, and how to get the array in the right order (It was because of mod_sort, as I suspected).

But... I have a new problem:
The $products array only contains the price info on the first 12 products, because thats what I have set my "maximum products per page" option to in the admin section. I have tried modifying the products.php to put a different value into $objects_per_page, but that variable apparently doesn't have to do with what goes in the $products array.
I think I'm right in assuming that somewhere in products.php, $config["Appearance"]["products_per_page"] is used to determine how much info gets put into $products. Based on that, though, I can't seem to figure this one out.
My goal is to make it so that $products contains all of the pricing info for the whole category, not just one page at a time. I'll have to work this into an if statement that only does this for those categories which need it.

Any of you experts out there been through this already?
__________________
Jordan Sitkin
http://www.kitkraft.biz
X-Cart 4.0.18 [unix]
Reply With Quote