3 for 2 icon display
This is what happens when you leave cart development for a few weeks, I've completely lost track with X-Cart! Anyway, I set up an extra field called "3for2" and I was hoping to use that as a trigger to get it to display a 3 for 2 graphic against the product in the various views. I was thinking something like this in the templates:
Code:
{if $product.3for2 eq "Y"} Also, if this is the way to go about it, will this work if I set the 3for2 field NOT to display as I only need it as a trigger for the graphic? And can I get it to display in the thumbnail (category) view as well as the detail? Thanks Dan |
the field will be called something like {product.param00} though not {$product.3for2}
|
Thanks Shan,
Is the only way to find out the actual name of the field to use PHPMyadmin? Thanks Dan |
Still can't get it to work. I'm experimenting with the product_thumbnail.tpl. Firstly, because I'm still finding my feet I just put the word "test" in to see where it shows on the screen (alongside the product image) and then I substituted test for :
Code:
{if $product.param00 eq "Y"}[img]{$ImagesDir}/3for2.gif[/img]{/if} So the template now looks like: Code:
{* $Id: product_thumbnail.tpl,v 1.10 2003/08/11 10:45:10 svowl Exp $ *} Thanks Dan |
you have to put your code in products.tpl for it to appear in the products list and product.tpl for it to appear on product details
the code you ould use in products.tpl would be along the lines of Code:
{if $products[product].param00 ne ""} and for product.tpl Code:
{if $product.param00 ne ""} the code basically says ... if param00 does not equal nothing / empty do something replace param00 with the correct extra field that you are using. Use phpmyadmin to check or make a guess add this code below the call for the thumbnail |
Thanks Shan,
OK, I'm a tad confused now. Changes I made to product_thumbnail appeared fine. In trying to do what Shan suggests, any changes I try and make to main/products.tpl or product.tpl don't show up. In fact I deleted the entire contents of product.tpl, saved it, cleared the template cache and could still browse product details fine. Am I missing something here? Thanks Dan |
DOH! Sorry, scrub that last message, I was adjusting the wrong product/s.tpl -it's customer/main......I'll try again..! :roll:
Dan |
Shan, that worked! Thanks for the help! :D
Dan |
This maybe of some use to someone.
I'm trying to be clever with the use of these fields and the images. I'm fine with the 3for2 graphic but I want my freebie images included on the product details page. Because I have a range of freebie images I've set up a new field called Freebies (officially param01) and in that field I just name the jpeg minus the ".jpg" suffix. I then can use something like: Freebie/param001: FreeStand Name of jpg in default image directory: FreeStand.jpg Inserted at appropriate point in customers/main/product.tpl: Code:
{if $product.param01 ne ""} which outputs: Code:
http://www.myshop.com/x-cart/skin1/images/FreeStand.jpg It was useful for me anyhow! :D Dan |
All times are GMT -8. The time now is 01:22 AM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.