Forums / Bug Reports / [Done v1.3.9a] Losing Product Information When Updating Prices

[Done v1.3.9a] Losing Product Information When Updating Prices

Locked

Views: 4,176

Results 21 to 21 of 21
This thread is locked. New replies are disabled.
7 Mar 2010, 6:57 AM
#21
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,515
Plugin Contributions:
176

[Done v1.3.9a] Losing Product Information When Updating Prices

I'm convinced that the problem is something quirky at the PC level. It could be some sort of firewall software, or a virus, or it could be something within the browser itself that is causing the $_POST data to not be submitted when the Update button is clicked on the product-preview screen.
To that end, I simulated the problem with some manual hacking, and caused the update to save blanks for all the product names, description, flags, switches, prices, settings, etc, of the product being edited.

The following workaround seems to prevent that from happening:

Edit /admin/includes/modules/update_product.php, around line 14 you'll see an } else { statement, like this:if (isset($_POST['edit_x']) || isset($_POST['edit_y'])) { $action = 'new_product'; [B] } else {[/B] if (isset($_GET['pID'])) $products_id = zen_db_prepare_input($_GET['pID']);Change that } else { line as shown:```
if (isset($_POST['edit_x']) || isset($_POST['edit_y'])) {
$action = 'new_product';
} else[B]if ($_POST['products_model'] . $_POST['products_url'] . $_POST['products_name'] . $_POST['products_description'] != '') {[/B]
if (isset($_GET['pID'])) $products_id = zen_db_prepare_input($_GET['pID']);


Do the same in /admin/includes/modules/product_music/update_product.php, and in any other custom product type files by the same name which you may have created.

The screen will look a little odd if this situation is triggered, but the data will be preserved. It may be necessary to re-navigate to the product before re-doing the edits.
A more comprehensive fix will be included in v1.3.9.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.