![]() |
Products.tpl - What is safe to get rid of?
I want to take my products.tpl file from THIS to something like THIS.
I need to know what I HAVE to keep in the template file to ensure the store stills runs properly. There seems to be a lot of stuff in the original .tpl file that may not be needed. I guess an explaination of what each piece of code does is what i'm after really. This is my products.tpl file Quote:
Any help would be greatly appreciated before I start to rush in there like a bull in a china shop ;) |
That is a lot to ask :) Why not just try commenting out one piece at a time until you get where you want to go? Make a backup first.
|
Quote:
Haha, yeah sorry I know it is. Ok so commenting out? I know i've seen this before but I can't remember what you have to do. Is it [**] or something before everyline you want to lose? |
Ok 1 question then 8)
What part of that code is pulling the 'short description' from the product info? Is it ; {$products[product].descr|truncate:300:"...":true} ? And if so - is it possible to add html (ie a clickable image) in the short description field or is it text only? |
Yes, that is it. To comment it out, you would do this:
{* {$products[product].descr|truncate:300:"...":true} *} And yes, the description fields accept html |
Quote:
Big up B :) This is gonna be easier than I thought. When I've done it i'll up the code in case anybody else is ever looking for the same thing :) |
Grant, do you feel lucky today? :D
Replace products.tpl code with this: Code:
{* $Id: products.tpl,v 1.45.2.17 2006/04/21 08:53:50 svowl Exp $ *} |
Zaja - you are a LEGEND!
Thank you so much brother - that works beautifully :) I have a little problem though - after speaking with Jon at websitecm it turns out that I have to be using skin1/customer/main/products_t.tpl and NOT skin1/customer/main/products.tpl Now i've had a look inside products_t.tpl and had a play around and boy is that one confusing page of code! Could the code you have written here be used in the products_t.tpl file also? And where would I place it? Because everytime i've tried to edit it at all I get all kinds of math errors and smarty parse errors. Ideally i'm trying to go from this : (which is the basic 1 column product_t.tpl with the buy button activated) http://www.wyzeshop.com/1st.jpg To something like this : http://www.wyzeshop.com/2nd.jpg Thanks again for hooking up that code man :) |
Well....you need a full customization of product listing! ](*,)
It may be better to look into the "Professional Help Services - Requests" forum, there you can find users(like Ryan, TelaFirma, Boomer, Jon, Carrie ... ) that can do it for you with a reasonable fee. |
Quote:
:( Thats what I have slowly started to realise. So the code you pasted earlier can't just be thrown into products_t.tpl then? Anyone have any idea what kind of dollar am I gonna be looking at for something like this? |
Ok I've sorted it out now. I'm using multiple templates for both products and catergories. Here is the products_t.tpl I played around with below just in case it's at all useful to anybody else and a little screen shot of how it renders.
http://www.wyzeshop.com/screenshot5.jpg Quote:
|
Zaja,
The code you so generously supplied is working like a charm, again thank you so much. But I have a little problem with it that I can't figure out. I'm sure it's a simple one - well I hope it's a simple one ;) The 'add to cart' button displays in product listings even if the item is out of stock. Is there a simple fix for this? Cheers, G Quote:
|
Try to replace:
Code:
<input type="button" value="{$lng.lbl_add_to_cart}" onclick="document.orderform_{$products[product].productid}_{$products[product].add_date}.submit();"> Code:
{if $product.avail gt 0} |
Quote:
Oooppps! Now everything is out of stock? |
I have changed the code, try again please.
|
Nope still out of stock?
Just in case i'm being a spaz here is my products_t.tpl Quote:
|
fixed, replace(in products.tpl):
Code:
{if $product.avail gt 0}Code:
{if $products[product].avail gt 0} |
You are officially THE man! 8)
It be workin' harder than a $5 hooker... Thanks so much bro ;) |
Quote:
8) :mrgreen: :wink: :) |
I don't wanna take the piss but would you also know the code for placing a form button that is linked to 'show product details'?
As i'm using custom templates I have different things set up all over the place. I'm having a problem as everything that is searched for displays using the same template containing the 'add to cart' button when some products require the customer to select options before hitting the buy button. I just want to replace the 'add to cart' button with a 'show details' button for the cat listings pulled from a search. |
| All times are GMT -8. The time now is 10:11 AM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.