Page 1 of 1
Show SKU in product edit title?
Posted: Thu Dec 23, 2010 9:29 am
by marc_cole
I'm looking for a way to display the SKU on the product detail admin page. Right now, it is only showing on the 'Data' tab. When I'm on another tab, I sometimes forget which product I'm working on and, instead of having to click the Data tab to see which one is selected, it would be nice if it was displayed above the tabs somewhere - perhaps in the header, like this.
Thanks,
Marc
Re: Show SKU in product edit title?
Posted: Fri Dec 24, 2010 2:31 am
by Qphoria
Get a new memory
Try this:
1. EDIT: admin/view/template/catalog/product_form.tpl
2. FIND:
3. AFTER, ADD:
Re: Show SKU in product edit title?
Posted: Fri Dec 24, 2010 5:54 am
by manson
what about echoing the product name?
Re: Show SKU in product edit title?
Posted: Fri Dec 24, 2010 8:17 am
by Qphoria
manson wrote:what about echoing the product name?
Guess!
Re: Show SKU in product edit title?
Posted: Fri Dec 24, 2010 8:57 am
by marc_cole
Qphoria wrote:3. AFTER, ADD:
That was too easy!
Thanks, Q. I really appreciate it.
Marc
Re: Show SKU in product edit title?
Posted: Fri Dec 24, 2010 9:59 am
by manson
Qphoria wrote:manson wrote:what about echoing the product name?
Guess!
hmm.. I've tried:
$product_description
$pd.name
$name
but it's not showing.....might it be.......
$product_name?

Re: Show SKU in product edit title?
Posted: Fri Dec 24, 2010 10:04 am
by manson
manson wrote:Qphoria wrote:manson wrote:what about echoing the product name?
Guess!
hmm.. I've tried:
$product_description
$pd.name
$name
but it's not showing.....might it be.......
$product_name?

no, it's not $product_name nor is it $description! im stumped!

Re: Show SKU in product edit title?
Posted: Fri Dec 24, 2010 2:19 pm
by marc_cole
Manson,
I was stumped for the longest time too, but I think I may have found the answer.
EDIT: /admin/controller/catalog/product.php
FIND this section of code:
Code: Select all
if (isset($this->request->post['sku'])) {
$this->data['sku'] = $this->request->post['sku'];
} elseif (isset($product_info)) {
$this->data['sku'] = $product_info['sku'];
} else {
$this->data['sku'] = '';
}
then duplicate it and rename all occurrences of 'sku' with 'name', like this:
Code: Select all
if (isset($this->request->post['name'])) {
$this->data['name'] = $this->request->post['name'];
} elseif (isset($product_info)) {
$this->data['name'] = $product_info['name'];
} else {
$this->data['name'] = '';
}
Now you can enter:
on /admin/view/template/catalog/product_form.tpl and it will work, as you can see from the screenshot.
Disclaimer - I really don't know PHP well enough to say that this is the definitive way to do it. Someone else will have to weigh in on that. But it works and it doesn't seem to break anything - yet...
Marc
Re: Show SKU in product edit title?
Posted: Fri Dec 24, 2010 5:23 pm
by manson
marc,
nice find!!! (it is nice! especially for php noobs like us! lolx!)
but.....
duplicate it just right after the same sku codes? where in the codes did you duplicate it?
Re: Show SKU in product edit title?
Posted: Sat Dec 25, 2010 12:37 am
by marc_cole
manson wrote:where in the codes did you duplicate it?
I placed it right after the 'sku' section. Since
<?php echo $sku; ?> worked, as Q said, I figured it probably needed to be in the same section of code.
Marc
Re: Show SKU in product edit title?
Posted: Sat Dec 25, 2010 2:58 am
by Qphoria
I've made this a proper VirtualQMod now. Just drop the xml file into the vqmod folder
Re: Show SKU in product edit title?
Posted: Sat Dec 25, 2010 5:08 am
by marc_cole
Qphoria wrote:I've made this a proper VirtualQMod now.
Q,
Since you didn't use my addition to /admin/controller/catalog/product.php in your mod, does that mean it wasn't a good way to solve the problem?
Marc
Re: Show SKU in product edit title?
Posted: Sat Dec 25, 2010 7:25 am
by Qphoria
marc_cole wrote:Qphoria wrote:I've made this a proper VirtualQMod now.
Q,
Since you didn't use my addition to /admin/controller/catalog/product.php in your mod, does that mean it wasn't a good way to solve the problem?
Marc
It worked ok but wasnt quite right. This uses the same language method the main name does and its already declared
Re: Show SKU in product edit title?
Posted: Tue Jan 04, 2011 11:19 pm
by (cj)
After an hour of reading about this VirtualQMod thing, (because I wanted the Product name to show on the admin product edit screens), I followed the instructions and dropped in the files. The product name shows up just as you said it would. Thank you. I can see this becoming a very, very useful tool for people like me who don't want to keep track of lots of little changes to all the different files.
Thank you.
Re: Show SKU in product edit title?
Posted: Tue Jan 04, 2011 11:57 pm
by Qphoria
Excellent
