Exemplo n.º 1
0
} elseif (isset($_GET['delete_shopping_basket_id'])) {
    /*
     * This is a rather inefficient way of doing this.
     *
     * The product and the quantity aren't really needed anymore
     * but leave it in for now and remove it later.
     */
    #$row_to_be_deleted =
    #	$shopping_baskets_table->get_row_by_id($_GET['delete_shopping_basket_id']);
    #
    #$quantity = $row_to_be_deleted->get_quantity();
    #$product = $row_to_be_deleted->get_product();
    #$product_id = $product->get_id();
    $shopping_baskets_table->delete_shopping_basket($_GET['delete_shopping_basket_id']);
    //        $return_to .= '&last_deleted_product_id=' . $product_id;
    //        $return_to .= '&last_deleted_quantity=' . $quantity;
    #$return_to_url->set_get_variable('last_deleted_product_id', $product_id);
    /*
     * The quantity is not used on the shopping basket page anymore.
     *
     * Should this be removed (with some of the lines above)?
     */
    #$return_to_url->set_get_variable('last_deleted_quantity', $quantity);
    /*
     * The deleted shopping basket id
     */
    $return_to_url->set_get_variable('last_deleted_shopping_basket_id', $_GET['delete_shopping_basket_id']);
} elseif (isset($_GET['restore_shopping_basket_id'])) {
    Shop_ShoppingBasketsTable::restore_shopping_basket($_GET['restore_shopping_basket_id']);
}
$page_manager->set_return_to_url($return_to_url);
 public static function get_restore_shopping_basket_item_url($sbid)
 {
     $undo_location = Shop_ShoppingBasketsTable::get_public_redirect_script_url();
     $undo_location->set_get_variable('restore_shopping_basket_id', $sbid);
     return $undo_location;
 }
 /**
  * Modelled closely on
  *
  *  get_deleted_shopping_basket_confirmation_div
  *
  * above.
  * 
  * The div here allows a customer to restore a shopping basket
  * by its ID rather than create a new one for the product.
  *
  * This is necessary for products with additional characteristics
  * like size or colour.
  *
  * This is actually redundant and has never been used or tested.
  *
  * See
  *
  * Shop_ShoppingBasketsTableRenderer::get_deleted_shopping_basket_confirmation_div_for_sbid
  *
  * @param $sbid The shopping basket ID.
  */
 public function get_deleted_shopping_basket_confirmation_div_for_sbid($sbid)
 {
     $undo_location = Shop_ShoppingBasketsTable::get_restore_shopping_basket_item_url($sbid);
     return $this->get_deleted_shopping_basket_confirmation_div_for_url($undo_location);
 }
 /**
  * This is shown in the last action div of the shopping
  * baskets page after a user has deleted an item from
  * their shopping basket.
  */
 public static function get_deleted_shopping_basket_confirmation_div_for_sbid($shopping_basket_id)
 {
     $product_name = Shop_ShoppingBasketsTable::get_product_name_for_sbid($shopping_basket_id);
     $undo_url = Shop_ShoppingBasketsTable::get_restore_shopping_basket_item_url($shopping_basket_id);
     return self::get_deleted_shopping_basket_confirmation_div($product_name, $undo_url);
 }