当前位置: 首页>>代码示例>>PHP>>正文


PHP OPCLang::_方法代码示例

本文整理汇总了PHP中OPCLang::_方法的典型用法代码示例。如果您正苦于以下问题:PHP OPCLang::_方法的具体用法?PHP OPCLang::_怎么用?PHP OPCLang::_使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在OPCLang的用法示例。


在下文中一共展示了OPCLang::_方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: foreach

* THIS FILE RENDERS THE SELECT DROP DOWN FOR LOGGED IN USERS
*
* TO FORMAT INDIVIDUAL ADDRESS USE get_shipping_address_v2.tpl.php
* TO FORMAT EDITING OF THE ADDRESS USE list_user_fields_shipping.tpl.php WHICH IS USED FOR UNLOGGED AS WELL
*
* This file is loaded from \components\com_onepage\helpers\loader.php function getUserInfoST
*/
$html3 = '<div class="before_select"></div><div class="middle_select" style=""><div class="after_select" style="" >&nbsp;</div><select class="" name="ship_to_info_id" id="id' . $virtuemart_userinfo_id . '" onchange="return Onepage.changeST(this);" >';
$html3 .= '<option value="' . $virtuemart_userinfo_id . '">' . OPCLang::_('COM_VIRTUEMART_USER_FORM_ST_SAME_AS_BT') . '</option>';
foreach ($STaddressList as $stlist) {
    $html3 .= '<option value="' . $stlist->virtuemart_userinfo_id . '">';
    if (!empty($stlist->address_type_name)) {
        $html3 .= $stlist->address_type_name;
    }
    /*
    				     if (isset($stlist->first_name))
    				     $html3 .= $stlist->first_name.' ';
    if (isset($stlist->last_name))
    $html3 .= $stlist->last_name.' '; 
    */
    if (isset($stlist->address_1)) {
        $html3 .= ',' . $stlist->address_1;
    }
    if (isset($stlist->city)) {
        $html3 .= ',' . $stlist->city;
    }
    $html3 .= '</option>';
}
$html3 .= '<option value="new">' . OPCLang::_('COM_VIRTUEMART_USER_FORM_ADD_SHIPTO_LBL') . '</option>';
$html3 .= '</select></div>';
echo $html3;
开发者ID:aldegtyarev,项目名称:stelsvelo,代码行数:31,代码来源:list_select_address.tpl.php

