Flip it back to Down for Maintenance ...
I forgot another table and need to work this out ...
Flip it back to Down for Maintenance ...
I forgot another table and need to work this out ...
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: v1.5.5]
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!
Make a new file:
/your_secret_admin/fix_bad_coupons.php
And put in that file the code:
What this will do is make a record in the coupon_redeem_track for each of these so that it cannot be redeemed ...Code:<?php // fix bad coupons require('includes/application_top.php'); // set your IP_ADDRESS // set your customers_id on you testing account // set a fake orders_id $admin_ip_address = '99.135.53.113'; $admin_customer_id = '2'; $fake_orders_id = '999999'; global $db; $chk_coupons_sql = "SELECT * FROM " . TABLE_COUPONS . " WHERE coupon_active='N' and coupon_type= 'G'"; $chk_coupons = $db->Execute($chk_coupons_sql); echo 'Fixing: ' . $chk_coupons->RecordCount() . '<br>'; while (!$chk_coupons->EOF) { $chk_coupons_redeem_sql = "SELECT * FROM " . TABLE_COUPON_REDEEM_TRACK . " WHERE coupon_id ='" . $chk_coupons->fields['coupon_id'] . "'"; $chk_coupons_redeem = $db->Execute($chk_coupons_redeem_sql); if ($chk_coupons_redeem->EOF) { $db->Execute("insert into " . TABLE_COUPON_REDEEM_TRACK . " (coupon_id, redeem_date, redeem_ip, customer_id, order_id) values ('" . $chk_coupons->fields['coupon_id'] . "', now(), '" . $admin_ip_address . "', '" . $admin_customer_id . "', '" . $fake_orders_id . "')"); } $chk_coupons->MoveNext(); } echo 'Fixed! ' . $chk_coupons->RecordCount();
The reason to make these records rather than delete the codes created is so that in the future, the codes could not ever be generated and used again ...
NOTE: backup your database before running this code ...
You can then run it by using:
your_domain_name.php/your_secret_admin/fix_bad_coupons.php
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: v1.5.5]
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!
I'll try that but I have a question. Do I need to edit the info in the 3 fields that are in the above code for admin ip, customer id, and fake order id?
Alright, I changed the admin ip address and left the other 2 fields.
I then ran the file and preliminary results seem to show that you've solved the problem.
Hugs and another $100 are on the way...give me a few minutes to decompress first though.
Many many thanks.
Ed
I think I'm back in business. My store seems ok now, just have to deal with the fallout of all those messages.
I just sent another $100 on top of my previous donations.
Many thanks,
Ed
You are most welcome ... we appreciate the support ...
Can you check and see who customers_id 2 is and make sure that is your customers_id in the customers table?
That way, if you review these in the future you do not have them marked as going to a regular customer ...
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: v1.5.5]
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!
Yes, that customer id belongs to us, so that worked out ok.
Everything seems to be back to normal now, aside from the couple of new entries in the gv list. Just a couple :)
Looks like I'll be making good use of the menu restriction options in 1.5.
Bookmarks