试图加载畅销书,但这个脚本只加载我3个产品,无论我做什么,任何人都可以给我一个提示,所以我可以显示至少16个产品?
这里的问题是$_productCollection = $this->getProductCollection();功能,当我数它,它只接收3个产品,我怎么能改变它所以我可以通过这个功能接收更多的产品?
<?php
// You can pass a $totalToFetch parametar to the fetchBestsellers()
// $_productCollection = $this->fetchBestsellers(5);
$_productCollection = $this->getProductCollection();
?>
<?php if(!$_productCollection->count()): ?>
<p class="note-msg"><?php echo $this->__('There are no products matching the selection.') ?></p>
<?php else: ?>
<div class="title-list-product"><h1><?php echo $this->__('MAIS VENDIDOS')?></h1></div>
<?php // Grid Mode ?>
<div class="shadow">
<div class="product-list-detail">
<?php
$currentUrl = $this->helper('core/url')->getCurrentUrl();
$baseurl = Mage::app()->getStore()->getBaseUrl();
if ($currentUrl == $baseurl){$break=3;} else {$break=16;}
?>
<?php $_columnCount = $this->getColumnCount(); ?>
<?php $i=0; foreach ($_productCollection as …Run Code Online (Sandbox Code Playgroud) 我有一组数据,我在 React-Native 的 flatlist 中呈现这些数据。在按下其中一个项目时,我希望它消失,但是平面列表上的所有项目都会变得动画,而不仅仅是我按下的项目。
constructor(props){
super(props);
this.state = { fadeAnim: new Animated.Value(1) }
onPressButtonnotdelivered(item) {
//Alert.alert(item.name)
const animations = [
Animated.timing(this.state.fadeAnim, {
toValue: 0,
duration: 500
}),
];
Animated.sequence(animations).start()
}
render() {
return (
<View>
<FlatList
data={this.state.data}
extraData={this.state}
keyExtractor={item => item.id}
renderItem={({ item, index }) => {
return (
<Animated.View key={index} style={[styles.animatedview, {opacity: this.state.fadeAnim}]}>
<View>
<View style={[styles.button, {backgroundColor: '#E94F64'}]}>
<TouchableOpacity style={styles.buttonview}
onPress={() => {this.onPressButtonnotdelivered(item)}}>
<View style={styles.btnIcon}>
<Icon name="block" size={30} />
<Text>Not delivered</Text>
</View>
</TouchableOpacity>
</View>
</View>
</Animated.View>
);
}} …Run Code Online (Sandbox Code Playgroud)