Closed (fixed)
Project:
Commerce Discount
Version:
7.x-1.x-dev
Component:
User interface
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
29 Nov 2012 at 15:54 UTC
Updated:
21 May 2015 at 03:44 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
bojanz commentedOuch, we currently don't have a "created" column at all for discounts, so we need to add that first.
(At the same time, rename "enabled" to "status" and "status" to "export_status" since it is currently confusing).
Comment #2
vasikehere is patch that:
- adds the new column "created" to discount schema
- change fields : rename "enabled" to "status" and "status" to "export_status"
- Update the Discounts view to include de changes + new sortable Created field in the Views
- others required by schema changes.
- About filtering the view on creation date, i can't see why it's needed, i think sorting for this field it's enough.
- if this "created" it's needed, then isn't also "updated" needed (i'm not sure created/updated are really needed here)?
- maybe a tagging of discounts could help for filtering.
Comment #3
jkuma commentedVery good patch!
From my perspective, we have enough filters in the discount UI. The "created" field can be useful for sorting the view, but I don't think it's relevant to expose it as a filter. I don't think we need a "updated" field....
Moreover, if you put yourself in merchant's shoes, the following filters are relevant according to me:
May you remove the updated field, fix some comments error
'description' => 'The Unix timestamp when the product was created.',and expose that filter to search by discount title?Comment #4
vasikere-worked the patch:
- keep renaming in discounts schema and thier changes
- get rid off created and its changes
- add name filter for the discounts view (nice to have Views Autocomplete Filters)
definitely this issue needs other title (have no inspiration right now).
Comment #5
jkuma commentedHere is an another attempt, I've changed some view's parameters, fix some CSS rules...
Comment #6
jkuma commentedComment #7
vasikewith the last patch (#5) i got an error when i run the update and the Discounts seems unusable:
PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'base.enabled' in 'field list': SELECT base.discount_id AS discount_id, base.name AS name, base.label AS label, base.type AS type, base.enabled AS enabled, base.status AS status, base.module AS module, base.component_title AS component_title FROM {commerce_discount} base WHERE (base.status IN (:db_condition_placeholder_0, :db_condition_placeholder_1, :db_condition_placeholder_2)) ; Array ( [:db_condition_placeholder_0] => 3 [:db_condition_placeholder_1] => 2 [:db_condition_placeholder_2] => 6 ) in EntityAPIController->query() (line 187 of /d7path/sites/all/modules/entity/includes/entity.controller.inc).i can't see where the "enabled" it's hooked.
Comment #8
vasikepatch updated to avoid the error from previous post (rebuild the schema).
Comment #9
jkuma commentedSolves the issue raised on #7 and it's working like a charm.
Comment #10
jkuma commentedCommitted in 7.x-1.x-dev branch.
Comment #12
jenlamptonI'm still getting the PDO error from #7 while running the lastest dev. Clearing all caches, the page cache, or the class registry will trigger the following:
and doing the same via drush from the command line shows:
Comment #13
jenlamptonhm, well truncating the cache_bootstrap and cache tables seemed to solve the problem.
Comment #14
jkuma commentedComment #16
Horroshow commented#13 Tried to truncate cache and cache_bootstrap but still getting the PDO Exception error when flushing the cache.
Comment #17
jkuma commentedDid you try to run the module updates ? (drush dbupdate)
Comment #18
jkuma commentedAlso what kind of PDO exception did you get during the flushing of caches?
Comment #19
larsjohnson commentedI also get (that) a PDO just as today when trying to flush:
It has to do something with the commerce discount module, disabling this module does make the error go away.
Comment #20
caspervoogt commented@larsjohnson it appears commerce_coupon still has some code in flux with regard to changing "enabled" to "status" . I tried fixing these but a maintainer would be better placed to review this. Suffice it to say commerce_coupon is incorrectly referencing "enabled" in some places where it should reference "status" instead. Look for:
->propertyCondition('enabled', TRUE)
and changed to:
->propertyCondition('status', TRUE)
That solved the errors with regard to Commerce Discount, however I am still unable to add a coupon ... due to apparent changes to the code field .. now called "data" ??
Comment #21
larsjohnson commentedthanks there is also a patch on comment #8 for commerce_discount that should be applied to commerce_discount alpha
Comment #22
larsjohnson commented@plethoradsign i think you can do coupons with line items, some of well at least one of the modules isnt compatible with commerce_k2 it should be the same thing c_k2 does have the updated commerce_discount but it doesnt have include a c_coupon references can be all over the place
Comment #23
caspervoogt commentedWell, I was only using Kickstart2 to confirm my issues.. on my actual site where I'm having issues I don't use Kickstart2. So when I modified commerce_coupon.module, I was doing that without Kickstart2.
I think I may have already tried the patch from #8 but not sure, and may retry. I temporarily gave up on coupons and just created some new recurring products with lower prices but will give the patch from #8 a try if my customer finds a need for coupons again.
Comment #24
joelpittetClosing this issue out, for clean-up