Jump to content

Highlight input area


keat
 Share

Recommended Posts

Here we go again, price chnages in anticipation for our new 2023 catalogue.

5000 product lines, nearly all of which have to be price modified by hand because the boss doesn't do speadsheets.

Last year (or maybe the year before) BSmither helped me out with a little mod.

From the product inventry page, if you choose a product, the product will open by default on the pricing tab, this saves me no end of time.

 

However, I've thought of another time saving idea and wondered if anyone could help me out.

 

When the product opens on the pricing tab, would there be any way to have the actual price field already highlighted, so all I have to do is input the price.

At the moment, I have to choose the pricing field with the mouse, then go back to the keyboard to enter the value.

I'ts not a huge time saver, but with over 5000 product lines would make the job a bit easier.

 

Link to comment
Share on other sites

Should be do-able with a bit of javascript.

Let me ask: do many, if any, products have alternate prices based on "Customer Groups"? That is:

Retail:29.99/27.99(Sale), Wholesale:21.50, Rewards:20.00

If not, then maybe we can make edits so that the admin can update prices directly on the Product Inventory listing.

 

Link to comment
Share on other sites

To update the Retail prices directly from the Product Inventory listing, make these edits:

In admin /sources/products.index.inc.php, near line 492, find:

if (isset($_POST['status']) && is_array($_POST['status']) && Admin::getInstance()->permissions('products', CC_PERM_EDIT)) {
    // Update Status
    foreach ($_POST['status'] as $product_id => $status) {
        $GLOBALS['db']->update('CubeCart_inventory', array('status' => $status), array('product_id' => $product_id));
    }
    httpredir(currentPage());
}


Change to:

if (isset($_POST['status']) && is_array($_POST['status']) && Admin::getInstance()->permissions('products', CC_PERM_EDIT)) {
    // Update Status
    foreach ($_POST['status'] as $product_id => $status) {
        $GLOBALS['db']->update('CubeCart_inventory', array('status' => $status), array('product_id' => $product_id));
    }
if (isset($_POST['product_price']) && is_array($_POST['product_price'])) {
// Update Product Price
  foreach ($_POST['product_price'] as $product_id => $product_price) {
    $GLOBALS['db']->update('CubeCart_inventory', array('price' => $product_price), array('product_id' => $product_id));
  }
}
    httpredir(currentPage());
}

 

In the admin skin template products.index.php, near line 91, find:

<td>{$product.price}</td>


Change to:

{* WAS: <td>{$product.price}</td> *}
<td><span class="editable number" name="product_price[{$product.product_id}]">{$product.price}</span></td>

Then, you can sort/filter the listing according to whatever suits best your source listing of the new prices.

We can also add a Retail Sales Price column if your sale amounts are on a per-product basis.

Link to comment
Share on other sites

oh my.

Not exactly what I was looking for, but soooo much better.

@Al Brookbanks Al, this needs to be a feature of future versions.

this will potentially save me even more time..

Brian, if ever in the UK, please look me up, I owe you a few beers.

 

I sound like i'm being cheeky now, so don't perform this on my behalf.

However an observation if this makes it to a future release.

Updating the modified date/time field may be of benefit.

Edited by keat
Link to comment
Share on other sites

I propose this:

In products.index.inc.php, within the new added code, find:

$GLOBALS['db']->update('CubeCart_inventory', array('price' => $product_price), array('product_id' => $product_id));


Change to:

$GLOBALS['db']->update('CubeCart_inventory', array('price' => $product_price, 'updated' => date('Y-m-d H:i:s', time())), array('product_id' => $product_id));

This simply updates the date/time when the database record was last changed. This does NOT give the admin the ability to manually make the Last Updated date/time an arbitrary value.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...