-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Split templates into logical blocks to make extending easier for merc…
…hants
- Loading branch information
Christoffer Lindqvist
committed
Sep 25, 2015
1 parent
726486d
commit 6eb76a1
Showing
22 changed files
with
742 additions
and
173 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
{** | ||
* Copyright (c) 2015, Nosto Solutions Ltd | ||
* All rights reserved. | ||
* | ||
* Redistribution and use in source and binary forms, with or without | ||
* modification, are permitted provided that the following conditions are met: | ||
* | ||
* 1. Redistributions of source code must retain the above copyright notice, | ||
* this list of conditions and the following disclaimer. | ||
* | ||
* 2. Redistributions in binary form must reproduce the above copyright notice, | ||
* this list of conditions and the following disclaimer in the documentation | ||
* and/or other materials provided with the distribution. | ||
* | ||
* 3. Neither the name of the copyright holder nor the names of its contributors | ||
* may be used to endorse or promote products derived from this software without | ||
* specific prior written permission. | ||
* | ||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | ||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE | ||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | ||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | ||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | ||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | ||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | ||
* POSSIBILITY OF SUCH DAMAGE. | ||
* | ||
* @author Nosto Solutions Ltd <shopware@nosto.com> | ||
* @copyright Copyright (c) 2015 Nosto Solutions Ltd (http://www.nosto.com) | ||
* @license http://opensource.org/licenses/BSD-3-Clause BSD 3-Clause | ||
*} | ||
|
||
{block name="nosto_addtocart_script"} | ||
<script type="text/javascript"> | ||
//<![CDATA[ | ||
{literal} | ||
if (typeof Nosto === "undefined") { | ||
var Nosto = {}; | ||
} | ||
{/literal} | ||
Nosto.addProductToCart = function (productNumber) { | ||
var form = document.createElement("form"); | ||
form.setAttribute("method", "post"); | ||
form.setAttribute("action", "{url controller=checkout action=addArticle}"); | ||
var hiddenFields = { | ||
"sActionIdentifier": "{$sUniqueRand}", | ||
"sAdd": productNumber, | ||
"sQuantity": 1 | ||
}; | ||
for(var key in hiddenFields) { | ||
if(hiddenFields.hasOwnProperty(key)) { | ||
var hiddenField = document.createElement("input"); | ||
hiddenField.setAttribute("type", "hidden"); | ||
hiddenField.setAttribute("name", key); | ||
hiddenField.setAttribute("value", hiddenFields[key]); | ||
form.appendChild(hiddenField); | ||
} | ||
} | ||
document.body.appendChild(form); | ||
form.submit(); | ||
}; | ||
//]]> | ||
</script> | ||
{/block} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
{** | ||
* Copyright (c) 2015, Nosto Solutions Ltd | ||
* All rights reserved. | ||
* | ||
* Redistribution and use in source and binary forms, with or without | ||
* modification, are permitted provided that the following conditions are met: | ||
* | ||
* 1. Redistributions of source code must retain the above copyright notice, | ||
* this list of conditions and the following disclaimer. | ||
* | ||
* 2. Redistributions in binary form must reproduce the above copyright notice, | ||
* this list of conditions and the following disclaimer in the documentation | ||
* and/or other materials provided with the distribution. | ||
* | ||
* 3. Neither the name of the copyright holder nor the names of its contributors | ||
* may be used to endorse or promote products derived from this software without | ||
* specific prior written permission. | ||
* | ||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | ||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE | ||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | ||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | ||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | ||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | ||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | ||
* POSSIBILITY OF SUCH DAMAGE. | ||
* | ||
* @author Nosto Solutions Ltd <shopware@nosto.com> | ||
* @copyright Copyright (c) 2015 Nosto Solutions Ltd (http://www.nosto.com) | ||
* @license http://opensource.org/licenses/BSD-3-Clause BSD 3-Clause | ||
*} | ||
|
||
{block name="nosto_cart"} | ||
<div class="nosto_cart" style="display:none"> | ||
{if isset($nostoCart) && is_object($nostoCart)} | ||
{foreach from=$nostoCart->getLineItems() item=lineItem} | ||
<div class="line_item"> | ||
<span class="product_id">{$lineItem->getProductId()|escape:'htmlall':'UTF-8'}</span> | ||
<span class="quantity">{$lineItem->getQuantity()|escape:'htmlall':'UTF-8'}</span> | ||
<span class="name">{$lineItem->getName()|escape:'htmlall':'UTF-8'}</span> | ||
<span class="unit_price">{$lineItem->getUnitPrice()->getPrice()|number_format:2:".":""}</span> | ||
<span class="price_currency_code">{$lineItem->getCurrency()->getCode()|escape:'htmlall':'UTF-8'}</span> | ||
</div> | ||
{/foreach} | ||
{/if} | ||
</div> | ||
{/block} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
Views/frontend/plugins/nosto_tagging/checkout/cart_recos.tpl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
{** | ||
* Copyright (c) 2015, Nosto Solutions Ltd | ||
* All rights reserved. | ||
* | ||
* Redistribution and use in source and binary forms, with or without | ||
* modification, are permitted provided that the following conditions are met: | ||
* | ||
* 1. Redistributions of source code must retain the above copyright notice, | ||
* this list of conditions and the following disclaimer. | ||
* | ||
* 2. Redistributions in binary form must reproduce the above copyright notice, | ||
* this list of conditions and the following disclaimer in the documentation | ||
* and/or other materials provided with the distribution. | ||
* | ||
* 3. Neither the name of the copyright holder nor the names of its contributors | ||
* may be used to endorse or promote products derived from this software without | ||
* specific prior written permission. | ||
* | ||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | ||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE | ||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | ||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | ||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | ||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | ||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | ||
* POSSIBILITY OF SUCH DAMAGE. | ||
* | ||
* @author Nosto Solutions Ltd <shopware@nosto.com> | ||
* @copyright Copyright (c) 2015 Nosto Solutions Ltd (http://www.nosto.com) | ||
* @license http://opensource.org/licenses/BSD-3-Clause BSD 3-Clause | ||
*} | ||
|
||
{block name="nosto_cart_recos"} | ||
<div class="nosto_element" id="nosto-page-cart1"></div> | ||
<div class="nosto_element" id="nosto-page-cart3"></div> | ||
<div class="nosto_element" id="nosto-page-cart2"></div> | ||
{/block} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
61 changes: 61 additions & 0 deletions
61
Views/frontend/plugins/nosto_tagging/checkout/order_tagging.tpl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
{** | ||
* Copyright (c) 2015, Nosto Solutions Ltd | ||
* All rights reserved. | ||
* | ||
* Redistribution and use in source and binary forms, with or without | ||
* modification, are permitted provided that the following conditions are met: | ||
* | ||
* 1. Redistributions of source code must retain the above copyright notice, | ||
* this list of conditions and the following disclaimer. | ||
* | ||
* 2. Redistributions in binary form must reproduce the above copyright notice, | ||
* this list of conditions and the following disclaimer in the documentation | ||
* and/or other materials provided with the distribution. | ||
* | ||
* 3. Neither the name of the copyright holder nor the names of its contributors | ||
* may be used to endorse or promote products derived from this software without | ||
* specific prior written permission. | ||
* | ||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | ||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE | ||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | ||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | ||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | ||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | ||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | ||
* POSSIBILITY OF SUCH DAMAGE. | ||
* | ||
* @author Nosto Solutions Ltd <shopware@nosto.com> | ||
* @copyright Copyright (c) 2015 Nosto Solutions Ltd (http://www.nosto.com) | ||
* @license http://opensource.org/licenses/BSD-3-Clause BSD 3-Clause | ||
*} | ||
|
||
{block name="nosto_order"} | ||
{if isset($nostoOrder) && is_object($nostoOrder)} | ||
<div class="nosto_purchase_order" style="display:none"> | ||
<span class="order_number">{$nostoOrder->getOrderNumber()|escape:'htmlall':'UTF-8'}</span> | ||
<span class="order_status_code">{$nostoOrder->getOrderStatus()->getCode()|escape:'htmlall':'UTF-8'}</span> | ||
<span class="order_status_label">{$nostoOrder->getOrderStatus()->getLabel()|escape:'htmlall':'UTF-8'}</span> | ||
<span class="payment_provider">{$nostoOrder->getPaymentProvider()|escape:'htmlall':'UTF-8'}</span> | ||
<div class="buyer"> | ||
<span class="first_name">{$nostoOrder->getBuyerInfo()->getFirstName()|escape:'htmlall':'UTF-8'}</span> | ||
<span class="last_name">{$nostoOrder->getBuyerInfo()->getLastName()|escape:'htmlall':'UTF-8'}</span> | ||
<span class="email">{$nostoOrder->getBuyerInfo()->getEmail()|escape:'htmlall':'UTF-8'}</span> | ||
</div> | ||
<div class="purchased_items"> | ||
{foreach from=$nostoOrder->getPurchasedItems() item=lineItem} | ||
<div class="line_item"> | ||
<span class="product_id">{$lineItem->getProductId()|escape:'htmlall':'UTF-8'}</span> | ||
<span class="quantity">{$lineItem->getQuantity()|escape:'htmlall':'UTF-8'}</span> | ||
<span class="name">{$lineItem->getName()|escape:'htmlall':'UTF-8'}</span> | ||
<span class="unit_price">{$lineItem->getUnitPrice()->getPrice()|number_format:2:".":""}</span> | ||
<span class="price_currency_code">{$lineItem->getCurrency()->getCode()|escape:'htmlall':'UTF-8'}</span> | ||
</div> | ||
{/foreach} | ||
</div> | ||
</div> | ||
{/if} | ||
{/block} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
{** | ||
* Copyright (c) 2015, Nosto Solutions Ltd | ||
* All rights reserved. | ||
* | ||
* Redistribution and use in source and binary forms, with or without | ||
* modification, are permitted provided that the following conditions are met: | ||
* | ||
* 1. Redistributions of source code must retain the above copyright notice, | ||
* this list of conditions and the following disclaimer. | ||
* | ||
* 2. Redistributions in binary form must reproduce the above copyright notice, | ||
* this list of conditions and the following disclaimer in the documentation | ||
* and/or other materials provided with the distribution. | ||
* | ||
* 3. Neither the name of the copyright holder nor the names of its contributors | ||
* may be used to endorse or promote products derived from this software without | ||
* specific prior written permission. | ||
* | ||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | ||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE | ||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | ||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | ||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | ||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | ||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | ||
* POSSIBILITY OF SUCH DAMAGE. | ||
* | ||
* @author Nosto Solutions Ltd <shopware@nosto.com> | ||
* @copyright Copyright (c) 2015 Nosto Solutions Ltd (http://www.nosto.com) | ||
* @license http://opensource.org/licenses/BSD-3-Clause BSD 3-Clause | ||
*} | ||
|
||
{block name="nosto_customer"} | ||
{if isset($nostoCustomer) && is_object($nostoCustomer)} | ||
<div class="nosto_customer" style="display:none"> | ||
<span class="first_name">{$nostoCustomer->getFirstName()|escape:'htmlall':'UTF-8'}</span> | ||
<span class="last_name">{$nostoCustomer->getLastName()|escape:'htmlall':'UTF-8'}</span> | ||
<span class="email">{$nostoCustomer->getEmail()|escape:'htmlall':'UTF-8'}</span> | ||
</div> | ||
{/if} | ||
{/block} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.