Forums / Addon Templates / Customer Can't Delete Addresses in Address Book

Customer Can't Delete Addresses in Address Book

Locked

Views: 6,871

Results 1 to 10 of 10
This thread is locked. New replies are disabled.
13 May 2012, 3:47 PM
#1
kamphuis avatar

kamphuis

New Zenner

Join Date:
Aug 2010
Location:
Michigan
Posts:
14
Plugin Contributions:
0

Customer Can't Delete Addresses in Address Book

I just found this problem with my site and I have no idea when it started. When the customer clicks "Delete" to remove an address, the question "Are you sure you would like to delete the selected address from your address book?" shows up. The customer then clicks on delete again and the same question shows up and the address isn't deleted. Attached is an image fo the screen that keeps showing up over and over.

I'm running v1.5
https://www.healthydentalproducts.com

Attachment 10457

13 May 2012, 3:57 PM
#2
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Customer Can't Delete Addresses in Address Book

What happens if you switch to the Classic Template ... does it work? :unsure:

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

13 May 2012, 4:01 PM
#3
kamphuis avatar

kamphuis

New Zenner

Join Date:
Aug 2010
Location:
Michigan
Posts:
14
Plugin Contributions:
0

Re: Customer Can't Delete Addresses in Address Book

I just tried it in the classic template and it works properly there. Do you know what specific files deal with deleting addresses? I guess my template has some glitches :(

13 May 2012, 4:25 PM
#4
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Customer Can't Delete Addresses in Address Book

Compare your templates and override files to the original default files and that should help you locate the issue ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

23 May 2012, 12:15 AM
#5
immortalitea avatar

immortalitea

New Zenner

Join Date:
Dec 2004
Posts:
65
Plugin Contributions:
0

Re: Customer Can't Delete Addresses in Address Book

I'm running 1.5. I upgraded back in Feb.with no significant issues.

I'm having the same problem with address deletion as mentioned in the beginning of this thread. However, it does not matter if I use the classic template or my own. When a customer navigates to my account/view or change addresses/delete they are asked "Are you sure you would like to delete the selected address from your address book?" and if one selects "Delete" nothing happens. I'm not sure if this problem has existed since the upgrade or is a new problem. I do know that before upgrading, this feature worked fine.

My site https://www.immortalitea.com

23 May 2012, 4:05 PM
#6
curt_l avatar

curt_l

New Zenner

Join Date:
Dec 2007
Posts:
12
Plugin Contributions:
0

Re: Customer Can't Delete Addresses in Address Book

I also had the problem, addresses could not be deleted from address book in any templates in v1.5 .
The only way i found to get it to work was to change:

if (isset($_GET['action']) && ($_GET['action'] == 'deleteconfirm') && isset($_POST['delete']) && is_numeric($_POST['delete'])) {
  $sql = "DELETE FROM " . TABLE_ADDRESS_BOOK . "
          WHERE  address_book_id = :delete
          AND    customers_id = :customersID";

  $sql = $db->bindVars($sql, ':customersID', $_SESSION['customer_id'], 'integer');
  $sql = $db->bindVars($sql, ':delete', $_POST['delete'], 'integer');
  $db->Execute($sql);

to:

if (isset($_GET['action']) && ($_GET['action'] == 'deleteconfirm') && isset($_GET['delete']) && is_numeric($_GET['delete'])) {
  $sql = "DELETE FROM " . TABLE_ADDRESS_BOOK . "
          WHERE  address_book_id = :delete
          AND    customers_id = :customersID";

  $sql = $db->bindVars($sql, ':customersID', $_SESSION['customer_id'], 'integer');
  $sql = $db->bindVars($sql, ':delete', $_GET['delete'], 'integer');
  $db->Execute($sql);

Ajeh, is it ok to use _GET['delete'] here?

23 May 2012, 4:36 PM
#7
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Customer Can't Delete Addresses in Address Book

Could you check the files:
\includes\templates\template_default\templates\tpl_address_book_process_default.php
\includes\modules\pages\address_book_process\header_php.php

\includes\templates\your_template_dir\templates\tpl_address_book_process_default.php

against the original files in Zen Cart v1.5 and see if they are current ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

19 Jul 2017, 4:06 PM
#8
utefan avatar

utefan

New Zenner

Join Date:
Feb 2016
Posts:
28
Plugin Contributions:
0

Re: Customer Can't Delete Addresses in Address Book

Ajeh:

Could you check the files:
\includes\templates\template_default\templates\tpl_address_book_process_default.php
\includes\modules\pages\address_book_process\header_php.php

\includes\templates\your_template_dir\templates\tpl_address_book_process_default.php

against the original files in Zen Cart v1.5 and see if they are current ...

I had this issue in my site. The issue was in the following file:

\includes\templates\your_template_dir\templates\tpl_address_book_process_default.php

Check to make sure that the code around line 32 looks like the code in original Zen Cart files.

19 Jul 2017, 6:06 PM
#9
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,849
Plugin Contributions:
18

Re: Customer Can't Delete Addresses in Address Book

You don't say what version of ZC you're using here or on your other post (it's over 4 years old) but this thread was from five+ years ago so I don't think the files are going to look quite the same.

What version were you having a problem with?

Need a hand with Zen Cart? Hire the team at myZenCartZone.com for upgrades, repairs, and custom plugins.
Zen Cart Certified hosting at myZenCartHost.com

19 Jul 2017, 10:56 PM
#10
utefan avatar

utefan

New Zenner

Join Date:
Feb 2016
Posts:
28
Plugin Contributions:
0

Re: Customer Can't Delete Addresses in Address Book

dbltoe:

You don't say what version of ZC you're using here or on your other post (it's over 4 years old) but this thread was from five+ years ago so I don't think the files are going to look quite the same.

What version were you having a problem with?

I didn't see anyone post here a definitive solution, just some suggested places to look. I confirmed in a 1.5.1 instance that this bug was related to template specific coding and not to the ZenCart core. The key here is to compare what is in your templates\tpl_address_book_process_default.php file to what is in the same file for the default template in Zencart (same version). That will zero in on what code is causing the issue for your specific build.