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

"Special Offer" Tag

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 04-20-2009, 04:53 AM
 
jon@leapfrogcomputers.co. jon@leapfrogcomputers.co. is offline
 

Member
  
Join Date: Jul 2006
Posts: 21
 

Default "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
__________________
Version 4.4.1 Gold
Reply With Quote
  #2  
Old 04-20-2009, 06:10 AM
 
carpeperdiem carpeperdiem is offline
 

X-Guru
  
Join Date: Jul 2006
Location: New York City, USA
Posts: 5,399
 

Default 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.
__________________
xcart 4.5.4 gold+ w/x-payments 1.0.6; xcart gold 4.4.4
Reply With Quote
  #3  
Old 04-20-2009, 06:40 AM
 
jon@leapfrogcomputers.co. jon@leapfrogcomputers.co. is offline
 

Member
  
Join Date: Jul 2006
Posts: 21
 

Default 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
__________________
Version 4.4.1 Gold
Reply With Quote
  #4  
Old 04-20-2009, 06:59 AM
 
jon@leapfrogcomputers.co. jon@leapfrogcomputers.co. is offline
 

Member
  
Join Date: Jul 2006
Posts: 21
 

Default 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>
__________________
Version 4.4.1 Gold
Reply With Quote
  #5  
Old 04-20-2009, 07:03 AM
 
carpeperdiem carpeperdiem is offline
 

X-Guru
  
Join Date: Jul 2006
Location: New York City, USA
Posts: 5,399
 

Default 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?
__________________
xcart 4.5.4 gold+ w/x-payments 1.0.6; xcart gold 4.4.4
Reply With Quote
  #6  
Old 04-20-2009, 07:42 AM
 
jon@leapfrogcomputers.co. jon@leapfrogcomputers.co. is offline
 

Member
  
Join Date: Jul 2006
Posts: 21
 

Default 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
__________________
Version 4.4.1 Gold
Reply With Quote
  #7  
Old 05-05-2009, 02:39 AM
 
jon@leapfrogcomputers.co. jon@leapfrogcomputers.co. is offline
 

Member
  
Join Date: Jul 2006
Posts: 21
 

Default Re: "Special Offer" Tag

can anybody help?

Thanks
__________________
Version 4.4.1 Gold
Reply With Quote
  #8  
Old 05-05-2009, 02:01 PM
 
Christofer Christofer is offline
 

eXpert
  
Join Date: Apr 2009
Location: Thessaloniki, Greece
Posts: 202
 

Default 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 :/
__________________
X-Cart Gold : 4.2.1 (on linux parallels plesk / mysql)
Php v5.2.9 (Zend: 2.2.0) - MySql v5.0.79 - LiteSpeed server
Modules : X-Offer & X-Aom & One page checkout
Product tabs & Product downloads & many more
Reply With Quote
  #9  
Old 07-16-2010, 01:25 AM
 
jon@leapfrogcomputers.co. jon@leapfrogcomputers.co. is offline
 

Member
  
Join Date: Jul 2006
Posts: 21
 

Default Re: "Special Offer" Tag

Bump
__________________
Version 4.4.1 Gold
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 01:26 PM.

   

 
X-Cart forums © 2001-2020