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

How to add variable ?

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 12-27-2010, 10:29 PM
 
e-best1 e-best1 is offline
 

Member
  
Join Date: Sep 2008
Posts: 22
 

Question How to add variable ?

I am going to insert return policy text area by using variable return_detail above title tag in new product or modify product of admin mode
I don't know how to define return_detail variable and how to do to input return policy into the variable return_detail..
I can't find anything related to do this ...
Please help me !!
__________________
X-cart Gold 4.4.1
Linux
Reply With Quote
  #2  
Old 12-28-2010, 03:00 AM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,190
 

Default Re: How to add variable ?

Not sure what you mean. You can add language variable from languages area in admin and then just call it anywere you need to
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote
  #3  
Old 12-30-2010, 11:54 AM
 
e-best1 e-best1 is offline
 

Member
  
Join Date: Sep 2008
Posts: 22
 

Default Re: How to add variable ?

Thanks..
I mean I want to define a variable like $product.descr
so, I can input different return policy into the variable in each product..
How can I do this??
Thanks..
__________________
X-cart Gold 4.4.1
Linux
Reply With Quote
  #4  
Old 12-30-2010, 11:56 AM
  ARW VISIONS's Avatar 
ARW VISIONS ARW VISIONS is offline
 

X-Man
  
Join Date: Jan 2007
Location: Pensacola, FL
Posts: 2,536
 

Default Re: How to add variable ?

need access to the DB, and how r your PHP skills?
__________________
xcart 5.1.2
Reply With Quote
  #5  
Old 12-30-2010, 12:13 PM
  gb2world's Avatar 
gb2world gb2world is offline
 

X-Wizard
  
Join Date: May 2006
Location: Austin, TX
Posts: 1,970
 

Default Re: How to add variable ?

You can also use extra fields to set up and define variables per product: http://help.qtmsoft.com/index.php?title=X-Cart:Extra_Fields

---
__________________
X-CART (4.1.9,12/4.2.2-3/4.3.1-2/4.4.1-5)-Gold
(CDSEO, Altered-Cart On Sale, BCSE Preorder Backorder, QuickOrder, X-Payments, BCSE DPM Module)
Reply With Quote
  #6  
Old 12-30-2010, 01:25 PM
 
e-best1 e-best1 is offline
 

Member
  
Join Date: Sep 2008
Posts: 22
 

Default Re: How to add variable ?

In case of using extra field, how can I show the value of extra field?
Thanks...
__________________
X-cart Gold 4.4.1
Linux
Reply With Quote
  #7  
Old 12-30-2010, 02:38 PM
  gb2world's Avatar 
gb2world gb2world is offline
 

X-Wizard
  
Join Date: May 2006
Location: Austin, TX
Posts: 1,970
 

Default Re: How to add variable ?

http://help.qtmsoft.com/index.php?title=X-Cart:Extra_Fields

search for "show" on the documentation page above

---
__________________
X-CART (4.1.9,12/4.2.2-3/4.3.1-2/4.4.1-5)-Gold
(CDSEO, Altered-Cart On Sale, BCSE Preorder Backorder, QuickOrder, X-Payments, BCSE DPM Module)
Reply With Quote
  #8  
Old 12-30-2010, 06:42 PM
 
e-best1 e-best1 is offline
 

Member
  
Join Date: Sep 2008
Posts: 22
 

Default Re: How to add variable ?

I don't know how to show extra field value(for example fieldid is 5) with upper link..
Anybody to let me know how to show extra field value..?
__________________
X-cart Gold 4.4.1
Linux
Reply With Quote
  #9  
Old 12-30-2010, 07:53 PM
  gb2world's Avatar 
gb2world gb2world is offline
 

X-Wizard
  
Join Date: May 2006
Location: Austin, TX
Posts: 1,970
 

Default Re: How to add variable ?

It depends on where you are trying to display them.

If it is on the product page - they will display with the "show" setting described in the documentation. They are displayed in the details section.

If it is on another page or section, you need to see if they are already available by using webmaster mode and looking at the smarty variables. (Look for an array called $extra_fields.) If they are not available, you have to edit the php file to add a query to get them.

If they are available, you can do a loop similar to what is used on the product page to display them all. (See /common_files/modules/Extra_Fields.) You can use if-than statements within the loop to display/not display what you want.

You can also reference them directly knowing their position in the array - something like $extra_fields[5].field_value - You can see all this in the webmastermode console.

This is for an older version - but if you can understand all the code snippets in this thread - you should be able to display what you need

---
__________________
X-CART (4.1.9,12/4.2.2-3/4.3.1-2/4.4.1-5)-Gold
(CDSEO, Altered-Cart On Sale, BCSE Preorder Backorder, QuickOrder, X-Payments, BCSE DPM Module)
Reply With Quote
  #10  
Old 02-01-2011, 09:27 PM
 
thygtd thygtd is offline
 

Advanced Member
  
Join Date: Dec 2010
Posts: 31
 

Default Re: How to add variable ?

Hi,

I have tried to get the Extra Fields values, but values are not retriving. Can you please give me a detailed example. Because i m new to xcart. My requirement is I need to add one common value with the all product price. For this I have added 1 extra fields and make this to get the default values. When i m check with the Webmaster mode to check the extra_field variable its not available. Can you please suggest.

Thanks
__________________
X-Cart/LiteCommerce version v4.4.1
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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:23 AM.

   

 
X-Cart forums © 2001-2020