Debugging the coupon logic
Hi there,
I'm currently working on getting coupons to work properly.
The system we use is based on commerce kickstart.
There was another person working on this before me that quit,
so the coupon logic might or might not have already been
messed with.
When trying to use a coupon code for a percentage coupon, I get
an error caused by a thrown exception from common.inc. The
following code is what gets triggered:
if (!isset($entity->{$info['entity keys']['bundle']}) || $entity->{$info['entity keys']['bundle']} === '') {
throw new EntityMalformedException(t('Missing bundle property on entity of type @entity_type.', array('@entity_type' => $entity_type)));
}
I placed some dpms in there and saw that the entity_type was
commerce_order. The value of $info['entity keys']['bundle']
was 'type'.
And indeed the entity did not hold a 'type' property, for
reasons I can't even begin to fathom.
Seeing that this was the -dev version of the coupon percentage
module, I updated to 1.0-beta7, which is marked as stable.
After clearing my browser sessions as well as the drupal cache,
the problem persists. I am now at a complete loss on how to
debug this, any help is appreciated.