Новости Joomla

0 Пользователей и 1 Гость просматривают эту тему.
  • 2 Ответов
  • 3335 Просмотров
*

Bowa

  • Захожу иногда
  • 363
  • 5 / 0
Может кто подскажет? как поменять вид выбора валют с Ссылок на Кнопки. Вот сам код, так как он немного отличается от стандартного...

Код
<?php
if( !defined( '_VALID_MOS' ) && !defined( '_JEXEC' ) ) die( 'Direct Access to '.basename(__FILE__).' is not allowed.' );
/**
* Currency Selector Module
*
* NOTE: THIS MODULE REQUIRES THE VirtueMart COMPONENT!
/*
* @version $Id: mod_virtuemart_currencies.php 1599 2009-01-08 19:05:51Z soeren_nb $
* @package VirtueMart
* @subpackage modules
*
* @copyright (C) 2007-2009 soeren - All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
* VirtueMart is Free Software.
* VirtueMart comes with absolute no warranty.
*
* www.virtuemart.net
*/

global $mosConfig_absolute_path, $sess, $option, $page, $ps_html, $vendor_accepted_currencies;

// Load the VirtueMart main parse code
if( file_exists(dirname(__FILE__).'/../../components/com_virtuemart/virtuemart_parser.php' )) {
   require_once( dirname(__FILE__).'/../../components/com_virtuemart/virtuemart_parser.php' );
} else {
   require_once( dirname(__FILE__).'/../components/com_virtuemart/virtuemart_parser.php' );
}

$text_before = $params->get( 'text_before', '');
$currencies = @explode( ',', $params->get( 'product_currency', $vendor_accepted_currencies ) );
$vendor_currencies = @explode( ',', $vendor_accepted_currencies );
if( count( $currencies ) < count( $vendor_currencies )) {
   $currencies = $vendor_currencies;
}
$db = new ps_DB();
$db->query( 'SELECT currency_id, currency_code, currency_name FROM `#__{vm}_currency` WHERE FIND_IN_SET(`currency_code`, \''.implode(',',$currencies).'\') ORDER BY `currency_name`' );#

//$currencies = explode( ',', $currencies );
//$db->query( 'SELECT currency_id, currency_code, currency_name FROM `#__{vm}_currency` ORDER BY `currency_name`' );
unset( $currencies );

while( $db->next_record()) {
   $currencies[$db->f('currency_code')] = $db->f('currency_name');
}

$sess = new ps_session;
   
?>
<!-- Currency Selector Module -->
<?php echo $text_before ?>
<script type="text/javascript">
   function send_cur(kod){
      document.getElementById('cur').value=kod;
      document.getElementById('cur_mod').submit();
   }
   
</script>
<form id="cur_mod" action="<?php echo $_SERVER['SCRIPT_NAME'] ?>" method="post">
   <br />
   <?php
   if( !empty( $_POST )) {
     
      foreach( $_POST as $key => $val ) {
         if( $key == 'product_currency' ) continue;
         if( is_array($val) ) {
            if( $key == 'checkout_this_step' ) {
               foreach( $val as $value ) {
                  echo '<input type="hidden" name="'.$key.'[]" value="'.htmlspecialchars($value, ENT_QUOTES)."\" />\n";
               }
            }
            continue;

         }
         $key = htmlspecialchars($key, ENT_QUOTES);
         $val = htmlspecialchars($val, ENT_QUOTES);
         echo "<input type=\"hidden\" name=\"$key\" value=\"$val\" />\n";
      }
   }
   elseif( !empty( $_GET )) {
     
      foreach( $_GET as $key => $val ) {
         if( $key == 'product_currency' ) continue;
         if( is_array($val) ) {
            if( $key == 'checkout_this_step' ) {
               foreach( $val as $value ) {
                  echo '<input type="hidden" name="'.$key.'[]" value="'.htmlspecialchars($value, ENT_QUOTES)."\" />\n";
               }
            }
            continue;

         }
         
         $key = htmlspecialchars($key, ENT_QUOTES);
         echo "<input type=\"hidden\" name=\"$key\" value=\"".htmlspecialchars($val, ENT_QUOTES)."\" />\n";
      }
   }
   echo '<input id="cur" type="hidden" value="" name="product_currency" />';
   foreach($currencies as $key => $val){
      $x+=1;
      echo '<a href="#" onclick="send_cur(\''.$key.'\');" >'.$val.'</a> ';
      if ($x==2){
         echo '<br />';
      }else{
         echo ' / ';
      }
   }
//   echo $ps_html->selectList( 'product_currency', $GLOBALS['product_currency'], $currencies, 1, '', 'style="width:130px;"' );
   ?>
   
<!--    <input class="button" type="submit" name="submit" value="<?php echo 'Change Currency' ?>" />-->
</form>
*

Bowa

  • Захожу иногда
  • 363
  • 5 / 0
Re: mod_virtuemart_currencies внешний вид
« Ответ #1 : 24.10.2010, 19:48:54 »
Помогите хоть кто не будь....
Знаю что вроде как эта строчка выводит валюту в в виде ссылок
Код
echo '<a href="#" onclick="send_cur(\''.$key.'\');" >'.$val.'</a> ';
а вот как href поменять на button не представляю.
*

rxbt

  • Новичок
  • 6
  • 0 / 0
Re: mod_virtuemart_currencies внешний вид
« Ответ #2 : 05.12.2010, 16:19:29 »
Присоединяюсь к просьбе, как по мне было бы покрасивше сделать input type="radio"
Чтобы оставить сообщение,
Вам необходимо Войти или Зарегистрироваться
 

Каталог товара (внешний вид)

Автор prostoy

Ответов: 3
Просмотров: 1651
Последний ответ 16.11.2012, 08:25:46
от prostoy
Внешний вид VirtueMart

Автор andrey k

Ответов: 1
Просмотров: 1244
Последний ответ 25.10.2012, 21:45:58
от ELLE
как изменить внешний вид модуля меню категорий mod_product_categories

Автор serjik

Ответов: 3
Просмотров: 3115
Последний ответ 12.07.2012, 14:32:07
от dmcom
Как изменить внешний вид корзины в VirtueMart 1.1.2

Автор RUS125

Ответов: 32
Просмотров: 27581
Последний ответ 04.04.2012, 11:16:53
от bestvinyl
Внешний вид модуля latestprod

Автор Ser_g

Ответов: 3
Просмотров: 2885
Последний ответ 18.03.2012, 14:16:30
от Ser_g