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)
-   -   Developer's doc?? (https://forum.x-cart.com/showthread.php?t=27643)

bebekisses.com 12-28-2006 10:27 AM

Developer's doc??
 
Folks,

I'm trying to work on some customization of the smarty templates for our cutover to xcart.

Is there a list of smarty variables used available to the template developers?

Thanks!! :wink:

Jon 12-28-2006 10:36 AM

Re: Developer's doc??
 
Your best bet is to use "webmaster" mode in the admin.

bebekisses.com 12-28-2006 10:41 AM

Re: Developer's doc??
 
Thanks, but that does nothing for smarty variables.

bebekisses.com 12-28-2006 12:10 PM

Re: Developer's doc??
 
added
Code:

$x = $smarty->get_template_vars();

function print_r_string($arr,$first=true,$tab=0)
{
  $output = "";
  $tabsign = ($tab) ? str_repeat('    ',$tab) : '';
  if ($first) $output .= "<pre><br>\n";
  foreach($arr as $key => $val)
  {
      switch (gettype($val))
      {
          case "array":
              $output .= $tabsign."[".htmlspecialchars($key)."] = array(".count($val).")\n".$tabsign."(\n";
              $tab++;
              $output .= print_r_string($val,false,$tab);
              $tab--;
              $output .= $tabsign.")\n";
          break;
          case "boolean":
              $output .= $tabsign."[".htmlspecialchars($key)."] bool = '".($val?"true":"false")."'\n";
          break;
          case "integer":
              $output .= $tabsign."[".htmlspecialchars($key)."] int = '".htmlspecialchars($val)."'\n";
          break;
          case "double":
              $output .= $tabsign."[".htmlspecialchars($key)."] double = '".htmlspecialchars($val)."'\n";
          break;
          case "string":
              $output .= $tabsign."[".htmlspecialchars($key)."] string = '".((stristr($key,'passw')) ? str_repeat('*', strlen($val)) : htmlspecialchars($val))."'\n";
          break;
          default:
              $output .= $tabsign."[".htmlspecialchars($key)."] unknown = '".htmlspecialchars(gettype($val))."'\n";
          break;
      }
  }
  if ($first) $output .= "</pre>\n";
  return $output;
}

echo print_r_string($x); // for Example



to the bottom of init.php
and got a huge burst of information. time to parse.
[code]