示例2: getRegistrationHhtml

 public static function getRegistrationHhtml(&$obj, &$OPCloader)
 {
     // if (!empty($no_login_in_template)) return "";
     include JPATH_ROOT . DS . 'components' . DS . 'com_onepage' . DS . 'config' . DS . 'onepage.cfg.php';
     if (!class_exists('VirtueMartCart')) {
         require JPATH_VM_SITE . DS . 'helpers' . DS . 'cart.php';
     }
     if (!empty($obj->cart)) {
         $cart =& $obj->cart;
     } else {
         $cart = VirtueMartCart::getCart();
     }
     $type = 'BT';
     // for unlogged
     $virtuemart_userinfo_id = 0;
     $new = 1;
     $fieldtype = $type . 'address';
     /*
     if (method_exists($cart, 'prepareAddressDataInCart'))
     $cart->prepareAddressDataInCart($type, $new);
     */
     require_once JPATH_ROOT . DS . 'components' . DS . 'com_onepage' . DS . 'helpers' . DS . 'userfields.php';
     OPCUserFields::populateCart($cart, $type, true);
     /*
     if (method_exists($cart, 'prepareAddressFieldsInCart'))
     $cart->prepareAddressFieldsInCart();
     */
     OPCloader::setRegType();
     if (!class_exists('VirtuemartModelUserfields')) {
         require JPATH_VM_ADMINISTRATOR . DS . 'models' . DS . 'userfields.php';
     }
     $corefields = VirtueMartModelUserfields::getCoreFields();
     $userFields = $cart->{$fieldtype};
     require_once JPATH_ROOT . DS . 'components' . DS . 'com_onepage' . DS . 'helpers' . DS . 'mini.php';
     $layout = 'default';
     foreach ($userFields['fields'] as $key => $uf) {
         if (!in_array($key, $corefields) || $key == 'agreed') {
             unset($userFields['fields'][$key]);
             continue;
         }
         if (!empty($opc_email_in_bt) || $OPCloader->isNoLogin() || $OPCloader->isNoLogin()) {
             if ($userFields['fields'][$key]['name'] == 'email') {
                 unset($userFields['fields'][$key]);
                 continue;
             }
         }
         if ($key == 'email') {
             $user = JFactory::getUser();
             $uid = $user->get('id');
             // user is logged, but does not have a VM account
             if (!OPCloader::logged($cart) && !empty($uid)) {
                 // the user is logged in only in joomla, but does not have an account with virtuemart
                 $userFields['fields'][$key]['formcode'] = str_replace('/>', ' readonly="readonly" />', $userFields['fields'][$key]['formcode']);
             }
         }
     }
     require_once JPATH_ROOT . DS . 'components' . DS . 'com_onepage' . DS . 'helpers' . DS . 'userfields.php';
     OPCUserFields::getUserFields($userFields, $OPCloader, $cart);
     // lets move email to the top
     $copy = array();
     // we will reorder the fields, so the email is first when used as username
     $u = OPCLang::_('COM_VIRTUEMART_REGISTER_UNAME');
     //$e = OPCLang::_('COM_VIRTUEMART_USER_FORM_EMAIL');
     // disable when used for logged in
     if (!empty($userFields['fields'])) {
         /*
              if (empty($opc_email_in_bt) && (!empty($double_email)))
         {
           // email is in BT, let's check for double mail
         		
         		$email2 = $userFields['fields']['email'];
         		$email2['name'] = 'email2'; 
         		$title = OPCLang::_('COM_ONEPAGE_EMAIL2'); 
         		if ($title != 'COM_ONEPAGE_EMAIL2')
         		$email2['title'] = $title;
         		$email2['formcode'] = str_replace('"email', '"email2', $email2['formcode']); 
         		$email2['formcode'] = str_replace('id=', ' onblur="javascript: doublemail_checkMail();" id=', $email2['formcode']);
         		
         		$h = '<span style="display: none; position: relative; color: red; font-size: 10px; background: none; border: none; padding: 0; margin: 0;" id="email2_info" class="email2_class">';
         		$emailerr = OPCLang::_('COM_ONEPAGE_EMAIL_DONT_MATCH');
         		if ($emailerr != 'COM_ONEPAGE_EMAIL_DONT_MATCH')
         		$h .= $emailerr;
         		else $h .= "Emails don't match!";
         		$h .= '</span>';
         		$email2['formcode'] .= $h;
         }
         */
         /*
         	 if (!empty($opc_check_username))
         	 if ((!OPCloader::logged($cart)) && (empty($uid)))
         	 if (!empty($userFields['fields']['username']))
         {
          
            $un = $userFields['fields']['username']['formcode']; 
         		 $un = str_replace('id=', ' onblur="javascript: Onepage.username_check(this);" id=', $un);
         		 $un .=  '<span class="username_already_exist" style="display: none; position: relative; color: red; font-size: 10px; background: none; border: none; padding: 0; margin: 0;" id="username_already_exists">';
         		 $un .= OPCLang::sprintf('COM_VIRTUEMART_STRING_ERROR_NOT_UNIQUE_NAME', $u); 
         		 $un .= '</span>'; 
         		 $userFields['fields']['username']['formcode'] = $un; 
         }
//.........这里部分代码省略.........
开发者ID:aldegtyarev,项目名称:stelsvelo,代码行数:101,代码来源:unloggedshopper.php

示例3:



<?php 
}
?>
<!-- end show TOS and checkbox before button -->


 
 <div style="float: left;">
	
	<button type="submit" autocomplete="off" <?php 
echo $op_onclick;
?>
  id="confirmbtn_button" ><span class="op_round"><span id="confirmbtn" style="width: 250px;"><?php 
echo OPCLang::_('COM_VIRTUEMART_ORDER_CONFIRM_MNU');
?>
</span></span></button>	
 </div>
<br style="clear: both;"/>
</div>
<?php 
echo $captcha;
?>
<!-- end of submit button -->




                        	 </div>
                        	
开发者ID:aldegtyarev,项目名称:stelsvelo,代码行数:28,代码来源:onepage.logged.tpl.php

示例4: Array

        } else {
            echo '<div class="formLabel">
						<input type="checkbox" autocomplete="off" id="register_account" name="register_account" value="1" class="inputbox" onclick="return Onepage.showFields( this.checked, new Array(';
            if (empty($op_usernameisemail)) {
                echo '\'username\', \'password\', \'password2\'';
            } else {
                echo '\'password\', \'password2\'';
            }
            echo ') );" ';
            if (empty($op_create_account_unchecked)) {
                echo ' checked="checked" ';
            }
            echo '/>
					</div>
					<div class="formField">
						<label for="register_account">' . OPCLang::_('COM_VIRTUEMART_ORDER_REGISTER') . '</label>
					</div>
					';
        }
    } elseif ($field['name'] == 'username') {
        echo '<input type="hidden" id="register_account" name="register_account" value="1" />';
    }
    // a delimiter marks the beginning of a new fieldset and
    // the end of a previous fieldset
    /*
    	   		if( $field['type'] == 'delimiter') {
    	   			if( $delimiter > 0) {
    	   				echo "</fieldset>\n";
    	   			}
    	   			if( VM_REGISTRATION_TYPE == 'SILENT_REGISTRATION' && $field['title'] == OPCLang::_('COM_VIRTUEMART_ORDER_PRINT_CUST_INFO_LBL') && $page == 'checkout.index' ) {
    	   				continue;
开发者ID:aldegtyarev,项目名称:stelsvelo,代码行数:31,代码来源:list_user_fields.tpl.php

示例5:

        echo $item['title'];
        ?>
 </div>
           <div class="valueForm">
           <?php 
        //var_dump($item['value']);
        // prior 2.0.116: echo $this->escape($item['value'])
        echo $item['value'];
        ?>
           </div>
        </div>
	<?php 
    }
}
?>
       
       
        <div>
        <div style="clear:both; width:100%;text-align:center;"><a href="<?php 
echo $edit_link;
?>
">
            (<?php 
echo OPCLang::_('COM_VIRTUEMART_USER_FORM_EDIT_BILLTO_LBL');
?>
)</a>
            </div>
        </div>
    </div>
    <!-- customer information ends -->
开发者ID:aldegtyarev,项目名称:stelsvelo,代码行数:30,代码来源:customer_info.tpl.php

示例6: die

    die('Direct Access to ' . basename(__FILE__) . ' is not allowed.');
}
/*
*
* @copyright Copyright (C) 2007 - 2010 RuposTel - All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* One Page checkout is free software released under GNU/GPL and uses code from VirtueMart
* VirtueMart is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* 
*/
?>
<div class="cart-view">
	<div>
	<div class="width:50%; float:left;">
		<h1><?php 
echo OPCLang::_('COM_VIRTUEMART_CART_TITLE');
?>
</h1>
	</div>
<?php 
echo OPCLang::_('COM_VIRTUEMART_EMPTY_CART');
?>
</div>
<?php 
echo '<a class="continue_link" href="' . $continue_link . '" >' . OPCLang::_('COM_VIRTUEMART_CONTINUE_SHOPPING') . '</a>';
?>
</div>
开发者ID:aldegtyarev,项目名称:stelsvelo,代码行数:30,代码来源:empty_cart.tpl.php

示例7: str_replace

                    echo '<label for="' . $field['name'] . '_field">' . $field['title'] . '</label>';
                    $count = 0;
                    $field['formcode'] = str_replace('class="', 'class="checkbox inline ', $field['formcode'], $count);
                    if (empty($count)) {
                        $field['formcode'] = str_replace('type="', 'class="checkbox " type="', $field['formcode'], $count);
                    }
                }
            } else {
                echo '<label for="' . $field['name'] . '_field">' . $field['title'] . '</label>';
                $count = 0;
                $field['formcode'] = str_replace('class="', 'class="checkbox inline ', $field['formcode'], $count);
                if (empty($count)) {
                    $field['formcode'] = str_replace('type="', 'class="checkbox " type="', $field['formcode'], $count);
                }
            }
            if ($isPlaceholder) {
                $field['formcode'] = str_replace('type="', ' alt="' . $field['title'] . '" placeholder="' . $field['title'] . '" type="', $field['formcode']);
            } else {
                $field['formcode'] = str_replace('type="', ' alt="' . $field['title'] . '"  type="', $field['formcode']);
            }
            echo ' </div>';
        }
    }
}
if ($delimiter > 0) {
    if (!empty($required_fields)) {
        echo '<div style="padding:5px;text-align:center;"><strong>(* = ' . OPCLang::_('CMN_REQUIRED') . ')</strong></div>';
    }
    echo "</fieldset>\n";
}
echo '</div>';
开发者ID:aldegtyarev,项目名称:stelsvelo,代码行数:31,代码来源:list_user_fields.tpl.php

