Claudia Posted September 25 Share Posted September 25 How does CubeCart determine what to use as the shipping date of an order? Is it set by when the status of the order is set as complete? I would like to be able to input this info manually; and how would I make it work on the order history / view details page when the customer is logged into their account. Thanks for any and all help! I use a database called all_ship_date and manually input the date for all orders whether the order is thru the store or I create it for offsite sales. I also do this for the shipping paid for - venue_ship_product for and the shipping used - all_shipping_used (often times I give a shipping upgrade and want the customer to know) I'd like to implement them here too This is what I have in skin/contents/receipt {if $DELIVERY} <hr> <div class="title-mid marg-top">{$LANG.common.delivery}</div> {if !empty($DELIVERY.date)} <div class="row"> <div class="small-6 medium-3 columns">Shipping Date:</div> <div class="small-6 medium-9 columns">{$DELIVERY.date}</div> </div> {/if} {if !empty($DELIVERY.method)} <div class="row"> <div class="small-6 medium-3 columns">Shipping Carrier:</div> <div class="small-6 medium-9 columns">{$DELIVERY.method}</div> </div> {/if} Quote Link to comment Share on other sites More sharing options...
bsmither Posted September 25 Share Posted September 25 (edited) When the admin is updating an order, specifically when changing an order to Complete ('status' = 3), there is code in the admin /sources/ file orders.index.inc.php, near line 208, that tests for the presence of a manually entered 'ship_date'. If not present (or empty), then today's date will be used. I haven't checked if a query for an order's summary was fetched from the cache (I would assume so because, eventually, the order's details won't change over time) caused by the customer wanting to see their order history. Therefore, after Saving the order summary from admin, the admin would need to have CubeCart clear its internal cache, then the customer would need to refresh their view of the order's details. "I use a database called all_ship_date, venue_ship_product, and all_shipping_used." Where are these database tables located? In the same database as are all the other "CubeCart_abc" database tables? If so, then code could be added (likely through a code snippet) to JOIN that data into $Smarty's $DELIVERY array. If not, while not impossible, a much more complicated effort would be involved to fetch the relevant data. Edited September 25 by bsmither Quote Link to comment Share on other sites More sharing options...
Claudia Posted September 25 Author Share Posted September 25 All of those fields are in the order_summary database, but I can put them where needed for the code snippet to work. Or, if possible, I'd rather change the stock code. Quote Link to comment Share on other sites More sharing options...
bsmither Posted September 25 Share Posted September 25 So, there is 'all_ship_date', etc. as a columns in CubeCart_order_summary. Therefore, it should be real easy to incorporate those columns into the $DELIVERY array. I will look at the stock code to try to add new code to read those columns. Quote Link to comment Share on other sites More sharing options...
bsmither Posted September 25 Share Posted September 25 (edited) In /classes/cubecart.class.php, near line 2623 (CC652), begins a block of code that tests if the shipping method used has a shipping module. At lines 2636 and 2646, there is code that formats 'ship_date'. Additional statements can be added just above those two statements: Find in two locations: 'date' => (!empty($order['ship_date']) && $order['ship_date']!=='0000-00-00') ? formatDispatchDate($order['ship_date']) : '' Add above each location: 'alt_ship_date' => (!empty($order['alt_ship_date']) && $order['alt_ship_date']!=='0000-00-00') ? formatDispatchDate($order['alt_ship_date']) : '', 'venue_ship_product' => $order['venue_ship_product'], 'all_shipping_used' => $order['all_shipping_used'], Then, in the skin, add the necessary HTML to show these new elements of the $DELIVERY array. Edited September 25 by bsmither Quote Link to comment Share on other sites More sharing options...
Claudia Posted September 25 Author Share Posted September 25 do you mean 'alt_ship_date' or my table all_ship_date Quote Link to comment Share on other sites More sharing options...
Claudia Posted September 26 Author Share Posted September 26 Can I do this? I don't like the way the ship date is formatted 'all_ship_date' => $order['all_ship_date'], 'venue_ship_product' => $order['venue_ship_product'], 'all_shipping_used' => $order['all_shipping_used'], <div class="title-mid marg-top">{$LANG.common.delivery}</div> {if !empty($DELIVERY.all_ship_date)} <div class="row"> <div class="small-6 medium-3 columns">Shipping Date:</div> <div class="small-6 medium-9 columns">{$DELIVERY.all_ship_date}</div> </div> {/if} {if !empty($DELIVERY.venue_ship_product)} <div class="row"> <div class="small-6 medium-3 columns">Shipping Paid For:</div> <div class="small-6 medium-9 columns">{$DELIVERY.venue_ship_product}</div> </div> {/if} {if !empty($DELIVERY.all_shipping_used)} <div class="row"> <div class="small-6 medium-3 columns">Shipping Used:</div> <div class="small-6 medium-9 columns">{$DELIVERY.all_shipping_used}</div> </div> {/if} Quote Link to comment Share on other sites More sharing options...
bsmither Posted September 26 Share Posted September 26 Certainly! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.