我使用Woothemes预订我的woocommerce网站
当我构建自定义搜索产品时,我也必须搜索可用性,这里是我应该如何管理BO的可用性
以及插件如何存储到数据库
a:8:{i:0;a:4:{s:4:"type";s:4:"days";s:8:"bookable";s:3:"yes";s:4:"from";s:1:"3";s:2:"to";s:1:"3";}i:1;a:4:{s:4:"type";s:6:"custom";s:8:"bookable";s:3:"yes";s:4:"from";s:10:"2015-07-09";s:2:"to";s:10:"2015-07-09";}i:2;a:4:{s:4:"type";s:6:"custom";s:8:"bookable";s:3:"yes";s:4:"from";s:10:"2015-07-08";s:2:"to";s:10:"2015-07-08";}i:3;a:4:{s:4:"type";s:6:"custom";s:8:"bookable";s:3:"yes";s:4:"from";s:10:"2015-07-10";s:2:"to";s:10:"2015-07-10";}i:4;a:4:{s:4:"type";s:6:"custom";s:8:"bookable";s:3:"yes";s:4:"from";s:10:"2015-07-15";s:2:"to";s:10:"2015-07-15";}i:5;a:4:{s:4:"type";s:6:"custom";s:8:"bookable";s:3:"yes";s:4:"from";s:10:"2015-07-16";s:2:"to";s:10:"2015-07-16";}i:6;a:4:{s:4:"type";s:6:"custom";s:8:"bookable";s:3:"yes";s:4:"from";s:10:"2015-07-17";s:2:"to";s:10:"2015-07-17";}i:7;a:4:{s:4:"type";s:6:"months";s:8:"bookable";s:2:"no";s:4:"from";s:1:"8";s:2:"to";s:1:"8";}}
Run Code Online (Sandbox Code Playgroud)
我可以从wordpress内置函数get_post_meta中检索这些值,
$avail = get_post_meta($product->id, '_wc_booking_availability');
Run Code Online (Sandbox Code Playgroud)
结果是:
Array
(
[0] => Array
(
[type] => days
[bookable] => yes
[from] => 3
[to] => 3
)
[1] => Array
(
[type] => custom
[bookable] => yes
[from] => 2015-07-09
[to] => 2015-07-09
)
[2] => Array
(
[type] => custom
[bookable] => yes
[from] => 2015-07-08
[to] => 2015-07-08
)
[3] => Array
(
[type] => custom
[bookable] => yes
[from] => 2015-07-10
[to] => …Run Code Online (Sandbox Code Playgroud) 我在运行react-native run-ios时遇到一个问题,以下消息显示,并且我认为它与babel有关:
有人已经有这个问题了吗?
"GET /index.bundle?platform=ios&dev=true&minify=false HTTP/1.error: bundling failed: Error: Unable to resolve module `@babel/runtime/helpers/interopRequireDefault` from `/Volumes/SD/react/PropertyFinder/index.js`: Module `@babel/runtime/helpers/interopRequireDefault` does not exist in the Haste module map
Run Code Online (Sandbox Code Playgroud)
谢谢
我有一个奇怪和令人沮丧的wordpress admin-ajax.php文件的行为,当我发出ajax请求它返回404错误错误请求.
(function( $ ) {
var ajaxscript = { ajax_url : 'mydomain.com/wp-admin/admin-ajax.php' }
$.ajax({
url : ajaxscript.ajax_url,
data : {
action : 'cart_clb',
id : 1
},
method : 'POST',
success : function( response ){ console.log(response) },
error : function(error){ console.log(error) }
})
})(jQuery)
Run Code Online (Sandbox Code Playgroud)
在我的functions.php里面
add_action( 'wp_ajax_post_cart_clb', 'cart_clb' );
add_action( 'wp_ajax_nopriv_post_cart_clb', 'cart_clb' );
function cart_clb(){
echo json_encode($_POST);
die();
}
Run Code Online (Sandbox Code Playgroud)
如上所述,当我执行请求时:
mydomain.com/wp-admin/admin-ajax.php 400 (Bad Request)
{readyState: 4, getResponseHeader: ƒ, getAllResponseHeaders: ƒ, setRequestHeader: ƒ, overrideMimeType: ƒ, …}
Run Code Online (Sandbox Code Playgroud)
有人可以帮我取悦吗?谢谢.
我有一个问题关于scrollview为Appcelerator的钛,我想里面滚动标签scrollview:
scrollpage.xml
<View id="content" layout="vertical" top="100dp" width="100%">
<ScrollView contentWidth="Ti.UI.SIZE" contentHeight="Ti.UI.SIZE" top="10dp" id="svc" height="48dp" backgroundColor="#ff0000" >
</ScrollView>
</View>
</Window>
Run Code Online (Sandbox Code Playgroud)
scrollpage.js
for ( i = 0; i < 19; i++) {
var scrollLabel = Ti.UI.createLabel({
width : Ti.UI.SIZE,
height : '40dp',
font : { fontSize : 14 },
color:'#000',
text : 'Portfolio'+i,
id:'label_'+i,
});
$.svc.add(scrollLabel);
}
Run Code Online (Sandbox Code Playgroud)
我试过,ScrollableView但我想要很多项目直接在屏幕上显示.
我的目标是实现这个目标:
请解释我做错了什么!谢谢!
我即将使用appcelerator钛框架测试应用程序,我必须在屏幕上居中显示:
我的index.xml:
<Alloy>
<!-- Anddroid Window -->
<Window id="index" platform="android">
<Require type="view" id="firstscreen" src="firstscreen"/>
</Window>
<!-- iOS Window -->
<NavigationWindow id="nav" platform="ios">
<Window id="win1" backgroundColor="white">
<Require type="view" id="firstscreen" src="firstscreen"/>
</Window>
</NavigationWindow>
Run Code Online (Sandbox Code Playgroud)
第一个屏幕xml:
<Alloy>
<ScrollView scrollingEnabled="false" contentWidth="Ti.UI.FILL">
<ImageView class="fullBgImage" image="/images/login/bg2.png" />
<View layout="vertical">
<View id="loginView" class="heightAuto" layout="vertical">
<ImageView id="localImage" image="/images/logo.png" />
<Label class="logoLabel" text="Karma" />
<Label class="logoSlogan" text="Faits confiance à votre Karma pour booster votre carrière" />
<View class="btn btnVert" onClick="openCandidat"><Label class="btnLabel" text="Je recherche un job" /></View>
<View class="btn btnBlanc" ><Label …Run Code Online (Sandbox Code Playgroud)appcelerator appcelerator-mobile appcelerator-titanium appcelerator-alloy
在我的钛金应用程序上,我有一个包含许多字段的表单(文本字段等),当我专注于文本字段时,它会显示ios键盘,当我在窗口上的某个位置单击时,我想隐藏它:
<Alloy>
<Window id="home" >
<View id="form">
<Require type="view" id="myViewForm" src="form/etape_1" />
</View>
</Window>
</Alloy>
Run Code Online (Sandbox Code Playgroud)
在myViewForm内部:
<Alloy>
<View>
<TextField id="name" hintText="name"/>
<TextField id="telephone" hintText="Téléphone"/>
</View>
</Alloy>
Run Code Online (Sandbox Code Playgroud)
注意:如您所见,我有一个ID为“ telephone”的文本字段,将仅显示数字。
在我的控制器主文件上:
/*-----------------------------------------
| | EVENT LISTENER CLICK ON WINDOW
-------------------------------------------*/
$.home.addEventListener("click", hideSoftKeyboard);
/*-----------------------------------------
| | HIDE KEYBOARD
-------------------------------------------*/
function hideSoftKeyboard(e){
if(Ti.Platform.osname === 'android'){
Ti.UI.Android.hideSoftKeyboard();
} else {
$.home.textField.blur();
}
}
Run Code Online (Sandbox Code Playgroud)
在android上运行良好,但是在ios上我遇到以下错误:
[ERROR] : Script Error {
[ERROR] : column = 103;
[ERROR] : line = 12;
[ERROR] : message = "undefined is …Run Code Online (Sandbox Code Playgroud) titanium appcelerator appcelerator-mobile titanium-mobile appcelerator-titanium
您好,钛金属手机开发人员,
我对navigationWindow有一些疑问,因为图片胜过数千个单词:
正如您所看到的,我有一个navigationWindow的蓝色后退按钮,以及带有图像的ScrollableView内容:
<Alloy>
<Window>
<ScrollableView id="scrollableView" showPagingControl="true" overlayEnabled="true" pagingControlColor="transparent" backgroundColor="black">
<View id="view1">
<ImageView class="fullBgImage"image="images/pubs/v2.png" />
</View>
<View id="view2">
<ImageView id="imageview_1" image="images/pubs/pub_un.jpg" />
</View>
<View id="view3">
<ImageView id="imageview_2" image="images/pubs/pub_deux.jpg" />
</View>
<View id="view4">
<ImageView image="images/pubs/guide.png" />
</View>
<View id="view5" >
<ImageView touchEnabled="false" image="images/pubs/start.png" />
</View>
</ScrollableView>
</Window>
Run Code Online (Sandbox Code Playgroud)
我的问题是我无法将后退按钮文本和箭头变为白色,并且我在ScrollableView的两侧都有填充.
我该怎样摆脱那些填充物?和颜色后退按钮?
以上解决了上述问题
我只是有另一个问题,是否可以全屏显示图像视图,我的意思是将后退按钮放在视图下方,请看下面的截图:
谢谢你的帮助.
appcelerator ×4
titanium ×2
wordpress ×2
admin-ajax ×1
ajax ×1
mysql ×1
php ×1
react-native ×1
reactjs ×1
scrollview ×1
woothemes ×1