Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<?php
// Record Source
try {
$seedprod_source = $_COOKIE['seedprod_source'];
$source = '';
if(!empty($seedprod_source)){
$source = explode("|",$seedprod_source)[0];
$dt = date("Y-m-d H:i:s",explode("|",$seedprod_source)[1]);
$order = Order::find($data['order']->id);
$order->source = $source;
$order->source_datetime = $dt;
$order->save();
\Cookie::queue(\Cookie::forget('seedprod_source'));
}
$data['source'] = $source;
}catch(\Exception $e){
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment