WordPress.org

Forums

Jigoshop
[resolved] How to add Coupon to Orders page (1 post)

  1. morshah
    Member
    Posted 2 years ago #

    To add the coupon code under the discount on the orders page. The following steps were required:

    1. Open wp-content/plugins/jigoshop/admin/jigoshop-admin-post-types.php in text editor.

    2. Under the line:

    $order = new jigoshop_order($post->ID);

    add the following:

    $coupons = array();
    $order_discount_coupons = (array)$order->get_value_from_data('order_discount_coupons');
    if( ! empty( $order_discount_coupons )) {
    foreach ( $order_discount_coupons as $coupon ) {
    $coupons[] = isset( $coupon['code'] ) ? $coupon['code'] : '';
    }
    }

    3. Under the code:

    <tr>
    <th><?php _e('Discount', 'jigoshop'); ?></th>
    <td><?php echo jigoshop_price($order->order_discount); ?></td>
    </tr>

    add the following:

    <tr>
    <th><?php _e('Coupon', 'jigoshop'); ?></th>
    <td><?php echo implode( ',', $coupons ); ?></td>
    </tr>

    WordPress Version: 3.3.2
    Jigishop Version: 1.1.1

    http://wordpress.org/extend/plugins/jigoshop/

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Jigoshop
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic