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

Anyone have a tpl for all products by category on one page?

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 01-20-2010, 12:42 PM
 
Primordial Performance Primordial Performance is offline
 

Advanced Member
  
Join Date: Oct 2007
Posts: 49
 

Default Anyone have a tpl for all products by category on one page?

I've almost finished building this myself quick n dirty using {php}, but there must be an easier way. Basically I want a product page that looks like this:
CATEGORY NAME 1
A product another product yet another

CATEGORY NAME 2
fourth product fifth product
etc., with thumbnail and buy now button for each product. It seems like it should be easy to make this from an existing page - I'm afraid that my PHP approach is too much reinventing the wheel, and that a pure smarty solution would be more efficient.
__________________
Primordial Performance X-cart 4.2.10
Modules: Advanced Order Management, Checkout_one, Discount Coupons, Extra Fields, FedEx Rates, FedEx Ship, FedEx Subscription, FedEx Track, HTML Editor, Order Tracking, On-Sale, and X-Affiliate,
BCSE Reward Points System,
Upselling Products,
Product Options,
Reply With Quote
  #2  
Old 01-20-2010, 05:43 PM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,191
 

Default Re: Anyone have a tpl for all products by category on one page?

I don't think that this exist in xcart by default. You need a php script to query the db for each category and products in it and assign these array values to smarty to use in a template. Using {php} inside template may do the job but it is no good with the amount of data you are trying to get and show
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote
  #3  
Old 01-21-2010, 07:19 AM
 
Primordial Performance Primordial Performance is offline
 

Advanced Member
  
Join Date: Oct 2007
Posts: 49
 

Default Re: Anyone have a tpl for all products by category on one page?

Quote:
Originally Posted by cflsystems
I don't think that this exist in xcart by default. You need a php script to query the db for each category and products in it and assign these array values to smarty to use in a template. Using {php} inside template may do the job but it is no good with the amount of data you are trying to get and show
Thanks...I guess I'll just clean up my {php} and move it to a proper php file in the root directory and use smarty properly for display.

Is anyone aware of a reason to avoid using {php} in .tpls OTHER THAN separation of logic and display? Just trying to understand xcart better and keep code as efficient as possible.

Also - if anyone else is looking for the same functionality, let me know and I'll share the technique once it's all clean.
__________________
Primordial Performance X-cart 4.2.10
Modules: Advanced Order Management, Checkout_one, Discount Coupons, Extra Fields, FedEx Rates, FedEx Ship, FedEx Subscription, FedEx Track, HTML Editor, Order Tracking, On-Sale, and X-Affiliate,
BCSE Reward Points System,
Upselling Products,
Product Options,
Reply With Quote
  #4  
Old 01-21-2010, 12:33 PM
  gizmo's Avatar 
gizmo gizmo is offline
 

X-Adept
  
Join Date: Jan 2005
Location: Crawley : UK
Posts: 618
 

Default Re: Anyone have a tpl for all products by category on one page?

Wouldn't a good site map generate what you want?

Just thought this may be one way? yep it would have all the other stuff but you could strip it down
__________________
Thank You - Alan
Don't be like me, and keep saying "Nearly did it" go do it!!
Version: 4.4.4 Gold -
Reply With Quote
  #5  
Old 02-09-2010, 08:35 AM
 
presson83 presson83 is offline
 

Senior Member
  
Join Date: Sep 2008
Posts: 143
 

Default Re: Anyone have a tpl for all products by category on one page?

Quote:
Originally Posted by Primordial Performance
Thanks...I guess I'll just clean up my {php} and move it to a proper php file in the root directory and use smarty properly for display.

Is anyone aware of a reason to avoid using {php} in .tpls OTHER THAN separation of logic and display? Just trying to understand xcart better and keep code as efficient as possible.

Also - if anyone else is looking for the same functionality, let me know and I'll share the technique once it's all clean.

I'm very interested in this functionality - how's it coming along?
__________________
v 4.1.11, v 4.2
Reply With Quote
  #6  
Old 02-09-2010, 11:36 AM
 
presson83 presson83 is offline
 

Senior Member
  
Join Date: Sep 2008
Posts: 143
 

Default Re: Anyone have a tpl for all products by category on one page?

Found this post and it has a pretty good example of how to do this:
http://forum.x-cart.com/showthread.php?t=19730&highlight=all+products+by+c ategory+on+one+page
__________________
v 4.1.11, v 4.2
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 04:22 PM.

   

 
X-Cart forums © 2001-2020