loop review

This commit is contained in:
Etienne Roudeix
2013-08-23 12:37:18 +02:00
parent 27f6612c32
commit 2d810540ec
5 changed files with 14 additions and 46 deletions

View File

@@ -67,7 +67,8 @@ class AssociatedContent extends Content
/**
* @param $pagination
*
* @return \Thelia\Core\Template\Element\LoopResult
* @return LoopResult
* @throws \InvalidArgumentException
*/
public function exec(&$pagination)
{

View File

@@ -58,7 +58,7 @@ class AttributeCombination extends BaseLoop
protected function getArgDefinitions()
{
return new ArgumentCollection(
Argument::createIntTypeArgument('product_sale_element', null, true),
Argument::createIntTypeArgument('product_sale_elements', null, true),
new Argument(
'order',
new TypeCollection(
@@ -98,9 +98,9 @@ class AttributeCombination extends BaseLoop
'ATTRIBUTE_AV_ID'
);
$productSaleElement = $this->getProduct_sale_element();
$productSaleElements = $this->getProduct_sale_elements();
$search->filterByProductSaleElementsId($productSaleElement, Criteria::EQUAL);
$search->filterByProductSaleElementsId($productSaleElements, Criteria::EQUAL);
$orders = $this->getOrder();

View File

@@ -63,7 +63,7 @@ class FeatureValue extends BaseLoop
Argument::createIntTypeArgument('product', null, true),
Argument::createIntListTypeArgument('feature_availability'),
Argument::createBooleanTypeArgument('exclude_feature_availability', 0),
Argument::createBooleanTypeArgument('exclude_default_values', 0),
Argument::createBooleanTypeArgument('exclude_personal_values', 0),
new Argument(
'order',
new TypeCollection(
@@ -112,7 +112,7 @@ class FeatureValue extends BaseLoop
$search->filterByFeatureAvId(null, Criteria::NULL);
}
$excludeDefaultValues = $this->getExclude_default_values();
$excludeDefaultValues = $this->getExclude_personal_values();
if($excludeDefaultValues == true) {
$search->filterByByDefault(null, Criteria::NULL);
}

View File

@@ -42,7 +42,7 @@ use Thelia\Type;
*
* Product Sale Elements loop
*
* @todo : manage currency
* @todo : manage currency and attribute_availability
*
* Class ProductSaleElements
* @package Thelia\Core\Template\Loop
@@ -56,7 +56,7 @@ class ProductSaleElements extends BaseLoop
protected function getArgDefinitions()
{
return new ArgumentCollection(
Argument::createIntTypeArgument('devise'),
Argument::createIntTypeArgument('currency'),
Argument::createIntTypeArgument('product', null, true),
new Argument(
'attribute_availability',
@@ -106,7 +106,7 @@ class ProductSaleElements extends BaseLoop
}
}
$devise = $this->getDevise();
$currency = $this->getCurrency();
$search->joinProductPrice('price', Criteria::INNER_JOIN);
//->addJoinCondition('price', '');

View File

@@ -1,6 +1,6 @@
<h1>Category page</h1>
<div style="border: solid 8px; margin: 0px; padding: 0px; width: 30%; float: left">
<div style="border: solid 8px; margin: 0px; padding: 0px; width: 45%; float: left">
<h2>CATALOG</h2>
@@ -73,7 +73,7 @@
{assign var=current_product value=#ID}
{loop name="pse" type="product_sale_elements" product="#ID"}
<div style="border: solid 2px darkorange; padding: 5px; margin: 5px;">
{loop name="combi" type="attribute_combination" product_sale_element="#ID"}
{loop name="combi" type="attribute_combination" product_sale_elements="#ID"}
#ATTRIBUTE_TITLE = #ATTRIBUTE_AVAILABILITY_TITLE<br />
{/loop}
<br />#WEIGHT g
@@ -161,7 +161,7 @@
{assign var=current_product value=#ID}
{loop name="pse" type="product_sale_elements" product="#ID"}
<div style="border: solid 2px darkorange; padding: 5px; margin: 5px;">
{loop name="combi" type="attribute_combination" product_sale_element="#ID"}
{loop name="combi" type="attribute_combination" product_sale_elements="#ID"}
#ATTRIBUTE_TITLE = #ATTRIBUTE_AVAILABILITY_TITLE<br />
{/loop}
<br />#WEIGHT g
@@ -187,7 +187,7 @@
</div>
<div style="border: solid 8px; margin: 0px; padding: 0px; width: 30%; float: left">
<div style="border: solid 8px; margin: 0px; padding: 0px; width: 45%; float: left">
<h2>ALL FEATURES AND THEIR AVAILABILITY</h2>
@@ -221,37 +221,4 @@
{/loop}
</ul>
</div>
<div style="border: solid 8px; margin: 0px; padding: 0px; width: 30%; float: left">
<h2>SANDBOX</h2>
{*loop name="product" type="product" order="promo,min_price" exclude_category="3" new="on" promo="off"}
<h3>PRODUCT : #REF / #TITLE</h3>
{/loop*}
{*loop name="product" type="product" new="on" promo="off"}
<h3>PRODUCT : #REF / #TITLE</h3>
{/loop*}
{*loop name="product" type="product" order="ref" feature_availability="1: (1 | 2) , 2: 4, 3: 433"}
<h3>PRODUCT : #REF / #TITLE</h3>
price : #PRICE €<br />
promo price : #PROMO_PRICE €<br />
is promo : #PROMO<br />
is new : #NEW<br />
weight : #WEIGHT<br />
{/loop*}
{*loop name="product" type="product" order="ref" feature_values="1: foo"}
<h3>PRODUCT : #REF / #TITLE</h3>
price : #PRICE €<br />
promo price : #PROMO_PRICE €<br />
is promo : #PROMO<br />
is new : #NEW<br />
weight : #WEIGHT<br />
{/loop*}
</div>