1
Answers
Vote up!
0
Vote down!

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.

Asked by: phryk
on June 19, 2013

1 Answer

Vote up!
0
Vote down!

The person you need to "stalk" is the issue queue maintainer of that particular module. If you want specific targeted help, did you know about Commerce Guys' Turbo Tickets?

https://marketplace.commerceguys.com/support/turbo-ticket

Guaranteed help, right away. I can confirm that percentage, Order-based discounts are hard and the Kickstart 2 implementation can be buggy.

Josh

Josh Miller
Answer by: Josh Miller
Posted: Jun 21, 2013