/** * Purchase Link Shortcode * * Retrieves a download and displays the purchase form. * * @since 1.0 * @param array $atts Shortcode attributes * @param string $content * @return string Fully formatted purchase link */ function edd_download_shortcode($atts, $content = null) { global $post; $post_id = is_object($post) ? $post->ID : 0; $atts = shortcode_atts(array('id' => $post_id, 'price_id' => isset($atts['price_id']) ? $atts['price_id'] : false, 'sku' => '', 'price' => '1', 'direct' => '0', 'text' => '', 'style' => edd_get_option('button_style', 'button'), 'color' => edd_get_option('checkout_color', 'blue'), 'class' => 'edd-submit', 'form_id' => ''), $atts, 'purchase_link'); // Override text only if not provided / empty if (!$atts['text']) { if ($atts['direct'] == '1' || $atts['direct'] == 'true') { $atts['text'] = edd_get_option('buy_now_text', __('Buy Now', 'easy-digital-downloads')); } else { $atts['text'] = edd_get_option('add_to_cart_text', __('Purchase', 'easy-digital-downloads')); } } // Override color if color == inherit if (isset($atts['color'])) { $atts['color'] = $atts['color'] == 'inherit' ? '' : $atts['color']; } if (!empty($atts['sku'])) { $download = edd_get_download_by('sku', $atts['sku']); $atts['download_id'] = $download->ID; } elseif (isset($atts['id'])) { // Edd_get_purchase_link() expects the ID to be download_id since v1.3 $atts['download_id'] = $atts['id']; $download = edd_get_download($atts['download_id']); } if ($download) { return edd_get_purchase_link($atts); } }
/** * Purchase Link Shortcode * * Retrieves a download and displays the purchase form. * * @access private * @since 1.0 * @return string */ function edd_download_shortcode($atts, $content = null) { extract(shortcode_atts(array('id' => '', 'text' => __('Purchase', 'edd'), 'style' => 'button', 'color' => 'blue', 'class' => ''), $atts)); $download = edd_get_download($id); if ($download) { return edd_get_purchase_link($download->ID, $text, $style, $color, $class); } }
/** * Purchase Link Shortcode * * Retrieves a download and displays the purchase form. * * @since 1.0 * @param array $atts Shortcode attributes * @param string $content * @return string Fully formatted purchase link */ function edd_download_shortcode($atts, $content = null) { global $post, $edd_options; extract(shortcode_atts(array('id' => $post->ID, 'price' => '1', 'text' => isset($edd_options['add_to_cart_text']) && $edd_options['add_to_cart_text'] != '' ? $edd_options['add_to_cart_text'] : __('Purchase', 'edd'), 'style' => isset($edd_options['button_style']) ? $edd_options['button_style'] : 'button', 'color' => isset($edd_options['checkout_color']) ? $edd_options['checkout_color'] : 'blue', 'class' => 'edd-submit'), $atts)); // Edd_get_purchase_link() expects the ID to be download_id since v1.3 $atts['download_id'] = $atts['id']; $download = edd_get_download($atts['download_id']); if ($download) { return edd_get_purchase_link($atts); } }
/** * Purchase Link Shortcode * * Retrieves a download and displays the purchase form. * * @since 1.0 * @param array $atts Shortcode attributes * @param string $content * @return string Fully formatted purchase link */ function edd_download_shortcode($atts, $content = null) { global $post, $edd_options; $post_id = is_object($post) ? $post->ID : 0; $atts = shortcode_atts(array('id' => $post_id, 'sku' => '', 'price' => '1', 'direct' => '0', 'text' => isset($edd_options['add_to_cart_text']) && $edd_options['add_to_cart_text'] != '' ? $edd_options['add_to_cart_text'] : __('Purchase', 'edd'), 'style' => isset($edd_options['button_style']) ? $edd_options['button_style'] : 'button', 'color' => isset($edd_options['checkout_color']) ? $edd_options['checkout_color'] : 'blue', 'class' => 'edd-submit', 'form_id' => ''), $atts, 'purchase_link'); // Override color if color == inherit if (isset($atts['color'])) { $atts['color'] = $atts['color'] == 'inherit' ? '' : $atts['color']; } if (isset($atts['id'])) { // Edd_get_purchase_link() expects the ID to be download_id since v1.3 $atts['download_id'] = $atts['id']; $download = edd_get_download($atts['download_id']); } elseif (isset($atts['sku'])) { $download = edd_get_download_by('sku', $atts['sku']); $atts['download_id'] = $download->ID; } if ($download) { return edd_get_purchase_link($atts); } }
function sf_campaign_sidebar() { global $post; $campaign = new ATCF_Campaign($post->ID); $download_id = $post->ID; $prices = edd_get_variable_prices($download_id); $type = edd_single_price_option_mode($download_id) ? 'checkbox' : 'radio'; $extra_class = ""; if ($campaign->is_donations_only()) { $extra_class = 'project-donate-only'; } ?> <div id="back-this-project" class="campaign-sidebar <?php echo esc_attr($extra_class); ?> col-sm-4"> <?php if ($campaign->is_active()) { if ($campaign->is_donations_only()) { echo '<p class="donate-only">' . __('This project is donation only, and you can donate using the button below.', 'swiftframework') . '</p>'; echo edd_get_purchase_link(array('download_id' => $post->ID, 'class' => 'accent sf-button contribute-now', 'price' => false, 'text' => __('Donate Now', 'swiftframework'))); } else { echo edd_get_purchase_link(array('download_id' => $post->ID, 'class' => 'accent sf-button contribute-now', 'price' => false, 'text' => __('Contribute Now', 'swiftframework'))); } } else { // Inactive, just show options with no button if ($campaign->is_donations_only()) { echo '<p class="project-ended">' . __('This project has ended.', 'swiftframework') . '</p>'; } else { atcf_campaign_contribute_options($prices, $type, $download_id); } } ?> </div> <?php }
$cart = edd_get_payment_meta_cart_details($post->ID, true); //print_r($cart); exit; $cart_total_products = array(); $cart_total_amount = 0; if (is_array($cart) && !empty($cart)) { foreach ($cart as $cart_product) { $cart_total_products[] = $cart_product['name']; $cart_total_amount += $cart_product['price']; } } $css_expired = ''; $expired_content = ''; if ('expired' == edd_software_licensing()->get_license_status($licenses[0]->ID)) { $css_expired = '_expired'; $post_meta = get_post_meta($licenses[0]->ID, '_edd_sl_download_id', true); $expired_content = __(' - Expired', 'edd_downloads') . " " . edd_get_purchase_link(array('download_id' => $post_meta)); } ?> <tr class="edd_purchase_row"> <?php do_action('edd_purchase_history_row_start', $post->ID, $purchase_data); ?> <td class="edd_purchase_id">#<?php echo edd_get_payment_number($post->ID); ?> </td> <td class="edd_purchase_product<?php
/** * Download Purchase Link * * @since Marketify 1.0 * * @return void */ function marketify_purchase_link($download_id = null) { global $post, $edd_options; if (!$download_id) { $download_id = $post->ID; } $variable = edd_has_variable_prices($download_id); if (!$variable) { echo edd_get_purchase_link(array('download_id' => $download_id, 'price' => false)); } else { $button = !empty($edd_options['add_to_cart_text']) ? $edd_options['add_to_cart_text'] : __('Purchase', 'marketify'); printf('<a href="#buy-now-%s" class="button buy-now popup-trigger">%s</a>', $post->ID, $button); } }
/** * Append Purchase Link * * Automatically appends the purchase link to download content, if enabled. * * @since 1.0 * @param int $download_id Download ID * @return void */ function edd_append_purchase_link($download_id) { if (!get_post_meta($download_id, '_edd_hide_purchase_link', true)) { echo edd_get_purchase_link(array('download_id' => $download_id)); } }
/** @see WP_Widget::widget */ public function widget($args, $instance) { $args['id'] = isset($args['id']) ? $args['id'] : 'edd_download_details_widget'; if (!empty($instance['download_id'])) { if ('current' === $instance['download_id']) { $instance['display_type'] = 'current'; unset($instance['download_id']); } elseif (is_numeric($instance['download_id'])) { $instance['display_type'] = 'specific'; } } if (!isset($instance['display_type']) || 'specific' === $instance['display_type'] && !isset($instance['download_id']) || 'current' == $instance['display_type'] && !is_singular('download')) { return; } // set correct download ID. if ('current' == $instance['display_type'] && is_singular('download')) { $download_id = get_the_ID(); } else { $download_id = absint($instance['download_id']); } // Since we can take a typed in value, make sure it's a download we're looking for $download = get_post($download_id); if (!is_object($download) || 'download' !== $download->post_type) { return; } // Variables from widget settings. $title = apply_filters('widget_title', $instance['title'], $instance, $args['id']); $download_title = $instance['download_title'] ? apply_filters('edd_product_details_widget_download_title', '<h3>' . get_the_title($download_id) . '</h3>', $download_id) : ''; $purchase_button = $instance['purchase_button'] ? apply_filters('edd_product_details_widget_purchase_button', edd_get_purchase_link(array('download_id' => $download_id)), $download_id) : ''; $categories = $instance['categories'] ? $instance['categories'] : ''; $tags = $instance['tags'] ? $instance['tags'] : ''; // Used by themes. Opens the widget. echo $args['before_widget']; // Display the widget title. if ($title) { echo $args['before_title'] . $title . $args['after_title']; } do_action('edd_product_details_widget_before_title', $instance, $download_id); // download title. echo $download_title; do_action('edd_product_details_widget_before_purchase_button', $instance, $download_id); // purchase button. echo $purchase_button; // categories and tags. $category_list = $categories ? get_the_term_list($download_id, 'download_category', '', ', ') : ''; $category_count = count(get_the_terms($download_id, 'download_category')); $category_labels = edd_get_taxonomy_labels('download_category'); $category_label = $category_count > 1 ? $category_labels['name'] : $category_labels['singular_name']; $tag_list = $tags ? get_the_term_list($download_id, 'download_tag', '', ', ') : ''; $tag_count = count(get_the_terms($download_id, 'download_tag')); $tag_taxonomy = edd_get_taxonomy_labels('download_tag'); $tag_label = $tag_count > 1 ? $tag_taxonomy['name'] : $tag_taxonomy['singular_name']; $text = ''; if ($category_list || $tag_list) { $text .= '<p class="edd-meta">'; if ($category_list) { $text .= '<span class="categories">%1$s: %2$s</span><br/>'; } if ($tag_list) { $text .= '<span class="tags">%3$s: %4$s</span>'; } $text .= '</p>'; } do_action('edd_product_details_widget_before_categories_and_tags', $instance, $download_id); printf($text, $category_label, $category_list, $tag_label, $tag_list); do_action('edd_product_details_widget_before_end', $instance, $download_id); // Used by themes. Closes the widget. echo $args['after_widget']; }
/** @see WP_Widget::widget */ public function widget($args, $instance) { $args['id'] = isset($args['id']) ? $args['id'] : 'edd_download_details_widget'; if (!isset($instance['download_id']) || 'current' == $instance['download_id'] && !is_singular('download')) { return; } // set correct download ID. if ('current' == $instance['download_id'] && is_singular('download')) { $download_id = get_the_ID(); } else { $download_id = absint($instance['download_id']); } // Variables from widget settings. $title = apply_filters('widget_title', $instance['title'], $instance, $args['id']); $download_title = $instance['download_title'] ? apply_filters('edd_product_details_widget_download_title', '<h3>' . get_the_title($download_id) . '</h3>', $download_id) : ''; $purchase_button = $instance['purchase_button'] ? apply_filters('edd_product_details_widget_purchase_button', edd_get_purchase_link(array('download_id' => $download_id)), $download_id) : ''; $categories = $instance['categories'] ? $instance['categories'] : ''; $tags = $instance['tags'] ? $instance['tags'] : ''; $image = $instance['image'] ? $instance['image'] : ''; // Used by themes. Opens the widget. echo $args['before_widget']; // Display the widget title. if ($title) { echo $args['before_title'] . $title . $args['after_title']; } do_action('edd_product_details_widget_before_title', $instance, $download_id); // download title. echo $download_title; $feat_image = wp_get_attachment_url(get_post_thumbnail_id($download_id)); if ($image) { echo '<p><img src="' . $feat_image . '" alt="' . get_the_title($download_id) . '" /></p>'; } do_action('edd_product_details_widget_before_purchase_button', $instance, $download_id); // purchase button. echo $purchase_button; // categories and tags. $category_list = $categories ? get_the_term_list($download_id, 'download_category', '', ', ') : ''; $category_count = count(get_the_terms($download_id, 'download_category')); $category_labels = edd_get_taxonomy_labels('download_category'); $category_label = $category_count > 1 ? $category_labels['name'] : $category_labels['singular_name']; $tag_list = $tags ? get_the_term_list($download_id, 'download_tag', '', ', ') : ''; $tag_count = count(get_the_terms($download_id, 'download_tag')); $tag_taxonomy = edd_get_taxonomy_labels('download_tag'); $tag_label = $tag_count > 1 ? $tag_taxonomy['name'] : $tag_taxonomy['singular_name']; $text = ''; if ($category_list || $tag_list) { $text .= '<p class="edd-meta">'; if ($category_list) { $text .= '<span class="categories">%1$s: %2$s</span><br/>'; } if ($tag_list) { $text .= '<span class="tags">%3$s: %4$s</span>'; } $text .= '</p>'; } do_action('edd_product_details_widget_before_categories_and_tags', $instance, $download_id); printf($text, $category_label, $category_list, $tag_label, $tag_list); do_action('edd_product_details_widget_before_end', $instance, $download_id); // Used by themes. Closes the widget. echo $args['after_widget']; }
function edd_rp_render_shortcode($attributes, $content = null) { global $post; extract(shortcode_atts(array('ids' => $post->id, 'user' => 'false', 'count' => 3, 'title' => __('Recommended Products', EDD_RP_TEXT_DOMAIN)), $attributes, 'recommended_products')); $ids = str_replace(' ', '', $ids); $ids = explode(',', $ids); $count = absint($count); $user_id = $user == 'true' ? get_current_user_id() : false; $suggestions = edd_rp_get_multi_suggestions($ids, $user_id, $count); if (is_array($suggestions) && !empty($suggestions)) { $suggestions = array_keys($suggestions); $suggested_downloads = new WP_Query(array('post__in' => $suggestions, 'post_type' => 'download')); if ($suggested_downloads->have_posts()) { ?> <div id="edd-rp-single-wrapper"> <h5 id="edd-rp-single-header"><?php echo $title; ?> </h5> <div id="edd-rp-items-wrapper" class="edd-rp-single"> <?php while ($suggested_downloads->have_posts()) { ?> <?php $suggested_downloads->the_post(); ?> <div class="edd-rp-item <?php echo !current_theme_supports('post-thumbnails') ? 'edd-rp-nothumb' : ''; ?> "> <a href="<?php the_permalink(); ?> "> <?php the_title(); ?> <?php if (current_theme_supports('post-thumbnails') && has_post_thumbnail(get_the_ID())) { ?> <div class="edd_cart_item_image"> <?php echo get_the_post_thumbnail(get_the_ID(), apply_filters('edd_checkout_image_size', array(125, 125))); ?> </div> <?php } else { ?> <br /> <?php } ?> </a> <?php if (!edd_has_variable_prices(get_the_ID())) { ?> <?php edd_price(get_the_ID()); ?> <?php } ?> <?php echo edd_get_purchase_link(array('download_id' => get_the_ID(), 'price' => false, 'direct' => false)); ?> </div> <?php } ?> </div> </div> <?php } ?> <?php wp_reset_postdata(); ?> <?php } }
</div> </div> <?php } ?> <div class="bd"> <h2 class="tight"> <a href="<?php the_permalink(); ?> "><?php the_title(); ?> »</a> </h2> <?php the_excerpt(); ?> <?php if (post_meta('download_id')) { ?> <?php echo edd_get_purchase_link(array('download_id' => post_meta('download_id'), 'text' => __('Order this Course now', 'yoastcom') . ' »')); ?> <?php } ?> </div> </div> <?php
?> </a> <?php } ?> <div class="bd"> <h2 class="tight"> <a href="<?php the_permalink(); ?> "><?php the_title(); ?> »</a> </h2> <?php the_excerpt(); ?> <?php if (post_meta('download_id')) { ?> <?php echo edd_get_purchase_link(array('download_id' => post_meta('download_id'), 'text' => __('Buy this ebook now', 'yoastcom') . ' »')); ?> <?php } ?> </div> </div> <?php
<div class="edd_download_buy_button"> <?php echo edd_get_purchase_link(get_the_ID()); ?> </div>
/** * Display Cross-sell/Upsell products * * @since 1.0 */ function edd_csau_html($columns = '3') { global $post, $edd_options; // upsell products for the single download page if (is_singular('download')) { $products = edd_csau_get_products(get_the_ID(), 'upsell'); } elseif (edd_is_checkout()) { // get contents on the cart $cart_items = edd_get_cart_contents(); // return if there's nothing in the cart if (!$cart_items) { return; } $cart = array(); // create new products array with the cart items cross sell products if ($cart_items) { foreach ($cart_items as $cart_item) { $download_id = $cart_item['id']; // create $cart array with IDs $cart[] = (int) $cart_item['id']; // create $product_list array with cross sell products $product_list[] = get_post_meta($download_id, '_edd_csau_cross_sell_products', false); } } $products = $product_list; // clean the array $products = array_filter($products); // return if no cross sell products after clean if (!$products) { return; } // merge into single level array $products = call_user_func_array('array_merge', $products); // remove duplicate IDs $products = array_unique($products); } else { return; } if ($products) { ?> <?php if (edd_is_checkout()) { $posts_per_page = isset($edd_options['edd_csau_cross_sell_number']) && !empty($edd_options['edd_csau_cross_sell_number']) ? $edd_options['edd_csau_cross_sell_number'] : '3'; } elseif (is_singular('download')) { $posts_per_page = isset($edd_options['edd_csau_upsell_number']) && !empty($edd_options['edd_csau_upsell_number']) ? $edd_options['edd_csau_upsell_number'] : '3'; } $query = array('post_type' => 'download', 'posts_per_page' => $posts_per_page, 'orderby' => 'date', 'order' => 'DESC', 'post__in' => $products); $query = apply_filters('edd_csau_query', $query); $downloads = new WP_Query($query); if ($downloads->have_posts()) { // upsell heading if (is_singular('download')) { $upsell_heading = get_post_meta(get_the_ID(), '_edd_csau_upsell_heading', true); // show singular heading if ($upsell_heading) { $heading = esc_attr($upsell_heading); } elseif (isset($edd_options['edd_csau_upsell_heading'])) { $heading = esc_attr($edd_options['edd_csau_upsell_heading']); } else { $heading = __('You may also like', 'edd-csau'); } } elseif (edd_is_checkout()) { $ids = edd_csau_get_cart_trigger_ids(); if (count($ids) == 1) { $heading = esc_attr(get_post_meta($ids[0], '_edd_csau_cross_sell_heading', true)); } elseif (isset($edd_options['edd_csau_cross_sell_heading'])) { $heading = esc_attr($edd_options['edd_csau_cross_sell_heading']); } else { $heading = __('You may also like', 'edd-csau'); } } // end is_checkout $i = 1; global $wp_query; //$download_count = $downloads->found_posts > 3 ? 3 : $downloads->found_posts; $classes = array(); $classes = apply_filters('edd_csau_classes', $classes); // default classes $classes[] = 'edd-csau-products'; // columns if ($columns) { $classes[] = 'col-' . $columns; } // filter array and remove empty values $classes = array_filter($classes); $classes = !empty($classes) ? implode(' ', $classes) : ''; $class_list = !empty($classes) ? 'class="' . $classes . '"' : ''; ob_start(); ?> <div <?php echo $class_list; ?> > <h2><?php echo esc_attr($heading); ?> </h2> <?php while ($downloads->have_posts()) { $downloads->the_post(); ?> <div itemscope itemtype="http://schema.org/Product" class="<?php echo apply_filters('edd_download_class', 'edd_download', '', ''); ?> " id="edd_download_<?php echo get_the_ID(); ?> "> <div class="edd_download_inner"> <?php do_action('edd_csau_download_before'); $show_excerpt = apply_filters('edd_csau_show_excerpt', true); $show_price = apply_filters('edd_csau_show_price', true); $show_button = apply_filters('edd_csau_upsell_show_button', true); edd_get_template_part('shortcode', 'content-image'); edd_get_template_part('shortcode', 'content-title'); if ($show_price) { edd_get_template_part('shortcode', 'content-price'); } if ($show_excerpt) { edd_get_template_part('shortcode', 'content-excerpt'); } // if the download is not in the cart, show the add to cart button if (edd_is_checkout()) { if (!edd_item_in_cart(get_the_ID())) { $text = apply_filters('edd_csau_cross_sell_add_to_cart_text', __('Add to cart', 'edd-csau')); $price = apply_filters('edd_csau_cross_sell_show_button_price', false); if ($show_button) { ?> <div class="edd_download_buy_button"> <?php echo edd_get_purchase_link(array('download_id' => get_the_ID(), 'text' => $text, 'price' => $price)); ?> </div> <?php } ?> <?php } else { echo apply_filters('edd_csau_added_to_cart_text', '<span class="edd-cart-added-alert"><i class="edd-icon-ok"></i> ' . __('Added to cart', 'edd-csau') . '</span>'); } } else { $text = apply_filters('edd_csau_upsell_add_to_cart_text', __('Add to cart', 'edd-csau')); $price = apply_filters('edd_csau_upsell_show_button_price', false); $show_button = apply_filters('edd_csau_upsell_show_button', true); if ($show_button) { ?> <div class="edd_download_buy_button"> <?php echo edd_get_purchase_link(array('download_id' => get_the_ID(), 'text' => $text, 'price' => $price)); ?> </div> <?php } ?> <?php } do_action('edd_csau_download_after'); ?> </div> </div> <?php if ($columns && $i % $columns == 0) { ?> <div style="clear:both;"></div><?php } ?> <?php $i++; } ?> <?php wp_reset_postdata(); ?> </div> <?php $html = ob_get_clean(); return apply_filters('edd_csau_html', $html, $downloads, $heading, $columns, $class_list); } ?> <?php } ?> <?php }
<div class="edd_download_buy_button"> <?php echo edd_get_purchase_link(array('id' => get_the_ID())); ?> </div>
<?php /** * */ global $post; ?> <div id="buy-now-<?php the_ID(); ?> " class="popup"> <h1 class="section-title"><span><?php _e('Buying Options', 'marketify'); ?> </span></h1> <?php echo edd_get_purchase_link(array('download_id' => $post->ID)); ?> </div>
function edd_downloads_show_upgrade_products($product, $license_id, $hide_id, $payment_id) { global $wpdb, $edd_displayed_form_ids; if (is_user_logged_in()) { $user_id = get_current_user_id(); } else { return false; } if (!edd_downloads_has_user_purchased(get_current_user_id(), $product['id'])) { return false; } $products = $wpdb->get_results($wpdb->prepare("\tSELECT \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpost_id \n\t\t\t\t\t\t\t\t\t\t\t\t\t\tFROM \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t" . $wpdb->prefix . "postmeta as pm RIGHT JOIN " . $wpdb->prefix . "posts as p ON (pm.post_id = p.ID)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tWHERE \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tp.post_status = 'publish' AND\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpm.meta_key = 'edd_product_family' AND \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpm.meta_value = (\tSELECT \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tmeta_value \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tFROM \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t" . $wpdb->prefix . "postmeta \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tWHERE \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tmeta_key = 'edd_product_family' AND \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpost_id = %d AND \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tmeta_value > '0'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t ) AND \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpm.post_id != %d AND\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpm.post_id IN ( SELECT \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpost_id\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tFROM \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t" . $wpdb->prefix . "postmeta \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tWHERE \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tmeta_key = 'edd_price' AND \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tmeta_value > %f\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t)", $product['id'], $product['id'], $product['item_price'])); if (!empty($products)) { global $edd_options; unset($edd_options['payment_id']); ?> <div class="edd_purchase_submit_wrapper"> <?php //echo _e( 'Upgrade ' . $product['name'] . ' to:','edd_downloads' ); ?> <select name="edd_downloads_upgrade_product" id="edd_downloads_upgrade_product" onChange="javascript:edd_downloads_show_button(this.value,<?php echo $hide_id; ?> ,<?php echo $license_id; ?> ,<?php echo $product['id']; ?> );"> <option value="" selected><?php echo _e('Upgrade to:', 'edd_downloads'); ?> </option> <?php $cart_link = array(); //$currency_symbol = edd_currency_symbol(edd_get_currency()); foreach ($products as $product_row) { $product_details = get_post($product_row->post_id); $product_price = get_post_meta($product_row->post_id, 'edd_price', true); $upgrade_price = $product_price - $product['item_price']; echo '<option value="' . $product_details->ID . '">' . $product_details->post_title . ' ' . __('- Add', 'edd_downloads') . ' ' . edd_currency_filter(edd_format_amount($upgrade_price)) . '</option>'; $edd_displayed_form_ids = array(); $cart_link[$product_details->ID] = edd_get_purchase_link(array('download_id' => $product_details->ID, 'form_id' => 'edd_purchase_' . $product_details->ID . '_' . $hide_id, 'payment_id' => $payment_id, 'price' => false)); } ?> </select> </div> <div id='upgrade_button_<?php echo $hide_id; ?> '> <?php foreach ($cart_link as $cart_link) { echo $cart_link; } ?> </div> <?php } }
the_post_thumbnail('helium_portfolio_thumb', array('itemprop' => 'image')); ?> </span> <?php } ?> </figure> <?php } ?> <div class="edd-download-info-wrap"> <div class="edd-download-actions"> <?php if (!edd_has_variable_prices(get_the_ID())) { echo edd_get_purchase_link(array('price' => false, 'style' => '', 'class' => '', 'color' => '')); } else { ?> <a href="<?php the_permalink(); ?> " title="<?php the_title_attribute(); ?> " class="edd-download-view-details" itemprop="url"> <i class="fa fa-external-link"></i> <?php esc_html_e('Details', 'helium'); ?> </a> <?php
<div class="product-meta content"> <?php if (!edd_has_variable_prices($post->ID)) { ?> <h4 class="single-product-price"><?php edd_price($post->ID); ?> </h4> <?php } ?> <?php echo edd_get_purchase_link($post->ID, 'Add to Cart', 'button', 'blue'); ?> <div class="product-categories"> <?php the_terms($post->ID, 'download_category', '<span class="product-categories-title">Categories:</span> ', ', ', ''); ?> </div><!--end product-categories--> <div class="product-tags"> <?php the_terms($post->ID, 'download_tag', '<span class="product-tags-title">Tags:</span> ', ', ', ''); ?> </div><!--end .product-tags--> </div><!--end .product-meta-->
</span></h1> <p class="row-desc"><?php thds_theme_excerpt(); ?> </p> <p class="theme-meta"> <a class="theme-demo button" href="<?php echo esc_url(thds_get_theme_demo_url()); ?> ">Demo</a> <?php $eddid = get_post_meta(get_the_ID(), 'edd_download_id', true); if ($eddid) { echo edd_get_purchase_link(array('download_id' => $eddid, 'class' => 'theme-download button', 'style' => 'button', 'direct' => true)); } else { ?> <a class="theme-download button" href="<?php echo esc_url(thds_get_theme_download_url()); ?> " itemprop="downloadURL">Download</a> <?php } ?> </p> </div> </div> </div>
<br /> <?php } ?> </a> <?php if (!edd_has_variable_prices(get_the_ID())) { ?> <?php edd_price(get_the_ID()); ?> <?php } ?> <?php echo edd_get_purchase_link(array('download_id' => get_the_ID(), 'price' => false, 'direct' => false)); ?> </div> <?php } ?> </div> </div> <?php } ?> <?php wp_reset_postdata(); ?>
} ?> </div><!--end .product-price--> <?php } ?> </div> <?php if (function_exists('edd_price')) { ?> <div class="product-buttons"> <?php if (!edd_has_variable_prices(get_the_ID())) { ?> <?php echo edd_get_purchase_link(get_the_ID(), 'Add to Cart', 'button'); ?> <?php } ?> <a href="<?php the_permalink(); ?> ">View Details</a> </div><!--end .product-buttons--> <?php } ?> </div><!--end .product--> <?php $i += 1;
if ('expired' == edd_software_licensing()->get_license_status($bundle_license->ID)) { ?> <div class="edd_purchase_submit_wrapper"> <?php if (!isset($edd_options['expired'])) { $edd_options['expired'] = array(); $edd_options['expired'][$payment_id] = $bundle_item; $edd_options['payment_id'] = $payment_id; } else { $edd_options['expired'][$payment_id] = $bundle_item; $edd_options['payment_id'] = $payment_id; } $edd_options[$bundle_item] = array('download_id' => $post_meta, 'payment_id' => $payment_id); echo edd_get_purchase_link(array('download_id' => $bundle_item, 'payment_id' => $payment_id)); echo _e('Product ' . get_the_title($bundle_item) . ' expired ', 'edd_downloads'); ?> </div> <br class="clear" /> <?php } edd_downloads_show_upgrade_products($cart_item, $bundle_license->ID, $payment_id . $cart_row . $bundle_item, $payment_id); ?> <script type="text/javascript">edd_downloads_hide_all_buttons(<?php echo $payment_id . $cart_row . $bundle_item; ?>
the_permalink(); ?> "><?php the_title_attribute(); ?> </a></h3> <div class="edd_download_excerpt" itemprop="description"> <p><?php kama_excerpt('maxchar=120'); ?> </p> </div> </div> <div class="edd_download_buy_button"> <?php echo edd_get_purchase_link(array('download_id' => get_the_ID())); ?> </div> </div> </div> <div class="clearfix"></div> <?php } ?> <?php } ?> </div> <div class="pagination">
</div> </div> <div id="product_pricing"> <?php $button_text = get_post_meta($post->ID, '_edd_purchase_text', true) ? get_post_meta($post->ID, '_edd_purchase_text', true) : __('Add To Cart', 'designcrumbs'); $style = get_post_meta($post->ID, '_edd_purchase_style', true) ? get_post_meta($post->ID, '_edd_purchase_style', true) : 'button'; $color = get_post_meta($post->ID, '_edd_purchase_color', true); if ($color) { $color = str_replace(' ', '_', $color); } ?> <?php echo edd_get_purchase_link(array('text' => $button_text)); ?> </div> <?php echo dcs_star_ratings(); ?> <?php echo dcs_exif_data(); ?> <div id="product_meta_wrap"> <?php if (get_the_term_list($post->ID, 'download_category') != '') {
/** @see WP_Widget::widget */ public function widget($args, $instance) { if (!isset($args['id'])) { $args['id'] = 'edd_download_details_widget'; } if ('current' == $instance['download_id'] && !is_singular('download')) { return; } // set correct download ID if ('current' == $instance['download_id'] && is_singular('download')) { $download_id = get_the_ID(); } else { $download_id = absint($instance['download_id']); } // Variables from widget settings $title = apply_filters('widget_title', $instance['title'], $instance, $args['id']); $download_title = $instance['download_title'] ? apply_filters('edd_product_details_widget_download_title', '<h3>' . get_the_title($download_id) . '</h3>', $download_id) : ''; $purchase_button = $instance['purchase_button'] ? apply_filters('edd_product_details_widget_purchase_button', edd_get_purchase_link(array('download_id' => $download_id)), $download_id) : ''; $categories = $instance['categories'] ? $instance['categories'] : ''; $tags = $instance['tags'] ? $instance['tags'] : ''; // Used by themes. Opens the widget echo $args['before_widget']; // Display the widget title if ($title) { echo $args['before_title'] . $title . $args['after_title']; } do_action('edd_product_details_widget_before_title', $instance, $download_id); // download title echo $download_title; do_action('edd_product_details_widget_before_purchase_button', $instance, $download_id); // purchase button echo $purchase_button; // categories and tags $category_list = $categories ? get_the_term_list($download_id, 'download_category', '', ', ') : ''; $tag_list = $tags ? get_the_term_list($download_id, 'download_tag', '', ', ') : ''; $text = ''; if ($category_list || $tag_list) { $text .= '<p class="edd-meta">'; if ($category_list) { $text .= '<span class="categories">' . __('Categories: %1$s', 'edd') . '</span><br/>'; } if ($tag_list) { $text .= '<span class="tags">' . __('Tags: %2$s', 'edd') . '</span>'; } $text .= '</p>'; } do_action('edd_product_details_widget_before_categories_and_tags', $instance, $download_id); printf($text, $category_list, $tag_list); do_action('edd_product_details_widget_before_end', $instance, $download_id); // Used by themes. Closes the widget echo $args['after_widget']; }
</a></h2> <h3 class="h2 tight color-academy--tertiary"><a href="<?php echo $url; ?> "><?php echo implode(' & ', array_map('esc_html', wp_list_pluck($products, 'post_title'))); ?> </a></h3> <?php the_content(); ?> <?php if (post_meta('savings')) { ?> <div class="more__save more__save--alone color-cta"> <?php printf(__('Save %s', 'yoastcom'), '<span>' . str_replace(' ', '', edd_currency_filter(post_meta('savings')))) . '</span>'; ?> </div> <?php } ?> <?php echo edd_get_purchase_link(array('class' => 'button default', 'text' => __('Buy this bundle now', 'yoastcom') . ' »')); ?> </div> </div> <?php
" class="item-download pull-right"> <i class="icon-arrow-down text-white"></i> </a> <?php } ?> <?php if (show_purchase($post->ID)) { ?> <div class="inline"> <?php $text = ''; if (edd_has_variable_prices($post->ID)) { $text = edd_price_range($post->ID); } echo edd_get_purchase_link(array('download_id' => $post->ID, 'style' => 'btn btn-xs ' . get_theme_mod('btn-bg-color'), 'text' => $text)); ?> </div> <?php } ?> </div> </div> <a href="<?php the_permalink(); ?> " data-pjax title="<?php the_title_attribute(); ?> ">
</div> </div> <div class="col-lg-3 entry-sidebar"> <ul class="entry-details plain-list"> <li> <span class="entry-detail-value edd-download-link-box"> <?php if (!edd_has_variable_prices(get_the_ID())) { echo '<span class="edd-download-price" itemprop="price">'; edd_price(get_the_ID()); echo '</span>'; } echo edd_get_purchase_link(array('price' => false)); ?> </span> </li> <?php if (Youxi()->option->get('edd_show_categories')) { ?> <li> <h5 class="entry-detail-label"><?php esc_html_e('Categories', 'helium'); ?> </h5> <span class="entry-detail-value"><?php echo get_the_term_list(get_the_ID(), 'download_category', '', ', '); ?>