X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   "Special Offer" Tag (https://forum.x-cart.com/showthread.php?t=47042)

jon@leapfrogcomputers.co. 04-20-2009 04:53 AM

"Special Offer" Tag
 
I'm trying to modify the products_list.tpl so that it will display information in a custom field.

For example, i have created a custom field called "SPECIAL_OFFER" and created a custom styled div that i would like to display the text from the custom field, like this:

http://i42.tinypic.com/r88rb5.jpg

The problem is i can't figure out the the right statements to:

A) Show the DIV only when there is something in that field
and
B) Show put the contents of that field into the DIV as shown above.

Many Thanks!

Carl

carpeperdiem 04-20-2009 06:10 AM

Re: "Special Offer" Tag
 
Carl,

This thread has all the code you need to do this:

http://forum.x-cart.com/showthread.php?t=46059

The key is to use an if to determine if the extra field has content, if so, display the div.

jon@leapfrogcomputers.co. 04-20-2009 06:40 AM

Re: "Special Offer" Tag
 
HI carpeperdiem,
I've just been through that thread but i am still having issues getting it to display the div when i enter text into the custom field :(

jon@leapfrogcomputers.co. 04-20-2009 06:59 AM

Re: "Special Offer" Tag
 
What is need is:

Does field "SPECIAL_OFFER" contain anything?
|-> Yes, Show:
Code:

<div class="special-offer-tag">
SPECIAL OFFER: text from "SPECIAL_OFFER" field</div>


carpeperdiem 04-20-2009 07:03 AM

Re: "Special Offer" Tag
 
Carl,

Did you assign a var and get the var to appear on the page? If you can get it to the page, then constraining it to "only if it exists" is simple.

What code did you use to get it to the page?

jon@leapfrogcomputers.co. 04-20-2009 07:42 AM

Re: "Special Offer" Tag
 
I couldn't get it to display on the page at all. I'm guessing i didnt assign the var correctly :(

I used the code from the one of the examples in the other thread and changed the fields etc. to match mine

jon@leapfrogcomputers.co. 05-05-2009 02:39 AM

Re: "Special Offer" Tag
 
can anybody help?

Thanks

Christofer 05-05-2009 02:01 PM

Re: "Special Offer" Tag
 
Quote:

Originally Posted by jon@leapfrogcomputers.co.
can anybody help?

Thanks

i also tried to show the extra fields on products list page, but no luck yet :/

jon@leapfrogcomputers.co. 07-16-2010 01:25 AM

Re: "Special Offer" Tag
 
Bump :)


All times are GMT -8. The time now is 05:47 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.