private function getAddToBasketForm($id) { $form = new Forge("basket_plus/add_to_basket", "", "post", array("id" => "gAddToBasketForm")); $group = $form->group("add_to_basket")->label(t("Add To Basket")); $group->hidden("id"); $group->dropdown("product")->label(t("Product"))->options(bp_product::getProductArray($id)); $group->input("quantity")->label(t("Quantity"))->id("gQuantity"); $group->submit("")->value(t("Add")); return $form; }
static function photo_top($theme) { if (!basket_plus::getBasketVar(USE_SIDE_BAR_ONLY)) { if (bp_product::isForSale($theme->item()->id)) { $view = new View("add_to_basket.html"); $view->item = $theme->item(); return $view->render(); } } return ""; }
static function initBasketProducts($language, $isReset) { $db = Database::instance(); //if it's a reset request, empty the tables if ($isReset) { $db->query("DELETE FROM {bp_postage_bands}"); $db->query("DELETE FROM {bp_products}"); $db->query("DELETE FROM {bp_product_overrides}"); $db->query("DELETE FROM {bp_item_products}"); } //Add postage_bands if the table is empty $postage_band = ORM::factory("bp_postage_band")->where("id", "=", 1)->find(); if (!$postage_band->loaded()) { //========================== // SETTINGS FOR ENGLISH if ($language == "en_US" or $language == "en_UK") { // name, fixed cost, per item cost, is download bp_postage_band::create("No posting cost", 0, 0, false); bp_postage_band::create("Default posting cost", 2, 0, false); bp_postage_band::create("Posting by e-mail (free)", 0, 0, true); } elseif ($language == "nl_NL") { // name, fixed cost, per item cost, is download bp_postage_band::create("Geen verzendkosten", 0, 0, false); bp_postage_band::create("Standaard verzendkosten", 2, 0, false); bp_postage_band::create("Verzending via e-mail (gratis)", 0, 0, true); } } //Add products if the table is empty $product = ORM::factory("bp_product")->where("id", "=", 1)->find(); if (!$product->loaded()) { //========================== // SETTINGS FOR ENGLISH if ($language == "en_US" or $language == "en_UK") { //get posting band id for mail $postage = ORM::factory("bp_postage_band")->where("name", "=", "Default posting cost")->find(); // name, cost, descr, postageband id bp_product::create("4x6", 6, "Print 4x6 inch glossy", $postage->id); bp_product::create("8x10", 9, "Print 8x10 inch glossy", $postage->id); //get posting band id for e-mail $postage = ORM::factory("bp_postage_band")->where("name", "=", "Posting by e-mail (free)")->find(); bp_product::create("Original", 10, "Original high resolution photo file", $postage->id); } elseif ($language == "nl_NL") { //get posting band id for mail $postage = ORM::factory("bp_postage_band")->where("name", "=", "Standaard verzendkosten")->find(); // name, cost, descr, postageband id bp_product::create("13x18", 6, "Afdruk 13x18 cm glanzend", $postage->id); bp_product::create("20x30", 9, "Afdruk 20x30 cm glanzend", $postage->id); //get posting band id for e-mail $postage = ORM::factory("bp_postage_band")->where("name", "=", "Verzending via e-mail (gratis)")->find(); bp_product::create("Origineel", 10, "Originele fotobestand in hoge resolutie", $postage->id); } } }
public function edit_product_form($id) { $product = ORM::factory("bp_product", $id); if (!$product->loaded()) { kohana::show_404(); } $form = bp_product::get_edit_form_admin($product); print $form; }
href="<?php echo url::site("basket_plus/view_Orders"); ?> " title="<?php echo t("View Orders"); ?> "> <span class="ui-icon ui-icon-clipboard"></span><?php echo t("View Orders"); ?> </a><?php } } if ($theme->page_subtype == "photo" or $theme->page_subtype == "album") { if ($item = $theme->item()) { if ($item->is_photo() && bp_product::isForSale($theme->item()->id)) { ?> <p> <a class="g-dialog-link g-button ui-icon-left ui-state-default ui-corner-all ui-state-hover" href="<?php echo url::site("basket_plus/add_to_basket_ajax/{$item->id}"); ?> " title="<?php echo t("Add To Basket"); ?> "><span class="ui-icon ui-icon-plusthick"></span><?php echo t("Add To Basket"); ?> </a></p> <?php }