[SCRIPT_NAME] string = '/store/product.php'
[ImagesDir] string = '/store/skin1/images'
[SkinDir] string = '/store/skin1'
[template_dir] string = '/var/www/html/store/skin1'
[skin_config] string = 'skin1.conf'
[http_location] string = 'http://192.168.1.18/store'
[https_location] string = 'https://192.168.1.18/store'
[xcart_web_dir] string = '/store'
[current_location] string = 'http://192.168.1.18/store'
[php_url] = array(2)
(
[url] string = 'http://192.168.1.18/store/product.php'
[query_string] string = 'productid=1&cat=3&page=1&DEBUG=true'
)
[var_dirs_web] = array(1)
(
[cache] string = 'http://192.168.1.18/store/var/cache'
)
[catalogs] = array(4)
(
[admin] string = 'http://192.168.1.18/store/admin'
[customer] string = 'http://192.168.1.18/store'
[provider] string = 'http://192.168.1.18/store/provider'
[partner] string = 'http://192.168.1.18/store/partner'
)
[catalogs_secure] = array(4)
(
[admin] string = 'https://192.168.1.18/store/admin'
[customer] string = 'https://192.168.1.18/store'
[provider] string = 'https://192.168.1.18/store/provider'
[partner] string = 'https://192.168.1.18/store/partner'
)
[files_location] string = '/var/www/html/store/files'
[XCARTSESSNAME] string = 'xid'
[XCARTSESSID] string = '5c891781b11f0fe62bacf4e6239ef4dd'
[number_format_dec] string = '.'
[number_format_th] string = ''
[number_format_point] int = '2'
[zero] string = '0.00'
[card_types] = array(12)
(
[0] = array(3)
(
[code] string = 'VISA'
[type] string = 'Visa'
[cvv2] string = '1'
)
[1] = array(3)
(
[code] string = 'MC'
[type] string = 'MasterCard'
[cvv2] string = '1'
)
[2] = array(3)
(
[code] string = 'AMEX'
[type] string = 'American Express'
[cvv2] string = '1'
)
[3] = array(3)
(
[code] string = 'DICL'
[type] string = 'Diners Club'
[cvv2] string = ''
)
[4] = array(3)
(
[code] string = 'JCB'
[type] string = 'JCB'
[cvv2] string = ''
)
[5] = array(3)
(
[code] string = 'CARTE'
[type] string = 'Carte Blanche'
[cvv2] string = ''
)
[6] = array(3)
(
[code] string = 'ABC'
[type] string = 'Australian BankCard'
[cvv2] string = ''
)
[7] = array(3)
(
[code] string = 'DINO'
[type] string = 'Discover/Novus'
[cvv2] string = ''
)
[8] = array(3)
(
[code] string = 'SW'
[type] string = 'Switch'
[cvv2] string = ''
)
[9] = array(3)
(
[code] string = 'SO'
[type] string = 'Solo'
[cvv2] string = ''
)
[10] = array(3)
(
[code] string = 'ERT'
[type] string = 'enRoute'
[cvv2] string = ''
)
[11] = array(3)
(
Code:

string = 'UKE'
        [type] string = 'Visa Electron'
        [cvv2] string = '1'
    )
)
[webmaster_mode] string = 'editor'
[user_agent] string = 'ns'
[PROXY_IP] string = ''
[CLIENT_IP] string = '192.168.1.2'
[REMOTE_ADDR] string = '192.168.1.2'
[is_robot] string = 'N'
[active_modules] = array(20)
(
    [Wishlist] bool = 'true'
    [Detailed_Product_Images] bool = 'true'
    [Wholesale_Trading] bool = 'true'
    [Discount_Coupons] bool = 'true'
    [Extra_Fields] bool = 'true'
    [Order_Tracking] bool = 'true'
    [Gift_Certificates] bool = 'true'
    [Product_Options] bool = 'true'
    [Upselling_Products] bool = 'true'
    [Advanced_Statistics] bool = 'true'
    [Bestsellers] bool = 'true'
    [Recommended_Products] bool = 'true'
    [Customer_Reviews] bool = 'true'
    [News_Management] bool = 'true'
    [Manufacturers] bool = 'true'
    [Fast_Lane_Checkout] bool = 'true'
    [HTML_Editor] bool = 'true'
    [Import_3x_4x] bool = 'true'
    [Special_Offers] bool = 'true'
    [Simple_Mode] bool = 'true'
)
[config] = array(63)
(
    [Company] = array(16)
    (
        [orders_department] string = 'orders@bebekisses.com'
        [support_department] string = 'help@bebekisses.com'
        [users_department] string = 'erika@bebekisses.com'
        [site_administrator] string = 'jay@bebekissses.com'
        [location_address] string = ''
        [location_city] string = ''
        [location_state] string = 'CA'
        [location_zipcode] string = '50001'
        [location_country] string = 'US'
        [company_name] string = 'bebe kisses'
        [company_website] string = 'www.bebekisses.com'
        [company_phone] string = ''
        [company_phone_2] string = ''
        [company_fax] string = ''
        [start_year] string = '2006'
        [end_year] string = '2006'
    )
    [General] = array(35)
    (
        [unlimited_products] string = 'N'
        [redirect_to_cart] string = 'Y'

    ... truncated


Thanks all.

Jon 12-28-2006 12:16 PM

Re: Developer's doc??
 
Sorry I misunderstood your question.

Keep in mind that not all variables are global so you'll want to check a variable before using it globally.

bebekisses.com 01-01-2007 03:40 PM

Re: Developer's doc??
 
Quote:

Originally Posted by Jon
Sorry I misunderstood your question.

Keep in mind that not all variables are global so you'll want to check a variable before using it globally.


Thanks! I just added a global variable to init because there are a million includes w/ this app, and being that there is little to no developer's documentation, I chose the path of least resistance. ;)


All times are GMT -8. The time now is 06:55 PM.

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