我正在尝试使用Materialize主题在JSF中创建一个侧边栏Spring.我进口Materialise公司的js和css,但它出来一个错误TypeError: $(...).sideNav is not a function.我不知道为什么,我尝试了一个普通的HTML文件,它的工作原理.
我得到此错误以及如何解决此问题的原因是什么?
页面结构:
<h:head>
<title><h:outputText value="#{msg.title}" /></title>
<!-- Import Materialize css -->
<link rel="stylesheet" href="./themes/materialize/css/materialize.min.css"/>
<!-- Compiled and minified JavaScript -->
<script src="./themes/materialize/js/materialize.min.js"></script>
<script src="./themes/materialize/js/materialize.js"></script>
<!--Import jQuery before materialize.js-->
<script type="text/javascript" src="./js/jquery-3.2.1.min.js"></script>
<script>
(function($){
$(function(){
$('.button-collapse').sideNav('show');
}); // end of document ready
})(jQuery); // end of jQuery name space
</script>
</h:head>
<h:body onload="init();">
<!--<table id="Table_01" class="Table_01">-->
<table id="WholeFunctionPageLayoutTable" cellspacing="0px" cellpadding="0px" width="100%"
border="0px">
<tr id="WholeFunctionPageWidthSpacer" >
<td>
<!--<table …Run Code Online (Sandbox Code Playgroud) 我正在使用WooCommerce创建一个在线商店,我正在添加一个功能,它将更新我的数据库的奖励点absract-wc-payment-gateway.php.
这是我在做的事情:
place order按钮,然后该方法将获得用户奖励积分并减去奖励积分get-total(),然后更新到数据库并转到感谢页面.这是我的代码.它将在用户单击下订单按钮时运行:
global $woocommerce;
$order = new WC_Order($order_id);
$total = $order->get_total();
$bonusPoint -= (int)$total; //minus total price and calculate the latest bonus point
$updateSql = "UPDATE userdata02 SET bonusPoint ='" .$bonusPoint. "' WHERE userID = 2147483647";
mysqli_query($link, $updateSql);// update to an int column
if(mysqli_query($link, $updateSql)) {
echo "Record updated successfully";
} else {
echo "Error update record: <>" . mysqli_error($link);
}
Run Code Online (Sandbox Code Playgroud)
用户单击"放置"按钮时调用该方法:
public function get_return_url( $order = null ) …Run Code Online (Sandbox Code Playgroud) 我得到了facebook用户的朋友数量.我不知道如何获得total_count.
这是我的代码:
$helper = $fb->getRedirectLoginHelper();
try
if (isset($_SESSION['facebook_access_token'])) {
$accessToken = $_SESSION['facebook_access_token'];
} else {
$accessToken = $helper->getAccessToken();
}
// Returns a `Facebook\FacebookResponse` object
$response = $fb->get('/me?fields=id,name,email,friends', $accessToken);
} catch(Facebook\Exceptions\FacebookResponseException $e) {
echo 'Graph returned an error: ' . $e->getMessage();
exit;
} catch(Facebook\Exceptions\FacebookSDKException $e) {
echo 'Facebook SDK returned an error: ' . $e->getMessage();
exit;
}
echo $accessToken;
$user = $response->getGraphUser();
$userInfo = $user->asArray();
print_r($userInfo);
Run Code Online (Sandbox Code Playgroud)
但是,打印返回这些:
( [id] => 1234567890
[name] => lmc_john
[email] => xxxxxxxx@hotmail.com
[friends] => Array ( …Run Code Online (Sandbox Code Playgroud) 我有新订单时尝试设置电子邮件地址。然后将储存在new email中wp_postmeta。
$order_id使用时如何获得woocommerce_email_headers?
我需要order_id使用它与get_post_meta()功能。
这是我的代码:
function techie_custom_wooemail_headers( $headers, $object) {
$email = get_post_meta( $order_id, '_approver_email', true );
// Replace the emails below to your desire email
$emails = array('eee@hotmail.com', $email);
switch($object) {
case 'new_order':
$headers .= 'Bcc: ' . implode(',', $emails) . "\r\n";
break;
case 'customer_processing_order':
$headers .= 'Bcc: ' . implode(',', $emails) . "\r\n";
break;
case 'customer_completed_order':
case 'customer_invoice':
$headers .= 'Bcc: ' . implode(',', $emails) . "\r\n"; …Run Code Online (Sandbox Code Playgroud) 我正在制作一个可以将excel文件转换为CSV文件的应用程序.
但是,某些字符串包含引号,因此当CSV导出时,某些字符串会拆分为两个单元格,这两个单元格应位于一个单元格中.
例如:
"39.6cm (15.6") HD (1366x768),97cm", "Core2 M3321" //15.6"<===have a quotation mark
Run Code Online (Sandbox Code Playgroud)
我试图使用"trim(),replace(),Insert()"来删除引号,但它不起作用.我不知道.
if (HTMLTable.Contains("\""))
{
HTMLTable.Trim(new Char[] {'"'}); //Try to remove quotation
HTMLTable.Replace("\"", "");
HTMLTable.Insert(HTMLTable.IndexOf('"') - 1, "\\");
}
csvRecord += "\",\"" + HTMLTable + "\",0"; //Append the String into the CSV builder
Run Code Online (Sandbox Code Playgroud)
我尝试了很多解决方案,但它不起作用.问题是什么?
谢谢.
php ×3
orders ×2
woocommerce ×2
wordpress ×2
c# ×1
facebook ×1
javascript ×1
materialize ×1
price ×1