editor->is_edit_mode() ) { return; } // Vars $icon_style = get_theme_mod( 'ocean_edd_menu_icon_style', 'drop_down' ); $custom_link = get_theme_mod( 'ocean_edd_menu_icon_custom_link' ); // URL if ( 'custom_link' == $icon_style && $custom_link ) { $url = esc_url( $custom_link ); } else { $url = edd_get_checkout_uri(); } // Cart total $display = get_theme_mod( 'ocean_edd_menu_icon_display', 'icon_count' ); if ( 'icon_total' == $display ) { $cart_extra = '' . edd_currency_filter( edd_format_amount( edd_get_cart_total() ) ) . ''; } elseif ( 'icon_count' == $display ) { $cart_extra = '' . edd_get_cart_quantity() . ''; } elseif ( 'icon_count_total' == $display ) { $cart_extra = '' . edd_get_cart_quantity() . ''; $cart_extra .= '' . edd_currency_filter( edd_format_amount( edd_get_cart_total() ) ) . ''; } else { $cart_extra = ''; } // Get cart icon $icon = get_theme_mod( 'ocean_edd_menu_icon', 'icon_handbag' ); $icon = in_array( $icon, oceanwp_get_cart_icons() ) && $icon ? $icon : 'icon_handbag'; // If has custom cart icon $custom_icon = get_theme_mod( 'ocean_edd_menu_custom_icon' ); if ( '' != $custom_icon ) { $icon = $custom_icon; } if ( '' != $custom_icon ) { $cart_icon = ''; } else { $cart_icon = oceanwp_icon( $icon, false ); } // Cart Icon $cart_icon = apply_filters( 'ocean_menu_cart_icon_html', $cart_icon ); // If bag style if ( 'yes' == get_theme_mod( 'ocean_edd_menu_bag_style', 'no' ) ) { ?> name; ?> '; $output .= '' . esc_html__( 'View Details', 'oceanwp' ) . ''; $output .= ''; } else { $output = edd_get_purchase_link( array( 'price' => false, 'text' => esc_html__( 'Add to Cart', 'oceanwp' ), ) ); } return $output; } } /** * Return div for start of loop */ if ( ! function_exists( 'oceanwp_edd_loop_classes' ) ) { function oceanwp_edd_loop_classes() { $wrap_classes = array(); $wrap_classes[] = 'edd_downloads_list'; $wrap_classes[] = 'oceanwp-row'; // Columns $desktop_columns = get_theme_mod( 'ocean_edd_archive_columns', 3 ); $wrap_classes[] = 'desktop-col'; $wrap_classes[] = 'desktop-' . $desktop_columns . '-col'; $tablet_columns = get_theme_mod( 'ocean_edd_tablet_archive_columns' ); $mobile_columns = get_theme_mod( 'ocean_edd_mobile_archive_columns' ); if ( ! empty( $tablet_columns ) ) { $wrap_classes[] = 'tablet-col'; $wrap_classes[] = 'tablet-' . $tablet_columns . '-col'; } if ( ! empty( $mobile_columns ) ) { $wrap_classes[] = 'mobile-col'; $wrap_classes[] = 'mobile-' . $mobile_columns . '-col'; } $wrap_classes = implode( ' ', $wrap_classes ); return $wrap_classes; } } /** * Remove the purchase button on single download pages */ function oceanwp_remove_edd_purchase_button() { if ( false == get_theme_mod( 'ocean_edd_display_add_to_cart', true ) ) { if ( is_singular( 'download' ) ) { remove_action( 'edd_after_download_content', 'edd_append_purchase_link' ); } } } add_action( 'template_redirect', 'oceanwp_remove_edd_purchase_button' ); /** * Returns correct columns for the EDD archive entries * Used to clear floats * * @since 1.0.4 */ if ( ! function_exists( 'oceanwp_edd_entry_columns' ) ) { function oceanwp_edd_entry_columns() { // Get columns from customizer setting $columns = get_theme_mod( 'ocean_edd_archive_columns', '3' ); // Sanitize $columns = $columns ? $columns : '3'; // Apply filters for child theming $columns = apply_filters( 'oceanwp_edd_entry_columns', $columns ); // Return columns return $columns; } } // Disable EDD Styles add_filter( 'edd_get_option_disable_styles', '__return_true' ); /** * Change EDD Templates Folder * * @since 1.0.4 */ function oceanwp_edd_template_dir() { return 'partials/edd'; } add_filter( 'edd_templates_dir', 'oceanwp_edd_template_dir' ); /** * Remove Price from purchase button in widget * * @since 1.5.15 */ function oceanwp_edd_product_details_purchase_button() { return edd_get_purchase_link( array( 'download_id' => get_the_ID(), 'price' => false, ) ); } add_filter( 'edd_product_details_widget_purchase_button', 'oceanwp_edd_product_details_purchase_button', 10, 1 ); /** * Add Price in widget * * @since 1.5.15 */ function oceanwp_edd_product_details_price() { $output = '
'; if ( ! edd_has_variable_prices( get_the_ID() ) ) : $output .= edd_price( get_the_ID() ); else : $output .= edd_price_range( get_the_ID() ); endif; $output .= '
'; return $output; } add_action( 'edd_product_details_widget_before_purchase_button', 'oceanwp_edd_product_details_price' );