oc-content/themes/veronika/functions.php
// SIMPLE CURRENCY SELECT (publish)
SIMPLE CURRENCY SELECT (publish)
SIMPLE CURRENCY SELECT ( publish )
function veronika_simple_currency() {
  $currencies = osc_get_currencies();
  $item = osc_item(); 
  if((osc_is_publish_page() || osc_is_edit_page()) && veronika_get_session('currency') <> '') {
    $id = veronika_get_session('currency');
  } else {
    $id = Params::getParam('currency');
  }
  $currency = $id <> '' ? $id : osc_get_preference('currency');
  if( isset($item['fk_c_currency_code']) ) {
    $default_key = $item['fk_c_currency_code'];
  } elseif( isset( $currency ) && $currency <> '' ) {
    $default_key = $currency;
  } else {
    $default_key = $currencies[0]['pk_c_code'];
  }
  if($default_key <> '') {
    $default_currency = Currency::newInstance()->findByPrimaryKey($default_key);
  } else {
    $default_currency = array('pk_c_code' => '', 's_description' => '');
  }
  $html  = '<div class="simple-currency simple-select">';
  $html .= '<input type="hidden" name="currency" id="currency" class="input-hidden" value="' . $default_currency['pk_c_code'] . '"/>';
  $html .= '<span class="text round3 tr1"><span>' . $default_currency['pk_c_code'] . ' (' . $default_currency['s_description'] . ')</span> <i class="fa fa-angle-down"></i></span>';
  $html .= '<div class="list">';
  $html .= '<div class="option info">' . __('Currency', 'veronika') . '</div>';
  foreach($currencies as $c) {
    $html .= '<div class="option' . ($c['pk_c_code'] == $default_key ? ' selected' : '') . '" data-id="' . $c['pk_c_code'] . '">' . $c['pk_c_code'] . ' (' . $c['s_description'] . ')</span></div>';
  }
  $html .= '</div>';
  $html .= '</div>';
  return $html;
}
function veronika_simple_currency ( ) { $ currencies = osc_get_currencies ( ) ; $ item = osc_item ( ) ; if ( ( osc_is_publish_page ( ) || osc_is_edit_page ( ) ) && veronika_get_session ( 'currency' ) <> '' ) { $ id = veronika_get_session ( 'currency' ) ; } else { $ id = Params :: getParam ( 'currency' ) ; } $ currency = $ id <> '' ? $ id : osc_get_preference ( 'currency' ) ; if ( isset ( $ item [ 'fk_c_currency_code' ] ) ) { $ default_key = $ item [ 'fk_c_currency_code' ] ; } elseif ( isset ( $ currency ) && $ currency <> '' ) { $ default_key = $ currency ; } else { $ default_key = $ currencies [ 0 ] [ 'pk_c_code' ] ; } if ( $ default_key <> '' ) { $ default_currency = Currency :: newInstance ( ) -> findByPrimaryKey ( $ default_key ) ; } else { $ default_currency = array ( 'pk_c_code' => '' , 's_description' => '' ) ; } $ html = '<div class="simple-currency simple-select">' ; $ html .= '<input type="hidden" name="currency" id="currency" class="input-hidden" value="' . $ default_currency [ 'pk_c_code' ] . '"/>' ; $ html .= '<span class="text round3 tr1"><span>' . $ default_currency [ 'pk_c_code' ] . ' (' . $ default_currency [ 's_description' ] . ')</span> <i class="fa fa-angle-down"></i></span>' ; $ html .= '<div class="list">' ; $ html .= '<div class="option info">' . __ ( 'Currency' , 'veronika' ) . '</div>' ; foreach ( $ currencies as $ c ) { $ html .= '<div class="option' . ( $ c [ 'pk_c_code' ] == $ default_key ? ' selected' : '' ) . '" data-id="' . $ c [ 'pk_c_code' ] . '">' . $ c [ 'pk_c_code' ] . ' (' . $ c [ 's_description' ] . ')</span></div>' ; } $ html .= '</div>' ; $ html .= '</div>' ; return $ html ; }
SIMPLE CURRENCY SELECT (publish)
SIMPLE CURRENCY SELECT ( publish )