function foxyshop_showproduct_shortcode($atts, $content = null) { global $product, $prod; $original_product = $product; extract(shortcode_atts(array("id" => '', "name" => ''), $atts)); $prod = ""; if ($id) { $prod = get_post($id, OBJECT); } elseif ($name) { $prod = foxyshop_get_product_by_name($name); } if (!$prod) { return ""; } ob_start(); foxyshop_include('single-product-shortcode'); $write = ob_get_contents(); ob_end_clean(); return $write; }
//if (foxyshop_is_on_sale()) echo '<p>SALE!</p>'; //Product Is New Tag (number of days since added) //if (foxyshop_is_product_new(14)) echo '<p>NEW!</p>'; //Main Product Description echo $product['description']; //Show Variations (showQuantity: 0 = Do Not Show Qty, 1 = Show Before Variations, 2 = Show Below Variations) foxyshop_product_variations(2); //(style) clear floats before the submit button echo '<div class="clr"></div>'; //Check Inventory Levels and Display Status (last variable allows ordering of out of stock items) foxyshop_inventory_management("There are only %c item%s left in stock.", "Item is not in stock.", false); //Add On Products ($qty, $before_entry, $after_entry) foxyshop_addon_products(true); //Add To Cart Button echo '<button type="submit" name="x:productsubmit" id="productsubmit" class="foxyshop_button">Add To Cart</button>'; //Shows the Price (includes sale price if applicable) echo '<div id="foxyshop_main_price">'; foxyshop_price(); echo '</div>'; //Shows any related products foxyshop_related_products("Related Products"); //Custom Code Can Go Here //Ends the form echo '</div>'; echo '</form>'; ?> <div class="clr"></div> </div> <?php foxyshop_include('footer');