示例8:

" name="acylistsdisplayed_dispall" />
<input type="checkbox" id="acy_list_<?php 
echo $opc_acy_id;
?>
" class="acymailing_checkbox" name="acysub[]" value="<?php 
echo $opc_acy_id;
?>
"/>


<input type="hidden" name="allVisibleLists" value="<?php 
echo $opc_acy_id;
?>
" />



</div>
					<div style="width: 95%; float:left;"><label for="acy_list_<?php 
echo $opc_acy_id;
?>
" style="float: none; white-space: normal;"><span style="font-weight:bold;"><?php 
echo OPCLang::_('COM_VIRTUEMART_FIELDS_NEWSLETTER');
?>
</span><br />
					<?php 
echo OPCLang::_('COM_ONEPAGE_NEWSLETTER_SUBSCRIPTION_DESC');
?>
					</label></div>
</div>	
<!-- END italian privacy checkbox -->
开发者ID:aldegtyarev,项目名称:stelsvelo,代码行数:31,代码来源:acymailing_checkbox.php

示例9: showSA2

* One Page checkout is free software released under GNU/GPL and uses code from VirtueMart
* VirtueMart is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* 
* THIS FILE RENDERS THE SELECT THE CHECKBOX AND THE SINGLE SHIPPING ADDRESS
*
* TO FORMAT EDITING OF THE ADDRESS USE list_user_fields_shipping.tpl.php WHICH IS USED FOR UNLOGGED AS WELL
*
* This file is loaded from \components\com_onepage\helpers\loader.php function getUserInfoST
*
* This file is used by unlogged or by logged when single shipping address is enabled
*/
// MISSING LANGUAGE STRINGS
$CLICK_HERE_TO_ADD_SHIPPING_ADDRESS = OPCLang::_('COM_ONEPAGE_CLICK_HERE_TO_ADD_SHIPPING_ADDRESS');
//Verzendadres wijkt van contact adres af
?>
<div id="ship_to_wrapper">
<div class="arrowup"><div class="opc_arrow_up">&nbsp;</div></div>
<div class="opc_heading" ><button name="stbutton" onkeypress="return showSA2(this, 'idsa');" class="button_checkbox_uned" onclick="javascript: return showSA2(this, 'idsa');" autocomplete="off" >
<div class="chckbx" >&nbsp;</div>
<span class="opc_title"><?php 
echo $CLICK_HERE_TO_ADD_SHIPPING_ADDRESS;
?>
</span></button>
<?php 
// echo OPCLang::_('COM_VIRTUEMART_USER_FORM_SHIPTO_LBL');
// OR echo OPCLang::_('COM_VIRTUEMART_USER_FORM_ADD_SHIPTO_LBL');
?>
</div>
开发者ID:aldegtyarev,项目名称:stelsvelo,代码行数:31,代码来源:single_shipping_address.tpl.php

