Skip to content

Instantly share code, notes, and snippets.

@torunar
Created February 5, 2016 14:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save torunar/c61322290755d2e5a7c8 to your computer and use it in GitHub Desktop.
Save torunar/c61322290755d2e5a7c8 to your computer and use it in GitHub Desktop.
diff --git a/app/functions/fn.cart.php b/app/functions/fn.cart.php
index c0cdc8d..d6b66a1 100644
--- a/app/functions/fn.cart.php
+++ b/app/functions/fn.cart.php
@@ -3108,8 +3108,8 @@ function fn_calculate_cart_content(&$cart, $auth, $calculate_shipping = 'A', $ca
unset($product_groups[$g_key]['shippings'][$sh_id]);
}
- if (!empty($rate['delivery_time'])) {
- $product_groups[$g_key]['shippings'][$sh_id]['delivery_time'] = $rate['delivery_time'];
+ if (!empty($rate['service_delivery_time'])) {
+ $product_groups[$g_key]['shippings'][$sh_id]['service_delivery_time'] = $rate['service_delivery_time'];
}
}
}
diff --git a/app/Tygh/Shippings/Shippings.php b/app/Tygh/Shippings/Shippings.php
index 015d299..461302d 100644
--- a/app/Tygh/Shippings/Shippings.php
+++ b/app/Tygh/Shippings/Shippings.php
@@ -687,7 +687,8 @@ class Shippings
'price' => $rate['price'],
'keys' => $shippings[$rate['shipping_key']]['keys'],
'error' => $rate['error'],
- 'delivery_time' => isset($rate['delivery_time']) ? $rate['delivery_time'] : false,
+ 'service_delivery_time' => isset($rate['delivery_time']) ? $rate['delivery_time'] : false,
+ 'delivery_time' => $shippings[$rate['shipping_key']]['delivery_time']
);
}
diff --git a/design/backend/templates/views/shippings/components/test.tpl b/design/backend/templates/views/shippings/components/test.tpl
index a6b4fbd..dc4f095 100644
--- a/design/backend/templates/views/shippings/components/test.tpl
+++ b/design/backend/templates/views/shippings/components/test.tpl
@@ -60,10 +60,10 @@
<td><strong>{__("cost")}:</strong></td>
<td>{include file="common/price.tpl" value=$data.price}</td>
</tr>
- {if $data.delivery_time|trim}
+ {if $data.service_delivery_time|trim}
<tr>
<td><strong>{__("delivery_time")}:</strong></td>
- <td>{$data.delivery_time}</td>
+ <td>{$data.service_delivery_time}</td>
</tr>
{/if}
{else}
diff --git a/design/themes/responsive/templates/views/checkout/components/shipping_estimation.tpl b/design/themes/responsive/templates/views/checkout/components/shipping_estimation.tpl
index 28a2d78..f0dcc9b 100644
--- a/design/themes/responsive/templates/views/checkout/components/shipping_estimation.tpl
+++ b/design/themes/responsive/templates/views/checkout/components/shipping_estimation.tpl
@@ -124,8 +124,8 @@
{assign var="checked" value=""}
{/if}
- {if $shipping.delivery_time}
- {assign var="delivery_time" value="(`$shipping.delivery_time`)"}
+ {if $shipping.delivery_time || $shipping.service_delivery_time}
+ {assign var="delivery_time" value="(`$shipping.service_delivery_time|default:$shipping.delivery_time`)"}
{else}
{assign var="delivery_time" value=""}
{/if}
diff --git a/design/themes/responsive/templates/views/checkout/components/shipping_rates.tpl b/design/themes/responsive/templates/views/checkout/components/shipping_rates.tpl
index 038ef92..0cdc87a 100644
--- a/design/themes/responsive/templates/views/checkout/components/shipping_rates.tpl
+++ b/design/themes/responsive/templates/views/checkout/components/shipping_rates.tpl
@@ -65,8 +65,8 @@
{assign var="strong_end" value=""}
{/if}
- {if $shipping.delivery_time}
- {assign var="delivery_time" value="(`$shipping.delivery_time`)"}
+ {if $shipping.delivery_time || $shipping.service_delivery_time}
+ {assign var="delivery_time" value="(`$shipping.service_delivery_time|default:$shipping.delivery_time`)"}
{else}
{assign var="delivery_time" value=""}
{/if}
diff --git a/var/langs/en/core.po b/var/langs/en/core.po
index a657fd6..060670a 100644
--- a/var/langs/en/core.po
+++ b/var/langs/en/core.po
@@ -12116,9 +12116,9 @@ msgctxt "Languages::true"
msgid "True"
msgstr "True"
-msgctxt "Languages::ttc_delivery_time"
-msgid "Arbitrary text to be shown along with the shipping method title."
-msgstr "Arbitrary text to be shown along with the shipping method title."
+msgctxt "Languages::tt_views_shippings_update_delivery_time"
+msgid "The delivery time appears next to the name of the shipping method. If you use realtime shipping rate calculation, your shipping service may provide its own delivery time. The time provided by the shipping service will be displayed instead of the time you specify here."
+msgstr "The delivery time appears next to the name of the shipping method. If you use realtime shipping rate calculation, your shipping service may provide its own delivery time. The time provided by the shipping service will be displayed instead of the time you specify here."
msgctxt "Languages::ttc_page_title"
msgid "Page title displayed on a browser panel."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment