<img src="<?php echo $product_thumb; ?> "> </a> <a href="<?php the_permalink(); ?> "> <p><?php the_title(); ?> </p> </a> <?php if (wpsc_product_is_donation()) { ?> <h4>Donation</h4> <?php } else { ?> <h4><?php wpsc_the_product_price_display(); ?> </h4> <!-- multi currency code --> <?php if (wpsc_product_has_multicurrency()) { ?> <h4><?php echo wpsc_display_product_multicurrency();
/** * Displays products that were bought along with the product defined by $product_id. * This functionality will be deprecated and be provided by a plugin in a future version. */ function wpsc_also_bought($product_id) { global $wpdb; if (get_option('wpsc_also_bought') == 0) { return ''; } // To be made customiseable in a future release $also_bought_limit = 3; $element_widths = 96; $image_display_height = 96; $image_display_width = 96; // Filter will be used by a plugin to provide 'Also Bought' functionality when this is deprecated from core. // Filter is currently private and should not be used by plugin/theme devs as it may only be temporary. $output = apply_filters('_wpsc_also_bought', '', $product_id); if (!empty($output)) { return $output; } // If above filter returns output then the following is ignore and can be deprecated in future. $also_bought = $wpdb->get_results($wpdb->prepare("SELECT `" . $wpdb->posts . "`.* FROM `" . WPSC_TABLE_ALSO_BOUGHT . "`, `" . $wpdb->posts . "` WHERE `selected_product`= %d AND `" . WPSC_TABLE_ALSO_BOUGHT . "`.`associated_product` = `" . $wpdb->posts . "`.`id` AND `" . $wpdb->posts . "`.`post_status` IN('publish','protected') ORDER BY `" . WPSC_TABLE_ALSO_BOUGHT . "`.`quantity` DESC LIMIT {$also_bought_limit}", $product_id), ARRAY_A); if (is_array($also_bought) && count($also_bought) > 0) { $output .= '<h2 class="prodtitles wpsc_also_bought">' . __('People who bought this item also bought', 'wpsc') . '</h2>'; $output .= '<div class="wpsc_also_bought">'; foreach ($also_bought as $also_bought_data) { $output .= '<div class="wpsc_also_bought_item" style="width: ' . $element_widths . 'px;">'; if (get_option('show_thumbnails') == 1) { $image_path = wpsc_the_product_thumbnail($image_display_width, $image_display_height, $also_bought_data['ID']); if ($image_path) { $output .= '<a href="' . esc_attr(get_permalink($also_bought_data['ID'])) . '" class="preview_link" rel="' . esc_attr(sanitize_html_class(get_the_title($also_bought_data['ID']))) . '">'; $output .= '<img src="' . esc_attr($image_path) . '" id="product_image_' . $also_bought_data['ID'] . '" class="product_image" />'; $output .= '</a>'; } else { if (get_option('product_image_width') != '') { $width_and_height = 'width="' . $image_display_height . '" height="' . $image_display_height . '" '; } else { $width_and_height = ''; } $output .= '<img src="' . WPSC_CORE_THEME_URL . '/wpsc-images/noimage.png" title="' . esc_attr(get_the_title($also_bought_data['ID'])) . '" alt="' . esc_attr(get_the_title($also_bought_data['ID'])) . '" id="product_image_' . $also_bought_data['ID'] . '" class="product_image" ' . $width_and_height . '/>'; } } $output .= '<a class="wpsc_product_name" href="' . get_permalink($also_bought_data['ID']) . '">' . get_the_title($also_bought_data['ID']) . '</a>'; if (!wpsc_product_is_donation($also_bought_data['ID'])) { // Ideally use the wpsc_the_product_price_display() function here but needs some tweaking $price = get_product_meta($also_bought_data['ID'], 'price', true); $special_price = get_product_meta($also_bought_data['ID'], 'special_price', true); if (!empty($special_price)) { $output .= '<span style="text-decoration: line-through;">' . wpsc_currency_display($price) . '</span>'; $output .= wpsc_currency_display($special_price); } else { $output .= wpsc_currency_display($price); } } $output .= '</div>'; } $output .= '</div>'; $output .= '<br clear="all" />'; } return $output; }
<?php /** the variation group HTML and loop ends here */?> <!-- THIS IS THE QUANTITY OPTION MUST BE ENABLED FROM ADMIN SETTINGS --> <?php if(wpsc_has_multi_adding()): ?> <fieldset> <label class='wpsc_quantity_update' for='wpsc_quantity_update[<?php echo wpsc_the_product_id(); ?>]'><?php echo __('Quantity', 'wpsc'); ?>:</label> <input type="text" id='wpsc_quantity_update' name="wpsc_quantity_update[<?php echo wpsc_the_product_id(); ?>]" size="2" value="1"/> <input type="hidden" name="key" value="<?php echo wpsc_the_cart_item_key(); ?>"/> <input type="hidden" name="wpsc_update_quantity" value="true"/> </fieldset> <?php endif ;?> <div class="wpsc_product_price"> <?php if(wpsc_product_is_donation()) : ?> <label for='donation_price_<?php echo wpsc_the_product_id(); ?>'><?php echo __('Donation', 'wpsc'); ?>:</label> <input type='text' id='donation_price_<?php echo wpsc_the_product_id(); ?>' name='donation_price' value='<?php echo $wpsc_query->product['price']; ?>' size='6' /> <br /> <?php else : ?> <?php if(wpsc_product_on_special()) : ?> <span class='oldprice'><?php echo __('Price', 'wpsc'); ?>: <?php echo wpsc_product_normal_price(); ?></span><br /> <?php endif; ?> <span id="product_price_<?php echo wpsc_the_product_id(); ?>" class="pricedisplay"><?php echo wpsc_the_product_price(); ?></span><?php echo __('Price', 'wpsc'); ?>: <br/> <!-- multi currency code --> <?php if(wpsc_product_has_multicurrency()) : ?> <?php echo wpsc_display_product_multicurrency(); ?> <?php endif; ?> <!-- end multi currency code -->
function getSliderProducts($products) { $products = explode(",", $products); global $wpsc_query, $wpdb; foreach ($products as $product) { $image_width = get_option('single_view_image_width'); $image_height = get_option('single_view_image_height'); $options = get_option('site_basic_options'); $wpsc_query = new WPSC_Query(array('product_id' => $product)); while (wpsc_have_products()) { wpsc_the_product(); ?> <li class="feature-product"> <?php if (wpsc_the_product_thumbnail()) { ?> <div class="product-image"> <a rel="<?php echo str_replace(array(" ", '"', "'", '"', '''), array("_", "", "", "", ''), wpsc_the_product_title()); ?> " class="thickbox preview_link" href="<?php echo wpsc_the_product_image(); ?> "> <img class="product_image" id="product_image_<?php echo wpsc_the_product_id(); ?> " alt="<?php echo wpsc_the_product_title(); ?> " title="<?php echo wpsc_the_product_title(); ?> " src="<?php if ($options['themelayout'] == 'boxed') { bloginfo('template_url'); ?> /timthumb.php?src=<?php echo wpsc_the_product_image($image_width, $image_height); ?> &w=457<?php } else { echo wpsc_the_product_image($image_width, $image_height); } ?> " /> </a> </div> <?php } else { ?> <div class="product-image product-thumb item_no_image"> <a href="<?php echo wpsc_the_product_permalink(); ?> "> <span><?php _e('No Image Available', 'flexishop'); ?> </span> </a> </div> <?php } ?> <div class="product-content"> <h2 class="prodtitles"> <?php if (get_option('hide_name_link') == 1) { ?> <span><?php echo wpsc_the_product_title(); ?> </span> <?php } else { ?> <a class="wpsc_product_title" href="<?php echo wpsc_the_product_permalink(); ?> "><?php echo wpsc_the_product_title(); ?> </a> <?php } ?> </h2> <!-- <div class="wpsc_product_price"> <?php if (wpsc_product_is_donation()) { ?> <label for='donation_price_<?php echo wpsc_the_product_id(); ?> '><?php echo __('Donation', 'flexishop'); ?> :</label> <input type='text' id='donation_price_<?php echo wpsc_the_product_id(); ?> ' name='donation_price' value='<?php echo $wpsc_query->product['price']; ?> ' size='6' /> <br /> <?php } else { ?> <?php if (wpsc_product_on_special()) { ?> <span class='oldprice'><?php echo __('Price', 'flexishop'); ?> : <?php echo wpsc_product_normal_price(get_option('wpsc_hide_decimals')); ?> </span><br /> <?php } ?> <span id="product_price_<?php echo wpsc_the_product_id(); ?> " class="pricedisplay <?php if (wpsc_product_on_special()) { echo "sale-price"; } ?> "><?php if (wpsc_product_on_special()) { echo __("Sale Price: ", 'flexishop'); } echo wpsc_the_product_price(get_option('wpsc_hide_decimals')); ?> </span> <?php } ?> </div> --> <?php if (wpsc_the_product_additional_description()) { ?> <div class="description"> <?php $value = ''; $the_addl_desc = wpsc_the_product_additional_description(); if (is_serialized($the_addl_desc)) { $addl_descriptions = @unserialize($the_addl_desc); } else { $addl_descriptions = array('addl_desc', $the_addl_desc); } if (isset($addl_descriptions['addl_desc'])) { $value = $addl_descriptions['addl_desc']; } if (function_exists('wpsc_addl_desc_show')) { echo wpsc_addl_desc_show($addl_descriptions); } else { echo stripslashes(wpautop($the_addl_desc, $br = 1)); } ?> </div> <?php } ?> <a href="<?php echo wpsc_the_product_permalink(); ?> " class="buy-now"><?php _e('Buy Now', 'flexishop'); ?> </a> </div> </li> <?php } } }