Repository Forums Support WooCommerce Extended Coupon Features PRO BOGO Fields not applying

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #16497

    We are trying to make the extend coupon features pro compatible with Woocommerce Smart Coupons so that we can export BOGO coupons.

    We need this baby ‘_wjecf_bogo_matching_products’ to post to the csv headers and populate corresponding fields as a ‘Yes’

    I’ve tried lots of versions and am not getting anywhere. . .

    I’m assuming we’d need to modify these sections:

     public function export_headers( $headers = array() ) {

     $headers[‘wc_sc_user_role_ids’] = __( ‘User Role’, ‘woocommerce-smart-coupons’ );

     return $headers;

     }

     /*
     public function export_coupon_meta_data( $meta_value = ”, $args = array() ) {

     if ( ! empty( $args[‘meta_key’] ) && ‘wc_sc_user_role_ids’ === $args[‘meta_key’] ) {
     if ( isset( $args[‘meta_value’] ) && ! empty( $args[‘meta_value’] ) ) {
     $user_role_ids = maybe_unserialize( stripslashes( $args[‘meta_value’] ) );
     if ( is_array( $user_role_ids ) && ! empty( $user_role_ids ) ) {
     $user_role_names = $this->get_user_role_names_by_ids( $user_role_ids );
     if ( is_array( $user_role_names ) && ! empty( $user_role_names ) ) {
     $meta_value = implode( ‘|’, wc_clean( wp_unslash( $user_role_names ) ) ); // Replace user role ids with their respective role name.
     }
     }
     }
     }

     return $meta_value;

     }

     public function postmeta_defaults( $defaults = array() ) {

     $defaults[‘wc_sc_user_role_ids’] = ”;

     return $defaults;
     }

     public function generate_coupon_meta( $data = array(), $post = array() ) {

     $user_role_names = ”;

     if ( ! empty( $post[‘wc_sc_user_role_ids’] ) && is_array( $post[‘wc_sc_user_role_ids’] ) ) {
     $user_role_names = $this->get_user_role_names_by_ids( $post[‘wc_sc_user_role_ids’] );
     if ( is_array( $user_role_names ) && ! empty( $user_role_names ) ) {
     $user_role_names = implode( ‘|’, wc_clean( wp_unslash( $user_role_names ) ) );
     }
     }

     $data[‘wc_sc_user_role_ids’] = $user_role_names; // Replace user role ids with their respective role name.

     return $data;
     }

    It would be INCREDIBLY beneficial to us if you could please help us resolve this piece.

    #16500
    Soft79
    Keymaster

    We don’t have the Smart Coupons plugin ourselves, but I remember that that plugin had some filters to allow the support of extra fields. Please contact the author for more info.

    Our plugin is compatible with the default import/export of WooCommerce though.

    #16501

    How is it compatible? The fields aren’t coming out when I export them

    #16503
    Soft79
    Keymaster

    I mean the Tools > Export function, but this exports to xml, not csv.

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.