Recettes : on finalise la fonction d'impression de la recette

This commit is contained in:
2021-05-05 22:37:10 +02:00
parent 347fbf2d77
commit 0790ae40ba
4 changed files with 50 additions and 36 deletions

View File

@@ -17,5 +17,7 @@ return array(
'Quantity needed' => 'Quantité nécessaire',
'Quantity proposed' => 'Quantité proposée',
'Select' => 'Sélectionner',
'Add to cart' => 'Ajouter ces produits au panier',
'Add to cart' => 'Ajouter au panier',
'Print recipe' => 'Imprimer la recette',
'Some products may not be in stock' => '* les produits que vous ne pouvez pas cocher ne sont plus en stock',
);

View File

@@ -3,7 +3,6 @@
namespace Recettes\Loop;
use Recettes\Model\RecipeProductsQuery;
use Thelia\Action\AttributeAv;
use Thelia\Core\Template\Element\BaseLoop;
use Thelia\Core\Template\Element\LoopResult;
use Thelia\Core\Template\Element\LoopResultRow;
@@ -12,8 +11,6 @@ use Thelia\Core\Template\Loop\Argument\Argument;
use Thelia\Core\Template\Loop\Argument\ArgumentCollection;
use Thelia\Model\AttributeAvI18nQuery;
use Thelia\Model\AttributeCombinationQuery;
use Thelia\Model\AttributeI18n;
use Thelia\Model\AttributeI18nQuery;
use Thelia\Model\ProductI18nQuery;
use Thelia\Model\ProductSaleElementsQuery;
@@ -40,11 +37,13 @@ class ProductsLoop extends BaseLoop implements PropelSearchLoopInterface
$productLabel = ProductI18nQuery::create()->findOneById($pse->getProductId())->getTitle();
$attributeCombination = AttributeCombinationQuery::create()->findOneByProductSaleElementsId($product->getPseId());
$unity = AttributeAvI18nQuery::create()->findOneById($attributeCombination->getAttributeAvId())->getTitle();
$inStock = $pse->getQuantity();
$loopResultRow = new LoopResultRow($product);
$loopResultRow
->set("RECIPE_ID", $product->getRecipeId())
->set("PSE_ID", $product->getPseId())
->set("IN_STOCK", $inStock > 0)
->set("PRODUCT_LABEL", $productLabel)
->set("QUANTITY_NEEDED", $product->getQuantity())
->set("QUANTITY_PROPOSED", $product->getNbOfProducts())

View File

@@ -65,7 +65,7 @@ div.entete span b {
white-space: nowrap;
}
.cellule-large {
width: 40%;
width: 20%;
}
.cellule-etroite {
width: 1%;
@@ -80,5 +80,16 @@ div.entete span b {
font-weight: bold;
}
.bouton-imprimer {
margin: 20px 0;
text-align: center;
}
}
@media print {
.footer-block,
header,
.nav-breadcrumb,
.table-ingredients tr:last-of-type,
#tarteaucitronAlertBig {
display: none !important;
}
}