This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| function woo_vou_add_role_as_voucher_vendor( $roles = array() ) { | |
| $roles[] = 'wc_vendor'; | |
| return $roles; | |
| } | |
| add_filter( 'woo_vou_edit_vendor_role', 'woo_vou_add_role_as_voucher_vendor' ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // You can modify / remove following fields using the filter | |
| // buyername, code_prefix, order_id, data_id, $item_id | |
| // $voucher_codes = array( 'buyername' => $buyername, 'code_prefix' => $code_prefix, 'order_id' => $order_id, 'data_id' => $data_id, 'item_id' => $item_id, 'separator' => '-' ); | |
| function woo_vou_unlimited_code_pattern_modification( $voucodes_args = array() ) { | |
| if( $voucodes_args['buyername'] ) {// if you want to remove buyername from pattern | |
| unset( $voucodes_args['buyername'] ); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // For Modify Existing PDF size and font size | |
| function woo_vou_modify_existing_pdf_sizes( $pdf_sizes = array() ) { | |
| //modify a4 pdf width | |
| $pdf_sizes['A4']['width'] = 500; | |
| //modify a4 pdf height | |
| $pdf_sizes['A4']['height'] = 500; | |
| //modify a4 pdf font size |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| function woo_vou_pdf_modify_generate_fonts( $pdf_font ) { | |
| // by default the font type is "helvetica" | |
| $pdf_font = 'freeserif'; | |
| return $pdf_font; | |
| } | |
| add_filter( 'woo_vou_pdf_generate_fonts', 'woo_vou_pdf_modify_generate_fonts' ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| function wpw_auto_poster_checked_social_publishbox( $publish_arr ) { | |
| // Social network title for which you want to remain ticked the 'Publish Post On' checked box | |
| $publish_arr = array( | |
| 'facebook', | |
| 'twitter', | |
| 'linkedin', | |
| 'tumblr', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| function woo_cl_redirect_to_my_account( $redirect_url = '' ) { | |
| // my account page URL | |
| $redirect_url = get_permalink( get_option('woocommerce_myaccount_page_id') ); | |
| return $redirect_url; | |
| } | |
| add_filter( 'woo_cl_redirect_link_for_non_login_user', 'woo_cl_redirect_to_my_account' ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * Adding Custom shortcode value in PDF voucher | |
| */ | |
| function woo_vou_pdf_template_replace_shortcodes( $voucher_template_html, $orderid, $item_key, $items, $voucodes, $productid ) { | |
| // replace {your_shortcode} with actual value | |
| $voucher_template_html = str_replace( '{your_shortcode}', $your_shortcode_value, $voucher_template_html ); | |
| return $voucher_template_html; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * Function to allow sellers to get points even if they are the owner of the product | |
| * | |
| * @param array $roles | |
| * @return $roles | |
| */ | |
| function edd_points_restrict_seller_roles( $roles ) { | |
| $roles[] = 'administrator'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * | |
| * You can add or remove tab using this filter | |
| */ | |
| add_filter( 'woo_vou_admin_voucher_code_tabs', 'woo_vou_admin_voucher_code_custom_tabs' ); | |
| function woo_vou_admin_voucher_code_custom_tabs( $voucher_code_tabs ) { | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| function disable_auto_enable_variations_download( $auto_enable ) { | |
| $auto_enable = false; | |
| return $auto_enable; | |
| } | |
| add_filter( 'woo_vou_auto_enable_downloadable_variations', 'disable_auto_enable_variations_download' ) |