Affiliate Coupon: How to get show_attributes=”coupons” displayed not in input box

When we use this shortcode: [affiliates_affiliate_profile show_name=”” show_email=”” show_attributes=”coupons” /]
The result is Coupons and in a text input box the coupon data. How can I get only the coupon data showing, but not in an input box?
Also, how can I separate the values? Right now, I get coupon1,coupon2,coupon3. Is it possible to target 1 coupon at a time?
Thank you


Comments

3 responses to “Affiliate Coupon: How to get show_attributes=”coupons” displayed not in input box”

  1. Hello Antonio,
    How do I separate the values that are within the “coupons” attributes? Right now I still get coupon1,coupon2,coupon3 in one bloc. Is it possible to target 1 coupon at a time? Something like
    [aff-show-attributes show_attributes=”coupons” show_data_1 /] : this would give me coupon1
    and
    [aff-show-attributes show_attributes=”coupons” show_data_2 /] this would give me coupon2
    etc.

    Thank you

    1. Hi Steve,
      You need to change the change the code to display your custom data. You could add in line 61, something like:

      if ( $key == 'coupons' ) {
      $coupons = explode( ",", $attrValue );
      if ( sizeof( $coupons ) > 0 ) {
      foreach ( $coupons as $coupon ) {
      $output .= esc_attr( $coupon ) . $sep;
      }
      }
      }

      I have not test this code, It’s only a reference to help you to create your own version.
      Kind Regards,
      Antonio B.

  2. Hi Steve,
    you can use this alternative shortcode to display the information as lineal text.
    Kind Regards,
    Antonio B.

Share