-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
7 changed files
with
218 additions
and
9 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
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
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
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
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
32 changes: 32 additions & 0 deletions
32
app/design/frontend/base/default/layout/frenet/frenet_shipping.xml
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,32 @@ | ||
<?xml version="1.0"?> | ||
<layout version="0.1.0"> | ||
<frenet_product_shipping_quote> | ||
<block type="frenet_shipping/catalog_product_view_quote" name="product.info.frenet.shipping.quote" as="frenet.shipping.quote" template="frenet/shipping/catalog/product/view/quote.phtml"> | ||
</block> | ||
<reference name="product.info.extrahint"> | ||
<action method="append"> | ||
<block>product.info.frenet.shipping.quote</block> | ||
</action> | ||
</reference> | ||
</frenet_product_shipping_quote> | ||
|
||
<!-- Simple Products --> | ||
<PRODUCT_TYPE_simple> | ||
<update handle="frenet_product_shipping_quote" /> | ||
</PRODUCT_TYPE_simple> | ||
|
||
<!-- Configurable Products --> | ||
<PRODUCT_TYPE_configurable> | ||
<update handle="frenet_product_shipping_quote" /> | ||
</PRODUCT_TYPE_configurable> | ||
|
||
<!-- Bundle Products --> | ||
<PRODUCT_TYPE_bundle> | ||
<update handle="frenet_product_shipping_quote" /> | ||
</PRODUCT_TYPE_bundle> | ||
|
||
<!-- Grouped Products --> | ||
<PRODUCT_TYPE_grouped> | ||
<update handle="frenet_product_shipping_quote" /> | ||
</PRODUCT_TYPE_grouped> | ||
</layout> |
94 changes: 94 additions & 0 deletions
94
app/design/frontend/base/default/template/frenet/shipping/catalog/product/view/quote.phtml
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,94 @@ | ||
<?php | ||
/** | ||
* Frenet Shipping Gateway | ||
* | ||
* @category Frenet | ||
* | ||
* @author Tiago Sampaio <[email protected]> | ||
* @link https://github.com/tiagosampaio | ||
* @link https://tiagosampaio.com | ||
* | ||
* Copyright (c) 2020. | ||
*/ | ||
|
||
/** | ||
* @var Frenet_Shipping_Block_Catalog_Product_View_Quote $this | ||
* @var Mage_Catalog_Model_Product $product | ||
*/ | ||
|
||
$product = $this->getProduct(); | ||
?> | ||
|
||
<?php if ($product->isSaleable()) :?> | ||
<!-- <script type="text/x-magento-init">--> | ||
<!-- {--> | ||
<!-- "*": {--> | ||
<!-- "Magento_Ui/js/core/app": --><?//= $block->getJsLayout() ?> | ||
<!-- }--> | ||
<!-- }--> | ||
<!-- </script>--> | ||
<div class="box-frenet-quote" data-bind="scope: 'frenet-quote'"> | ||
<div class="fieldset"> | ||
<h2><?php echo $this->__('Shipping Quote')?></h2> | ||
<p><?php echo $this->__('Calculate the shipping quote for this product with Frenet.')?></p> | ||
<div class="field"> | ||
<label class="label" for="frenet-postcode-field"> | ||
<span><?php echo $this->__('Postcode') ?></span> | ||
</label> | ||
<div class="control"> | ||
<input type="text" | ||
name="postcode" | ||
id="frenet-postcode-field" | ||
min="0" | ||
value="" | ||
maxlength="9" | ||
class="input-text postcode" | ||
data-validate="required: true" | ||
data-bind="value: postcode, event: {change: activate}, attr: {title: fieldTitle}" | ||
/> | ||
</div> | ||
</div> | ||
<div class="actions"> | ||
<button type="button" class="button btn-cart"> | ||
<span><?php echo $this->__('Get Quote')?></span> | ||
</button> | ||
</div> | ||
<div class="table-wrapper"> | ||
<div data-bind="visible: error"> | ||
<span class="text-red" data-bind="text: errorMessage"></span> | ||
</div> | ||
<div data-bind="visible: displayNoResults"> | ||
<span data-bind="text: noResultsMessage"></span> | ||
</div> | ||
<table data-bind="visible: visible" class="data table"> | ||
<col width="60%"> | ||
<col width="10%"> | ||
<col width="10%"> | ||
<thead> | ||
<tr> | ||
<th data-bind="i18n: 'Description'"></th> | ||
<th data-bind="i18n: 'Time'"></th> | ||
<th data-bind="i18n: 'Price'"></th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<!-- ko foreach: rates --> | ||
<tr> | ||
<td data-bind="text: service_description"></td> | ||
<td data-bind="text: delivery_time"></td> | ||
<td data-bind="text: shipping_price"></td> | ||
</tr> | ||
<tr data-bind="visible: message" class="footer"> | ||
<td colspan="4"> | ||
<small class="note" data-bind="text: message"></small> | ||
</td> | ||
</tr> | ||
<!-- /ko --> | ||
</tbody> | ||
</table> | ||
</div> | ||
<div id="frenet-loader" data-mage-init='{"loader": {}}'> | ||
</div> | ||
</div> | ||
</div> | ||
<?php endif; ?> |