/** * /products/<id>/add_to_cart_form * Returns HTML */ public function get_order_form($display_quantity = 'true', $display_price = 'true', $display_mode = null) { $html = 'Product not available'; // Figure out about the product id vs sku $product_id = $this->id; if (strlen($this->sku) > 0) { $product_id = $this->sku; } CC_Log::write("Get order form for product id: {$product_id}"); if (strlen($product_id) > 0) { try { $redirect_url = CC_Cart::get_redirect_url(); $html = CC_Cart::get_order_form($product_id, $redirect_url, $display_quantity, $display_price, $display_mode); } catch (CC_Exception_API $e) { $html = "Unable to retrieve product order form"; } } else { throw new CC_Exception_Product('Unable to get add to cart form because the product id is not available'); } return $html; }
public function get_order_form($product_id, $redirect_url, $display_quantity = null, $display_price = null, $display_mode = null) { return CC_Cart::get_order_form($product_id, $redirect_url, $display_quantity = null, $display_price = null, $display_mode = null); }