Closed (fixed)
Project:
Commerce Features
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
17 Aug 2011 at 15:03 UTC
Updated:
30 Oct 2011 at 14:20 UTC
Jump to comment: Most recent file
Comments
Comment #1
artusamakOk it's implemented in my sandbox, to review it here is where you can fetch it:
URL of the branch for core reeading review:
http://drupalcode.org/sandbox/Artusamak/1252122.git/shortlog/refs/heads/...
Comment #2
pcambraIt would be great indeed, looks fine. Just a question, I think that this new feature provides in the base a rules component exporter through features, couldn't this be done in a generic way (maybe in rules module itself) so you can export any rules component?
Comment #3
artusamakYeah that's the idea that i'm going to try to implements, so far this is working. I'll update the issue if needed.
Comment #4
artusamakAfter digging a bit into the issue, i found out that we can't directly rely on Rules export because the rules components when they are exported as features are attached to the commerce_tax module and we can't alter this override before the export.
That means that this patch will have to stay on commerce features right now.
I slightly changed the code to let the exported taxes being displayed on the taxes page list because commerce_tax was hidding every tax that doesn't have the admin_list property to TRUE.
See this commit for review: http://drupalcode.org/sandbox/Artusamak/1252122.git/commitdiff/e141eb534...
Comment #5
pcambraHi,
I've tried this patch and I've managed to get the tax types correctly exported by replacing the $type['type'] by $type['name'] so the revert works correctly.
The export of the rates, on the other hand doesn't seem to work properly, you can actually export rates, but those don't get imported correctly. I'd say that hook_commerce_tax_rate_info_alter is not working as expected in this case.
Attaching the patch modified.
Comment #6
rfayThis seemed at first to bring in the tax rates, but didn't get the rules correct. The rules appear in the feature code, but don't get properly imported.
Also, when the feature is enabled it hides already-created existing tax rates. You actually have to disable commerce_features to get them back. Just enabling Commerce Features with this patch (enabling no feature at all) causes all existing tax rates to disappear.
Comment #7
rfayHere's a patch (and interdiff) that works for tax rates (I haven't tried tax types yet). As you can see from the interdiff there are just a couple of changes.
I used this patch to create Commerce Canadian Taxes
However, there are at least these issues.
Thanks for the great work on this, @Artusamak - maybe with some of the great brains here we can sort out the remaining issues.
Comment #8
pcambraOk, I've give this a rework, commerce_tax module doesn't take in account that other modules may provide taxes and therefore the edit button doesn't appear (I think that this is why Randy had to do all that rework including stuff in the module and install files, which should not be required anymore).
I think this patch is way safer, I'd appreciate testing.
Comment #9
rfayAh, wonderful to see the master at work!
I tried to break this every way I could, and I failed. I've exported new features, changed stuff, updated the feature, installed the feature on a new clean install. It all "just works".
I'm not sure I'm going to be able to recover my Canadian Taxes work without re-doing it, but that comes later.
Fantastic, and thanks!
Comment #10
pcambraJust committed this!
Many thanks to Julien and Randy :)