![]() |
Estimated Ship Time in MiniCart (like apple)
I'm trying to get my minicart to display an estimated ship time similar to the one on apple's store. The minicart should display the number of days that it should take for my company to ship based on the item in the cart with the longest ship time.
So far I have: 1) Added a new INT() field to the xcart_products table called "ship_time". 2) Modified skin1/admin/product_details.tpl Where: Code:
<tr> Code:
<tr> Where: Code:
{if $minicart_total_items > 0} Code:
{assign var=ship value=0} My problem: The code only works when viewing cart.php. All other pages show the default 0. I think that this problem is due to the fact that I am using the $products variable. I should be using some sort of variable passed from minicart.php. i.e. : $smarty->assign("minicart_products", $cart["products"]); (I've tried this and it doesn't pass the new ship_time database field like the $products variable does in cart.php) I know that this mod would be useful for others. Any help would be greatly appreciated. Thanks, Scott |
Re: Estimated Ship Time (like apple)
Of course you are assuming that the customer has already entered their zip code?
|
Re: Estimated Ship Time (like apple)
Quote:
No, this would have nothing to do with zip code. My company sells all kinds of standard products that can be customized. When somebody orders a product without any custom work, we can ship almost immediately. When they customize the product, it's going to take us a few days before we can ship. I just want to give the customers a rough idea of what our shipping lead time is. Like I said before, I want something just like apple's store...an estimate of how long it will take us to process the order before it even gets shipped. |
Re: Estimated Ship Time (like apple)
Got it - I thought... well never mind... ;)
|
Re: Estimated Ship Time (like apple)
I got it to work with a bit of a workaround.
Personally, I think it's a pretty bad hack job, but it does work. There must be a better way. But, technically, this a working mod!!! Maybe one of you admins could move this post. :-) More feedback still appreciated. Here is the working code: 1) Added a new INT() field to the xcart_products table called "ship_time". 2)Modify includes/product_modify.php Where: Code:
# Code:
"ship_time" => $ship_time, 3) Modify skin1/admin/product_details.tpl Where: Code:
<tr> Code:
<tr> Where: Code:
{if $minicart_total_items > 0} Code:
{assign var=ship value=0} Where: Code:
$MINICART["total_items"] = ((!empty($cart["products"]) and is_array($cart["products"]))?count($cart["products"]):0) + ((!empty($cart["giftcerts"]) and is_array($cart["giftcerts"]))?count($cart["giftcerts"]):0); Code:
require_once ('include/func/func.cart.php'); More feedback would be appreciated. Thanks, Scott |
All times are GMT -8. The time now is 01:41 PM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.