This looks like a really useful mod![]()
Which is the latest version - Andrew's or Paulm's - or is there a combined version now maybe?
Would it be possible to convert this so it works with register_globals = off?
This looks like a really useful mod![]()
Which is the latest version - Andrew's or Paulm's - or is there a combined version now maybe?
Would it be possible to convert this so it works with register_globals = off?
To answer my own questions ...Which is the latest version - Andrew's or Paulm's - or is there a combined version now maybe?
Would it be possible to convert this so it works with register_globals = off?![]()
1. Andrew's latest version (v1.3.6 13.10.2006, available from the link in his post above - post #20) incorporates Paulm's v1.5.
2. It already does work with register_globals = off (I had downloaded an earlier version from the zen downloads section).
Thanks guys - this looks really good![]()
Last edited by Pixxi; 13 Oct 2006 at 03:37 PM.
As far as I know Andrew took my latest version and is working on that now. (But currently I do not see a later version from him yet, or am I overlooking it?)
It does work with register globals off. Does it not?Would it be possible to convert this so it works with register_globals = off?
Ah ... I have a special super-advanced browser, so far ahead of itself that it can display posts that haven't been posted yet ... well Ok. - that should have been post #20 (post corrected)![]()
:-) thnx
I noticed a bug: the sorting of prices does not work (at the catalog side of the cart) after using quick_updates to edit prices. I guess the fix is easy and we just need to add:
Untested but I assume it will fix the problem.Code:// reset products_price_sorter for searches etc. zen_update_products_price_sorter($products_id);
Any particular place that needs to be put, Paul?
Yep Pixxi, I could not say from the top of my head then. But at approx line 88 the price update part should be update to:
Colored quote to highlight the actual change:Code:if($_POST['product_new_price']){ $_POST['product_new_price'] = zen_db_prepare_input($_POST['product_new_price']); foreach($_POST['product_new_price'] as $products_id => $new_price) { if ($_POST['product_new_price'][$products_id] != $_POST['product_old_price'][$products_id] && $_POST['update_price'][$products_id] == 'yes') { $count_update++; $item_updated[$products_id] = 'updated'; $db->Execute("UPDATE " . TABLE_PRODUCTS . " SET products_price='" . zen_db_input($new_price) . "', products_last_modified=now() WHERE products_id=" . (int)$products_id); zen_update_products_price_sorter((int)$products_id); } } }
Tested now, and it works as expectedif($_POST['product_new_price']){
$_POST['product_new_price'] = zen_db_prepare_input($_POST['product_new_price']);
foreach($_POST['product_new_price'] as $products_id => $new_price) {
if ($_POST['product_new_price'][$products_id] != $_POST['product_old_price'][$products_id] && $_POST['update_price'][$products_id] == 'yes') {
$count_update++;
$item_updated[$products_id] = 'updated';
$db->Execute("UPDATE " . TABLE_PRODUCTS . " SET products_price='" . zen_db_input($new_price) . "', products_last_modified=now() WHERE products_id=" . (int)$products_id);
zen_update_products_price_sorter((int)$products_id);
}
}
}
I would like to update the quick_updates soon (and then the above fix will be included of course), but time flies.....
(
Note that this only updates the sort order for prices that are updated *after* the above change. If really needed, it's also possible to update the sort order for all prices without editting quite easily using this line zen_update_products_price_sorter((int)$products->fields['products_id']) in the while (!$products->EOF) loop. (but better remove this one again after all prices are sorted)
)
New version available:
Decided to use the current date as version number this time ;-)2006-10-18: Updated by Paul Mathot (user: paulm @ Zen Cart forums)
1) Improved margin calculation feature (margin is updated by price ex and price inc, as well as by purchase price now).
2) Added CSS popup for products description (and modified code so that the normal descriptions are hidden when the editor popup feature is enabled).
(Tmho the descriptions do not need to be visible in that case, and displaying the descriptions clutters the screen)
3) Moved CSS, and js for tax and margin calculations, to separate files.
4) Added zen_update_price() function, to fix price sorting
5) Made products price for products with special price editable (was disabled), and added color to the input fields background as "Special" warning.
6) Colored "margin" input backgound light gray, to indicate that it's not ment for editting (disabling the field would interfere with updating it).
Note: Tested in Firefox only (but I hope/think it will work fine in IE too).
Last edited by paulm; 8 Nov 2006 at 03:18 PM.
Thanks Paul - seems to work fine so far.![]()
Just one thing - are the thumbnails supposed to show (if enabled in config)? - not seeing them.
Two suggestions/wishlist items:
1. Would it be possible to add a switch for enabling/disabling the display of price without tax? Quite a few people aren't registered for VAT and it would free up space on the screen if that could be disabled.
2. Would it be possible (big request) to have the mod operate from a search query? ie. the user types in a search query for a particular range of products, can then update/change the products, or move them to different categories and save them. This would be an enormous help for people who have a lot of products and is something the admin as a whole would really benefit from when the shop owner is editing/updating products.
Bookmarks