Does anyone know if it's possible to allow a user account to create an account after they have completed their order and then assign that order to their newly created account?
Thanks.
Does anyone know if it's possible to allow a user account to create an account after they have completed their order and then assign that order to their newly created account?
Thanks.
You'd have to make an extension upon member registration. If you're using the native EE registration the hook would be member_member_register:
public function member_member_register($data, $member_id)
{
$this->EE->load->add_package_path(PATH_THIRD.'cartthrob/');
$this->EE->load->library('cartthrob_loader');
if ($order_id = $this->EE->cartthrob->cart->order('order_id'))
{
$this->EE->db->update('channel_titles', array('author_id' => $member_id), array('entry_id' => $order_id));
}
}
Yes it is.
On your {exp:cartthrob:checkout_form}
just add create_user="yes"
.
Make sure you map the appropriate fields in the Cartthrob backend.
You can read more about members in Cartthrob on their docs. http://cartthrob.com/docs/backend/members/index.html
<label><input type="checkbox" name="create_user" value="yes" /> Create a user account</label>
in your checkout form and get rid of the create_user="yes"
parameter. To do exactly what you are wanting, you may need to build something custom.
– Jason Varga
Mar 4 '13 at 13:42