[ic] Deleting Shipping Addresses

Mark Bryant interchange-users@icdevgroup.org
Sat May 3 03:07:01 2003


At 07:45 03/05/2003, you wrote:
>At 03:47 03/05/2003, Mike Heins wrote:
>>Quoting Mark Bryant (mark@vwe.net):
>> > Hi Folks,
>> >
>> > I apologise if someone has asked this before, but after a good dig around
>> > on google and the IC main site, I've found myself stumped as to how to add
>> > the capability to remove shipping addresses users have stored to the
>> > shipping_addresses.html page.
>> >
>> > I'm using IC 4.8.7 from an rpm install on Red Hat 7.3 with Perl 5.6.1 and
>> > have installed and used the foundation demo and store rpms too. I notice
>> > the ability to remove shipping addresses is also absent from the 
>> foundation
>> > demo store so there's nothing to refer to.
>> >
>> > I can see a page called shipping_addresses_removed.html, but I don't seem
>> > to be able to construct any kind of direct URL or code on
>> > shipping_addresses.html that calls it correctly to delete a shipping
>> > address entry. The weird thing is that shipping_addresses_removed.html
>> > claims success each time but actually does nothing.
>>
>>That is actually a non-functional page left over from a *way* early version
>>of Interchange. I am surprised it has stayed there this long....
>>
>>The way to do it is:
>>
>>         [userdb function=delete_shipping nickname="EntryName"]
>>
>>You could do a page pretty easy:
>>
>>[set page_title]Delete shipping addresses[/set]
>>[set members_only]1[/set]
>>
>>@_LEFTONLY_TOP_@
>>
>>[if session arg]
>>         [userdb function=delete_shipping nickname="[data session arg]"]
>>[/if]
>>
>>[loop list="[userdb function=get_shipping_names show=1]"]
>>[page @@MV_PAGE@@ [loop-code]]Delete <i>[loop-code]</i> shipping 
>>address</A><BR>
>>[/loop]
>>
>>@_LEFTONLY_BOTTOM_@
>>
>>I think the user feedback has become overwhelming that we need to improve the
>>address handling in the Interchange UserDB. We have a volunteer to do it,
>>and a good starting point might be the addresses tag provided by Paul
>>Jordan.
>
>Thanks for your reply Mike, the stand alone page works great :o))
>
>I'm assuming from your comment above that shipping_addresses_added.html 
>and shipping_addresses_removed.html are now redundant and can be safely 
>removed?
>
>I would like to integrate the delete/list function into 
>shipping_addresses.html so that addresses are handled all from one page as 
>it seems logical to allow a delete function on the same page that lists 
>and adds the addresses.
>
>I tried putting the code you provided into shipping_addresses.html and 
>whilst it still lists and adds addresses the delete part now doesn't work. 
>This is what I currently have in shipping_addresses.html, but have no idea 
>why it doesn't work.
>
><!-- BEGIN CONTENT -->
><br>
>
>     [table-editor
>             href="@@MV_PAGE@@"
>             hidden.mv_action=back
>                 ui_hide_key=1
>             table=userdb
>                 table_width="95%"
>             auto_secure=1
>                 reload=1
>             all_errors=1
>                 mv_blob_label="city"
>                 mv_blob_title="Shipping addresses"
>                 mv_blob_only=1
>                 mv_blob_field="address_book"
>                 mv_blob_nick="[cgi mv_blob_nick]"
>             check.mv_blob_nick="
>                         regex ^[-\w\0]+$ 'Nickname must be of characters 
> [-A-Za-z0-9]'
>             "
>             check.username="
>                         regex ^\w+$ 'Username must be of characters 
> [A-Za-z0-9]'
>                         length 4-10
>             "
>             check.lname="required We need a last name...."
>             check.fname="required We need a first name...."
>             check.address1="required We need an address...."
>             check.city="required We need a city...."
>             check.state="required We need a state...."
>             check.zip="required We need a postal code...."
>             get=1
>             ui_data_fields="username company fname lname address1 
> address2 city state zip country phone_day"
>             key="[data session username]"]
>
>
>[if session arg]
>         [userdb function=delete_shipping nickname="[data session arg]"]
>[/if]
>
>
>[loop list="[userdb function=get_shipping_names show=1]"]
>[page @@MV_PAGE@@ [loop-code]]Delete <i>[loop-code]</i> shipping 
>address</A><BR>
>[/loop]
><BR>
>
><!-- END CONTENT -->
>
>
>I'm pretty sure this just needs a little tweaking?
>
>Many thanks in advance.

Ok it turns out that if i put:

[if session arg]
         [userdb function=delete_shipping nickname="[data session arg]"]
[/if]

above:

     [table-editor
             href="@@MV_PAGE@@"
             hidden.mv_action=back
                 ui_hide_key=1
             table=userdb.........
      .....

and leave this where it is:

[loop list="[userdb function=get_shipping_names show=1]"]
[page @@MV_PAGE@@ [loop-code]]Delete <i>[loop-code]</i> shipping 
address</A><BR>
[/loop]
<BR>

it all works fine :o)

Once again, many thanks to you Mike for helping me out it's very much 
appreciated.

Mark