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

How to display the price of a specific productid?

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #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
  #2  
Old 01-06-2004, 10:39 PM
 
jordan0 jordan0 is offline
 

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

Default Re: How to display the price of a specific productid?

Well damn! I resolved this one immediately after I posted the last message. For anyone else out there in the same boat, heres what I found:

In products.php, the $first_page in the code below restricts what goes into $products to whatever is on the first page (duh right?)
Code:
$products = func_search_products($search_query, $user_account['membership'], $first_page,$current_category["product_count"]); if (count($products) ==0) $products="";

So to solve my problem, I just made an if statement that removes when I need all of the prices for the whole category:
Code:
if ($cat == "35") { $products = func_search_products($search_query, $user_account['membership'],$current_category["product_count"]); if (count($products) ==0) $products=""; } else { $products = func_search_products($search_query, $user_account['membership'], $first_page,$current_category["product_count"]); if (count($products) ==0) $products=""; }

I wonder if this will ever help anyone...
__________________
Jordan Sitkin
http://www.kitkraft.biz
X-Cart 4.0.18 [unix]
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 11:42 PM.

   

 
X-Cart forums © 2001-2020