0

We have a client whose shipping needs are complicated enough that they currently only allow checkout for customers with their own shipping accounts. They would like to be able to open up their checkout process to allow purchases where the customer may not have their own shipping account.

I don't have any experience with CartThrob Invoice, which seems like it may make it possible for our client to create an invoice and add their own shipping cost. But would it be possible for a customer to somehow save their order as an invoice? Or maybe use the Save Order payment gateway, and then convert that saved order into an invoice so the shipping could be updated?

2
  • Just to clarify, the user would place an order (kind of), but not get charged until a later time when your client would put in their shipping charge, and the customer would come back to add their credit card info and finalize based on the new total. Is that correct? I have a few ideas but want to make sure I'm understanding the flow.
    – Matt
    May 11, 2016 at 18:22
  • @Matt: Yes, this is exactly what I'm looking for.
    – jrrdnx
    May 12, 2016 at 10:54

1 Answer 1

0

Thanks for providing the information in the comment above. Unfortunately I don't think there's a built-in way to programmatically do this. However, the exp_cartthrob_invoice_table is pretty straightforward. You should consider an extension that fires after an order is placed (potentially via the "offline payments" or "Save Order" gateways) that takes their info and INSERTs a row into exp_cartthrob_invoice_table.

Here's the structure of that table:

CREATE TABLE `exp_cartthrob_invoice_table` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `inv_description` text,
  `inv_title` text,
  `inv_line_items` text,
  `inv_cost` varchar(12) DEFAULT NULL,
  `inv_total_hours` varchar(12) DEFAULT NULL,
  `inv_status` varchar(20) DEFAULT NULL,
  `inv_date` int(11) DEFAULT NULL,
  `inv_paid_date` int(11) DEFAULT NULL,
  `inv_email_address` varchar(255) DEFAULT NULL,
  `inv_member_id` int(10) DEFAULT NULL,
  `inv_order_id` int(10) DEFAULT NULL,
  `inv_reference_number` varchar(1000) DEFAULT NULL,
  `inv_first_name` varchar(255) DEFAULT NULL,
  `inv_last_name` varchar(255) DEFAULT NULL,
  `inv_company` varchar(255) DEFAULT NULL,
  `inv_address` varchar(255) DEFAULT NULL,
  `inv_address2` varchar(255) DEFAULT NULL,
  `inv_city` varchar(255) DEFAULT NULL,
  `inv_state` varchar(5) DEFAULT NULL,
  `inv_zip` varchar(10) DEFAULT NULL,
  `inv_country_code` varchar(3) DEFAULT NULL,
  `inv_phone` varchar(15) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=103 DEFAULT CHARSET=utf8;

And here's a sample row. The inv_line_items column is a base64_encode()d JSON object.

INSERT INTO `exp_cartthrob_invoice_table` (`id`, `inv_description`, `inv_title`, `inv_line_items`, `inv_cost`, `inv_total_hours`, `inv_status`, `inv_date`, `inv_paid_date`, `inv_email_address`, `inv_member_id`, `inv_order_id`, `inv_reference_number`, `inv_first_name`, `inv_last_name`, `inv_company`, `inv_address`, `inv_address2`, `inv_city`, `inv_state`, `inv_zip`, `inv_country_code`, `inv_phone`)
VALUES
    (1, 'Test Invoice', 'Test Invoice', 'YToxOntpOjA7YTo0OntzOjEwOiJpdGVtX3RpdGxlIjtzOjQ6InRlc3QiO3M6MTY6Iml0ZW1fZGVzY3JpcHRpb24iO3M6NDoidGVzdCI7czo1OiJob3VycyI7aToyO3M6OToiaXRlbV9jb3N0IjtpOjI1MDt9fQ==', '250', '2', 'pending', 1382031430, NULL, '[email protected]', 0, NULL, '', 'John', 'Smith', '', '', '', '', '', '', '', '');

Feel free to contact us at [email protected] if you'd like help implementing this!

3
  • Thanks @Matt! At the moment, we haven't yet purchased the license for Invoice, so I'm unable to see what the table structure looks like. Is there any way to play around with it and get a feel for what it offers before purchasing? Or possibly provide a few screenshots, including the DB table with some sample data?
    – jrrdnx
    May 17, 2016 at 15:27
  • @jrrdnx I just edited the comment to add the table structure and a sample row.
    – Matt
    May 19, 2016 at 13:50
  • Thanks again! I've provided an overview to our client and it sounds like it's a viable solution. I'll definitely contact you if we need any assistance.
    – jrrdnx
    May 19, 2016 at 15:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.