Publisher does not support the Fluid field type. Please do not contact asking when support will be available.

If you purchased an add-on from expressionengine.com, be sure to visit boldminded.com/claim to add the license to your account here on boldminded.com.

Ticket: CartThrob support

Status Resolved
Add-on / Version DataGrab 4.2.2
Severity
EE Version 7.2.6

John Faulds

Apr 11, 2023

Hi Brian, I probably should’ve checked this first before putting in the work that we’ve been discussing in the other recent ticket, but does Datagrab support CartThrob? And if not, how difficult would it be to do?

CartThrob does have a couple of its own fieldtypes, with order_items being the one that I’d be most concerned with (image attached).

Whenever an order is placed it also creates entries in both the orders and purchased_items channels with a field matching against the entry_id of the channel entry being purchased.

And the immediate problem I can see is that when importing product channel entries with Datagrab, the entry_id will change which means when the entries from orders and purchased_items are imported, the fields that contain the entry_ids won’t match.

#1

BoldMinded (Brian)

Hi, John. I haven’t personally tested it b/c setting up CT is a bit of work, but I do know of a couple customers who are using it. DG does support the order_items and price_quantity_thresholds field types.

#2

John Faulds

But how does it handle the entry_ids? Does anything need to be added to the source XML/CSV to make sure the entries link correctly?

#3

BoldMinded (Brian)

I see in the code it’s doing something with entry_id, but again I haven’t personally tested it. If you’re re-importing entries and the entry already exists, the entry_id won’t change if you configure DG to update existing entries. Maybe I’m not understanding the scenario entirely?

#4

John Faulds

So what I’m doing is starting with a completely fresh database and reimporting all entries from the production site. So the entries don’t currently exist in the db I’m importing into, so when they do get imported, they end up with different entry_ids than what they are on production.

When you place an order with CartThrob it creates an entry in the orders channel and adds rows to the order_items fieldtype with each row having the entry_id matching the entry in the products channel. At the same time, entries are also created in the purchased items channel with an ID field which again matches the entry_id of the product entry.

So if I use DG to import entries from the orders and purchased items channels, the entry_ids will be for what they are on the production site, not necessarily what they are on the new db I’m working on.

#5

BoldMinded (Brian)

I’m a little unclear… have you tried importing and it doesn’t work or are you asking if it works before you try it? Because if it is the later, I honestly have no idea. I don’t see it making any calls to a purchases table.

What you’re describing and what I’m seeing in the code leads me to believe what you’re attempting to do won’t work. I would suggest trying it and see what happens. If it doesn’t work as you expect this sounds like more than a simple bug fix and may need a decent amount of custom dev to implement, which I could do if you’re open to sponsoring the development.

#6

BoldMinded (Brian)

I’m going to resolve this ticket b/c I think the build sent in https://boldminded.com/support/ticket/2672 will fix the issue for you.

Login to reply