示例10: str_replace

    echo '<div class="field_wrapper ' . $field['type'] . '" ';
    // special case
    $fn = str_replace('shipto_', '', $field['name']);
    if (!empty($business_fields) || !empty($custom_rendering_fields)) {
        if (in_array($fn, $custom_rendering_fields) || in_array('virtuemart_country_id', $custom_rendering_fields) && $fn == 'virtuemart_state_id') {
            echo ' id="opc_business_' . $field['name'] . '" style="display: none;';
            echo '" ';
        }
    }
    echo '>';
    // a delimiter marks the beginning of a new fieldset and
    // the end of a previous fieldset
    $title = false;
    echo '<div id="' . $field['name'] . '_div" class="formLabel ';
    if (stristr($missing, $field['name'])) {
        echo OPCLang::_('COM_ONEPAGE_MISSING');
    }
    echo '">';
    // added as placeholder css3
    $arr = array('select', 'dropdown', 'multicheckbox', 'multiselect', 'radio', 'checkbox');
    if (in_array($field['type'], $arr)) {
        echo '<label class="label_selects" style="clear: both; " for="' . $field['name'] . '_field">';
        echo $field['title'];
        echo '</label>';
    }
    // input ...
    $field['formcode'] = str_replace('type="', ' title="' . $field['title'] . '" alt="' . $field['title'] . '" placeholder="' . $field['title'] . '" type="', $field['formcode']);
    if (!empty($field['required'])) {
    }
    echo ' </div>
	        <div class="formField ';
开发者ID:aldegtyarev,项目名称:stelsvelo,代码行数:31,代码来源:list_user_fields_shipping.tpl.php

