Jump to content

Input shipping date manually


Claudia

Recommended Posts

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}

Link to comment
Share on other sites

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 by bsmither
Link to comment
Share on other sites

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 by bsmither
Link to comment
Share on other sites

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}

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...