Advertisement
swkweb

Mail Template - PLAIN & HTML

Nov 29th, 2021
468
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.21 KB | None | 0 0
  1. PLAIN:
  2. {$subPosition = 0}
  3. {foreach item=details key=position from=$sOrderDetails}
  4. {* $details|print_r *}
  5. {if $details.swkweSetArticles || !in_array($details.modus, [20, 21])}
  6. {if $details.swkweSetArticles}
  7. {if is_array($details.swkweSetArticles)}
  8. {$detailAmount = (!$additional.show_net) ? $details.swkweSetArticles['netAmount'] : $details.swkweSetArticles['grossAmount']}
  9. {$detailPrice = $detailAmount / $details['quantity']}
  10. {else}
  11. {$detailPrice = (!$additional.show_net) ? $details.swkweSetArticles->getNetPrice() : $details.swkweSetArticles->getGrossPrice()}
  12. {$detailAmount = (!$additional.show_net) ? $details.swkweSetArticles->getNetAmount() : $details.swkweSetArticles->getGrossAmount()}
  13. {/if}
  14. {else}
  15. {$detailPrice = $details.price}
  16. {$detailAmount = $details.amount}
  17. {/if}
  18.  
  19. {{$position-$subPosition+1}|fill:4} {$details.ordernumber|fill:20} {$details.articlename|fill:49} {$details.quantity|fill:6} {$detailPrice|padding:8|currency|unescape:"htmlall"} {$detailAmount|padding:8|currency|unescape:"htmlall"}
  20. {if $details.swkweSetArticles}
  21. {if is_array($details.swkweSetArticles)}
  22. {foreach $details.swkweSetArticles['options'] as $option}
  23. - {if $option['quantity'] != 1}{$option['quantity']}x {/if}{$option['basketItem']['name']}
  24. {if $option['subSetOrder']}
  25. {foreach $option['subSetOrder']['options'] as $subSetOption}
  26. - {if {$subSetOption['quantity']} != 1}{$subSetOption['quantity']}x {/if}{$subSetOption['basketItem']['name']}
  27. {/foreach}
  28. {/if}
  29. {/foreach}
  30. {else}
  31. {foreach $details.swkweSetArticles->getOptions() as $option}
  32. - {if $option->getQuantity() != 1}{$option->getQuantity()}x {/if}{$option->getBasketItem()->getName()}
  33. {if $option->getSubSetOrder()}
  34. {foreach $option->getSubSetOrder()->getOptions() as $subSetOption}
  35. - {if {$subSetOption->getQuantity()} != 1}{$subSetOption->getQuantity()}x {/if}{$subSetOption->getBasketItem()->getName()}
  36. {/foreach}
  37. {/if}
  38. {/foreach}
  39. {/if}
  40. {/if}
  41. {elseif in_array($details.modus, [20, 21])}
  42. {$subPosition = $subPosition + 1}
  43. {/if}
  44. {/foreach}
  45.  
  46.  
  47. HTML:
  48. {$subPosition = 0}
  49. {foreach item=details key=position from=$sOrderDetails}
  50. {if $details.swkweSetArticles || !in_array($details.modus, [20, 21])}
  51. <tr>
  52. <td style="border-bottom:1px solid #cccccc;">{$position-$subPosition+1|fill:4} </td>
  53. <td style="border-bottom:1px solid #cccccc;">{if $details.image.src.0 && in_array($details.modus, [0, 20])}<img style="height: 57px;" height="57" src="{$details.image.src.0}" alt="{$details.articlename}" />{else} {/if}</td>
  54. <td style="border-bottom:1px solid #cccccc;">
  55. {$details.articlename|wordwrap:80|indent:4}<br>
  56. Artikel-Nr: {$details.ordernumber|fill:20}
  57. {if $details.swkweSetArticles}
  58. {if is_array($details.swkweSetArticles)}
  59. {foreach $details.swkweSetArticles['options'] as $option}
  60. <br>- {if $option['quantity'] != 1}{$option['quantity']}x {/if}{$option['basketItem']['name']}
  61. {if $option['subSetOrder']}
  62. {foreach $option['subSetOrder']['options'] as $subSetOption}
  63. <br> - {if $subSetOption['quantity'] != 1}{$subSetOption['quantity']}x {/if}{$subSetOption['basketItem']['name']}
  64. {/foreach}
  65. {/if}
  66. {/foreach}
  67. {$detailAmount = (!$additional.show_net) ? $details.swkweSetArticles['netAmount'] : $details.swkweSetArticles['grossAmount']}
  68. {$detailPrice = $detailAmount / $details['quantity']}
  69. {else}
  70. {foreach $details.swkweSetArticles->getOptions() as $option}
  71. <br>- {if $option->getQuantity() != 1}{$option->getQuantity()}x {/if}{$option->getBasketItem()->getName()}
  72. {if $option->getSubSetOrder()}
  73. {foreach $option->getSubSetOrder()->getOptions() as $subSetOption}
  74. <br> - {if $subSetOption->getQuantity() != 1}{$subSetOption->getQuantity()}x {/if}{$subSetOption->getBasketItem()->getName()}
  75. {/foreach}
  76. {/if}
  77. {/foreach}
  78. {$detailPrice = (!$additional.show_net) ? $details.swkweSetArticles->getNetPrice() : $details.swkweSetArticles->getGrossPrice()}
  79. {$detailAmount = (!$additional.show_net) ? $details.swkweSetArticles->getNetAmount() : $details.swkweSetArticles->getGrossAmount()}
  80. {/if}
  81. {else}
  82. {$detailPrice = $details.price}
  83. {$detailAmount = $details.amount}
  84. {/if}
  85. </td>
  86. <td style="border-bottom:1px solid #cccccc;">{$details.quantity|fill:6}</td>
  87. <td style="border-bottom:1px solid #cccccc;">{$detailPrice|padding:8|currency}</td>
  88. <td style="border-bottom:1px solid #cccccc;">{$detailAmount|padding:8|currency}</td>
  89. </tr>
  90. {elseif in_array($details.modus, [20, 21])}
  91. {$subPosition = $subPosition + 1}
  92. {/if}
  93. {/foreach}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement