Skip to content

Commit ea13898

Browse files
committed
Added action param to render pdf header/footer as partal view
1 parent aa1ce1b commit ea13898

File tree

4 files changed

+15
-5
lines changed

4 files changed

+15
-5
lines changed

src/Presentation/SmartStore.Web/Administration/Views/Product/PdfCatalog.Print.Cover.cshtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
@Html.Widget("pdfcatalog_cover_storename_after")
3030

3131
<div style="position: fixed; bottom: 0; width: 100%">
32-
@Html.Action("PdfReceiptFooter", "Common", new { area = "" })
32+
@Html.Action("PdfReceiptFooter", "Common", new { area = "", isPartial = true })
3333
</div>
3434

3535
</div>

src/Presentation/SmartStore.Web/Controllers/CommonController.cs

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -923,17 +923,27 @@ public ActionResult AccountDropdown()
923923
return PartialView(model);
924924
}
925925

926-
public ActionResult PdfReceiptHeader(PdfHeaderFooterVariables vars, int storeId = 0)
926+
public ActionResult PdfReceiptHeader(PdfHeaderFooterVariables vars, int storeId = 0, bool isPartial = false)
927927
{
928928
var model = PreparePdfReceiptHeaderFooterModel(storeId);
929929
model.Variables = vars;
930+
931+
ViewBag.IsPartial = isPartial;
932+
933+
if (isPartial)
934+
return PartialView(model);
930935
return View(model);
931936
}
932937

933-
public ActionResult PdfReceiptFooter(PdfHeaderFooterVariables vars, int storeId = 0)
938+
public ActionResult PdfReceiptFooter(PdfHeaderFooterVariables vars, int storeId = 0, bool isPartial = false)
934939
{
935940
var model = PreparePdfReceiptHeaderFooterModel(storeId);
936941
model.Variables = vars;
942+
943+
ViewBag.IsPartial = isPartial;
944+
945+
if (isPartial)
946+
return PartialView(model);
937947
return View(model);
938948
}
939949

src/Presentation/SmartStore.Web/Views/Common/PdfReceiptFooter.cshtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
@using SmartStore.Web.Framework.Pdf;
33

44
@{
5-
Layout = "~/Views/Shared/_Print.cshtml";
5+
Layout = ViewBag.IsPartial == true ? "" : "~/Views/Shared/_Print.cshtml";
66

77
var company = Model.MerchantCompanyInfo;
88
var bank = Model.MerchantBankAccount;

src/Presentation/SmartStore.Web/Views/Common/PdfReceiptHeader.cshtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
@using SmartStore.Web.Framework.Pdf;
33

44
@{
5-
Layout = "~/Views/Shared/_Print.cshtml";
5+
Layout = ViewBag.IsPartial == true ? "" : "~/Views/Shared/_Print.cshtml";
66
}
77

88
<header>

0 commit comments

Comments
 (0)