示例11: saveData

 /**
  * Save the user info. The saveData function dont use the userModel store function for anonymous shoppers, because it would register them.
  * We make this function private, so we can do the tests in the tasks.
  *
  * @author Max Milbers
  * @author Valérie Isaksen
  *
  * @param boolean Defaults to false, the param is for the userModel->store function, which needs it to determin how to handle the data.
  * @return String it gives back the messages.
  */
 private function saveData(&$cart = false, $register = false, $disable_duplicit = false, &$data)
 {
     include JPATH_ROOT . DS . 'components' . DS . 'com_onepage' . DS . 'config' . DS . 'onepage.cfg.php';
     $mainframe = JFactory::getApplication();
     $currentUser = JFactory::getUser();
     $msg = '';
     //store email:
     $data['email'] = str_replace(array('\'', '"', ',', '%', '*', '/', '\\', '?', '^', '`', '{', '}', '|', '~'), array(''), $data['email']);
     $user_id = JFactory::getUser()->get('id');
     if (empty($user_id)) {
         JFactory::getUser()->set('email', $data['email']);
     }
     if (empty($data['shipto_address_type_name'])) {
         $data['shipto_address_type_name'] = OPCLang::_('COM_VIRTUEMART_ORDER_PRINT_SHIPPING_LBL');
     }
     if (empty($data['address_type'])) {
         $data['address_type'] = 'BT';
     }
     $at = JRequest::getWord('addrtype');
     if (!empty($at)) {
         $data['address_type'] = $at;
     }
     $r = JRequest::getVar('register_account', '');
     if (!empty($r) || VmConfig::get('oncheckout_only_registered', 0)) {
         $register = true;
     }
     //if ($data['address_type'] == 'ST') $register = false;
     $this->addModelPath(JPATH_VM_ADMINISTRATOR . DS . 'models');
     require_once JPATH_ROOT . DS . 'components' . DS . 'com_onepage' . DS . 'helpers' . DS . 'mini.php';
     $userModel = OPCmini::getModel('user');
     if ($currentUser->id != 0 || $register) {
         $data['user_is_vendor'] = 0;
         //It should always be stored, stAn: it will, but not here
         if ($currentUser->id == 0 || empty($data['ship_to_info_id'])) {
             if (!empty($data['email'])) {
                 if (empty($data['shipto_email'])) {
                     $data['shipto_email'] = $data['email'];
                 }
             }
             // check for duplicit registration feature
             if ($allow_duplicit && empty($disable_duplicit)) {
                 // set the username if appropriate
                 if (empty($data['username'])) {
                     if (!empty($currentUser->id)) {
                         $data['username'] = $username = $currentUser->username;
                         JRequest::setVar('username', $username);
                         $data['email'] = $email = $this->getEmail();
                         JRequest::setVar('email', $email);
                     } else {
                         $username = $data['email'];
                         $email = $data['email'];
                     }
                 } else {
                     $username = $data['username'];
                     if (!empty($data['email'])) {
                         $email = $data['email'];
                     } else {
                         // support for 3rd party exts
                         if (strpos($username, '@') !== false) {
                             $email = $username;
                         }
                     }
                 }
                 $db = JFactory::getDBO();
                 $q = "select * from #__users where email LIKE '" . $this->getEscaped($db, $email) . "' limit 0,1";
                 //or username = '".$db->escape($username)."' ";
                 $db->setQuery($q);
                 $res = $db->loadAssoc();
                 $is_dup = false;
                 if (!empty($res)) {
                     //ok, the customer already used the same email address
                     $is_dup = true;
                     $duid = $res['id'];
                     $GLOBALS['is_dup'] = $duid;
                     $GLOBALS['opc_new_user'] = $duid;
                     $data['address_type'] = 'BT';
                     $data['virtuemart_user_id'] = $duid;
                     $data['shipto_virtuemart_user_id'] = $duid;
                     $this->saveToCart($data, $cart);
                     // we will not save the user into the jos_virtuermart_userinfos
                     if ($currentUser->id != 0) {
                         // ok, we have a joomla registration + logged in users
                         // but the user might not be registered with virtuemart
                         if ($currentUser->id == $duid) {
                             // yes we are talking about the same user
                             // let's associate his data in the cart with his data in VM tables
                             $q = "select * from #__virtuemart_userinfos where virtuemart_user_id = " . $duid . " ";
                             $db->setQuery($q);
                             $res = $db->loadAssocList();
                             if (empty($res)) {
//.........这里部分代码省略.........
开发者ID:aldegtyarev,项目名称:stelsvelo,代码行数:101,代码来源:opc.php

示例12:

<script src="<?php 
echo JHTMLOPC::getFullUrl('onepage.js', 'components/com_onepage/assets/js/');
?>
" type="text/javascript"></script>
<script src="<?php 
echo JHTMLOPC::getFullUrl('tabcontent.js', $path, false);
?>
" type="text/javascript"></script>
<script src="<?php 
echo JHTMLOPC::getFullUrl('jquery.mobile.stepper.js', 'components/com_onepage/themes/extra/jQuery-Mobile-Stepper-Widget-master/', false);
?>
" type="text/javascript"></script>


<title><?php 
echo OPCLang::_('COM_VIRTUEMART_CART_TITLE');
?>
</title>
  
<script src="/components/com_virtuemart/assets/js/jquery.ui.datepicker.min.js" type="text/javascript"></script>
<script src="/components/com_virtuemart/assets/js/i18n/jquery.ui.datepicker-en-GB.js" type="text/javascript"></script>

 
  <script src="/components/com_virtuemart/assets/js/vmcreditcard.js" type="text/javascript"></script>
  <script src="/components/com_onepage/ext/doublemail/js/doublemail.js?opcversion=2_0_257_268_140914" type="text/javascript"></script>
  <script src="/cache/com_onepage/opc_dynamic_en-GB_2ff4261d13f52233a0d498969562a168.js?opcversion=2_0_257_268_140914" type="text/javascript"></script>

</head>
<body>
<div data-role="page" data-quicklinks="false" data-add-back-btn="true" data-back-btn-text="Back" data-theme="d" class="page-0">
开发者ID:aldegtyarev,项目名称:stelsvelo,代码行数:30,代码来源:index.php

示例13: getProductCustomsFieldCart

    /**
     * Original function from customFields.php 
     * We need to update custom attributes when using add to cart as link
     *
     * @author Patrick Kohl
     * @param obj $product product object
     * @return html code
     */
    public static function getProductCustomsFieldCart($product)
    {
        if (OPCJ3) {
            return array();
        }
        $db = JFactory::getDBO();
        // group by virtuemart_custom_id
        $query = 'SELECT C.`virtuemart_custom_id`, `custom_title`, C.`custom_value`,`custom_field_desc` ,`custom_tip`,`field_type`,field.`virtuemart_customfield_id`,`is_hidden`
				FROM `#__virtuemart_customs` AS C
				LEFT JOIN `#__virtuemart_product_customfields` AS field ON C.`virtuemart_custom_id` = field.`virtuemart_custom_id`
				Where `virtuemart_product_id` =' . (int) $product->virtuemart_product_id . ' and `field_type` != "G" and `field_type` != "R" and `field_type` != "Z"';
        $query .= ' and is_cart_attribute = 1 group by virtuemart_custom_id';
        $db->setQuery($query);
        $groups = $db->loadObjectList();
        if (!class_exists('VmHTML')) {
            require JPATH_VM_ADMINISTRATOR . DS . 'helpers' . DS . 'html.php';
        }
        $row = 0;
        if (!class_exists('CurrencyDisplay')) {
            require JPATH_VM_ADMINISTRATOR . DS . 'helpers' . DS . 'currencydisplay.php';
        }
        $currency = CurrencyDisplay::getInstance();
        if (!class_exists('calculationHelper')) {
            require JPATH_VM_ADMINISTRATOR . DS . 'helpers' . DS . 'calculationh.php';
        }
        $calculator = calculationHelper::getInstance();
        if (!class_exists('vmCustomPlugin')) {
            require JPATH_VM_PLUGINS . DS . 'vmcustomplugin.php';
        }
        $reta = array();
        $free = OPCLang::_('COM_VIRTUEMART_CART_PRICE_FREE');
        // render select list
        if (!empty($groups)) {
            foreach ($groups as $group) {
                //				$query='SELECT  field.`virtuemart_customfield_id` as value ,concat(field.`custom_value`," :bu ", field.`custom_price`) AS text
                $query = 'SELECT field.`virtuemart_product_id`, `custom_params`,`custom_element`, field.`virtuemart_custom_id`,
							field.`virtuemart_customfield_id`,field.`custom_value`, field.`custom_price`, field.`custom_param`
					FROM `#__virtuemart_customs` AS C
					LEFT JOIN `#__virtuemart_product_customfields` AS field ON C.`virtuemart_custom_id` = field.`virtuemart_custom_id`
					Where `virtuemart_product_id` =' . (int) $product->virtuemart_product_id;
                $query .= ' and is_cart_attribute = 1 and C.`virtuemart_custom_id`=' . (int) $group->virtuemart_custom_id;
                // We want the field to be ordered as the user defined
                $query .= ' ORDER BY field.`ordering`';
                $db->setQuery($query);
                $options = $db->loadObjectList();
                //vmdebug('getProductCustomsFieldCart options',$options);
                $group->options = array();
                foreach ($options as $option) {
                    $group->options[$option->virtuemart_customfield_id] = $option;
                }
                if ($group->field_type == 'V') {
                    $default = current($group->options);
                    foreach ($group->options as $productCustom) {
                        if ((double) $productCustom->custom_price) {
                            $price = strip_tags($currency->priceDisplay($calculator->calculateCustomPriceWithTax($productCustom->custom_price)));
                        } else {
                            $price = $productCustom->custom_price === '' ? '' : $free;
                        }
                        $productCustom->text = $productCustom->custom_value . ' ' . $price;
                    }
                    $r = array();
                    $r['name'] = 'customPrice[' . $row . '][' . $group->virtuemart_custom_id . ']';
                    $r['value'] = $default->custom_value;
                    $reta[] = $r;
                    //$group->display = VmHTML::select ('customPrice[' . $row . '][' . $group->virtuemart_custom_id . ']', $group->options, $default->custom_value, '', 'virtuemart_customfield_id', 'text', FALSE);
                } else {
                    if ($group->field_type == 'G') {
                        $group->display .= '';
                        // no direct display done by plugin;
                    } else {
                        if ($group->field_type == 'E') {
                            $group->display = '';
                            foreach ($group->options as $k => $productCustom) {
                                if ((double) $productCustom->custom_price) {
                                    $price = $currency->priceDisplay($calculator->calculateCustomPriceWithTax($productCustom->custom_price));
                                } else {
                                    $price = $productCustom->custom_price === '' ? '' : $free;
                                }
                                $productCustom->text = $productCustom->custom_value . ' ' . $price;
                                $productCustom->virtuemart_customfield_id = $k;
                                if (!class_exists('vmCustomPlugin')) {
                                    require JPATH_VM_PLUGINS . DS . 'vmcustomplugin.php';
                                }
                                //legacy, it will be removed 2.2
                                $productCustom->value = $productCustom->virtuemart_customfield_id;
                                JPluginHelper::importPlugin('vmcustom');
                                $dispatcher = JDispatcher::getInstance();
                                $fieldsToShow = $dispatcher->trigger('plgVmOnDisplayProductVariantFE', array($productCustom, &$row, &$group));
                                $group->display .= '<input type="hidden" value="' . $productCustom->virtuemart_customfield_id . '" name="customPrice[' . $row . '][' . $productCustom->virtuemart_custom_id . ']" /> ';
                                $r = array();
                                $r['name'] = 'customPrice[' . $row . '][' . $productCustom->virtuemart_custom_id . ']';
                                $r['value'] = $productCustom->virtuemart_customfield_id;
//.........这里部分代码省略.........
开发者ID:aldegtyarev,项目名称:stelsvelo,代码行数:101,代码来源:addtocartaslink.php

示例14: getUserFields

 public static function getUserFields(&$userFields, &$OPCloader, &$cart, $remove = array(), $only = array(), $skipreorder = array())
 {
     include JPATH_ROOT . DS . 'components' . DS . 'com_onepage' . DS . 'config' . DS . 'onepage.cfg.php';
     $user = JFactory::getUser();
     $uid = $user->get('id');
     //$userFields = $userFieldsOrig;
     if (!empty($userFields)) {
         foreach ($userFields['fields'] as $key => $uf) {
             $userFields['fields'][$key]['formcode'] = str_replace('vm-chzn-select', '', $userFields['fields'][$key]['formcode']);
             $userFields['fields'][$key]['formcode'] = str_replace('maxlength', 'disabledmaxlength', $userFields['fields'][$key]['formcode']);
             if ($key == 'password') {
                 $userFields['fields'][$key]['required'] = true;
             }
             if ($key == 'password2') {
                 $userFields['fields'][$key]['required'] = true;
             }
             $arr = array('name', 'username');
             if (in_array($key, $arr)) {
                 $userFields['fields'][$key]['required'] = 1;
             }
             if (!empty($custom_rendering_fields)) {
                 if (in_array($userFields['fields'][$key]['name'], $custom_rendering_fields)) {
                     unset($userFields['fields'][$key]);
                     continue;
                 }
             }
             if ($key != 'email') {
                 $userFields['fields'][$key]['formcode'] = str_replace('/>', ' autocomplete="off" />', $userFields['fields'][$key]['formcode']);
             }
             if ($key == 'email') {
                 if (!empty($cart->BT['email'])) {
                     $userFields['fields'][$key]['formcode'] = str_replace('value=""', ' value="' . $cart->BT['email'] . '"', $userFields['fields'][$key]['formcode']);
                     $userFields['fields'][$key]['formcode'] = str_replace('type="text"', 'type="email"', $userFields['fields'][$key]['formcode']);
                 }
             }
             $userFields['fields'][$key]['formcode'] = str_replace('size="0"', '', $userFields['fields'][$key]['formcode']);
             // get proper state listing:
             if ($key == 'virtuemart_state_id') {
                 if (!empty($cart->BT['virtuemart_country_id'])) {
                     $c = $cart->BT['virtuemart_country_id'];
                 } else {
                     $c = $default_shipping_country;
                 }
                 if (empty($c)) {
                     $vendor = $OPCloader->getVendorInfo($cart);
                     $c = $vendor['virtuemart_country_id'];
                 }
                 require_once JPATH_ROOT . DS . 'components' . DS . 'com_onepage' . DS . 'helpers' . DS . 'commonhtml.php';
                 $html = OPCCommonHtml::getStateHtmlOptions($cart, $c, 'BT');
                 if (!empty($cart->BT['virtuemart_state_id'])) {
                     $html = str_replace('value="' . $cart->BT['virtuemart_state_id'] . '"', 'value="' . $cart->BT['virtuemart_state_id'] . '" selected="selected"', $html);
                 }
                 //
                 if (!empty($userFields['fields']['virtuemart_state_id']['required'])) {
                     $userFields['fields']['virtuemart_state_id']['formcode'] = '<select class="inputbox multiple opcrequired" id="virtuemart_state_id" opcrequired="opcrequired" size="1"  name="virtuemart_state_id" >' . $html . '</select>';
                 } else {
                     $userFields['fields']['virtuemart_state_id']['formcode'] = '<select class="inputbox multiple" id="virtuemart_state_id"  size="1"  name="virtuemart_state_id" >' . $html . '</select>';
                 }
                 //$userFields['fields'][$key]['formcode'] = '<select class="inputbox multiple" id="virtuemart_state_id"  size="1"  name="virtuemart_state_id" >'.$html.'</select>';
             }
             // add klarna button:
             if (!empty($klarna_se_get_address)) {
                 if ($key == 'socialNumber') {
                     $newhtml = '<input type="button" id="klarna_get_address_button" onclick="return Onepage.send_special_cmd(this, \'get_klarna_address\' );" value="' . OPCLang::_('COM_ONEPAGE_KLARNA_GET_ADDRESS') . '" />';
                     //$userFields['fields'][$key]['formcode'] = str_replace('name="socialNumber"', ' style="width: 70%;" name="socialNumber"', $userFields['fields'][$key]['formcode']).$newhtml;
                     $userFields['fields'][$key]['formcode'] .= $newhtml;
                 }
             }
             // mark email read only when logged in
             if ($key == 'email') {
                 // user is logged, but does not have a VM account
                 if (!OPCloader::logged($cart) && !empty($uid)) {
                     // the user is logged in only in joomla, but does not have an account with virtuemart
                     $userFields['fields'][$key]['formcode'] = str_replace('/>', ' readonly="readonly" />', $userFields['fields'][$key]['formcode']);
                 } else {
                     $userFields['fields'][$key]['formcode'] = str_replace('type="text"', 'type="email"', $userFields['fields'][$key]['formcode']);
                 }
             }
             // remove autocomplete for multi dependant fields
             if ($key == 'virtuemart_country_id') {
                 $userFields['fields'][$key]['formcode'] = str_replace('name=', ' autocomplete="off" name=', $userFields['fields'][$key]['formcode']);
             }
             // set required properly:
             if (isset($userFields['fields'][$key]['name'])) {
                 if (!empty($uf['required']) && strpos($uf['formcode'], 'required') === false) {
                     if ($userFields['fields'][$key]['name'] != 'virtuemart_state_id') {
                         $x1 = strpos($uf['formcode'], 'class="');
                         if ($x1 !== false) {
                             $userFields['fields'][$key]['formcode'] = str_replace('class="', 'class="required ', $uf['formcode']);
                         } else {
                             $userFields['fields'][$key]['formcode'] = str_replace('name="', 'class="required" name="', $uf['formcode']);
                         }
                     }
                 }
             }
             if ($uf['type'] == 'date') {
                 $userFields['fields'][$key]['formcode'] = str_replace(OPCLang::_('COM_VIRTUEMART_NEVER'), $userFields['fields'][$key]['title'], $userFields['fields'][$key]['formcode']);
             }
             if (!empty($op_no_display_name)) {
                 if ($userFields['fields'][$key]['name'] == 'name') {
//.........这里部分代码省略.........
开发者ID:aldegtyarev,项目名称:stelsvelo,代码行数:101,代码来源:userfields.php

示例15: op_openlink

 <a target="_blank" href="<?php 
    echo $tos_link;
    ?>
" onclick="javascript: return op_openlink(this); " >(<?php 
    echo JText::_('COM_VIRTUEMART_CART_TOS');
    ?>
) *</a><?php 
}
?>
</label>
			

</div>
<div id="onepage_submit_section" class="newclass">
<input type="submit" value="<?php 
echo OPCLang::_('PHPSHOP_ORDER_CONFIRM_MNU');
?>
" id="confirmbtn" class="buttonopc" <?php 
echo $op_onclick;
?>
 />
</div>	
</div>
<br style="clear: both;"/>
</form>

<!-- end of submit button -->
<!-- end of checkout form -->
<!-- end of main onepage div, if javascript fails it will remain hidden -->

开发者ID:aldegtyarev,项目名称:stelsvelo,代码行数:29,代码来源:onepage.logged.tpl.php


注:本文中的OPCLang::_方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。