Skip to content

LiteCommerce code HowTos

beatnbite edited this page May 7, 2012 · 1 revision

How to alter fields in address forms

To alter the fields you are to "decorate" getBillingRequiredFields() and getShippingRequiredFields() methods of \XLite\Model\Address class from your module.

How to replace the invoice logo in the stand-alone version?

You are to create a LiteCommerce module with "substitutional" skin that replaces the skins/default/en/order/invoice/parts/head.logo.tpl file with your one.

How to alter the position of the currency symbol?

You are to "decorate" formatPrice() method of \XLite\View\AView class. Here is an example:

public function formatPrice($value, \XLite\Model\Currency $currency = null)
{
  if (!isset($currency)) {
    $currency = \XLite::getInstance()->getCurrency();
  }

  $symbol = $currency->getSymbol() ?: (strtoupper($currency->getCode()) . ' ');
  $sign = 0 <= $value ? '' : '&minus;&#8197';

  return $sign . $currency->formatValue(abs($value)) . ' ' . $symbol;
}
Clone this wiki locally