Post by marc_cole » Thu Dec 23, 2010 9:29 am

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

Attachments

current product.png

Example of 'current product' showing in header - current product.png (10.26 KiB) Viewed 5285 times

Last edited by marc_cole on Sat Dec 25, 2010 12:41 am, edited 1 time in total.

OpenCart v1.4.9.4
VQMod | Categories Home | Cleaner By Default - 2 Column | Speak Good English


Active Member

Posts

Joined
Tue Dec 14, 2010 11:26 am
Location - Seattle, WA

Post by Qphoria » Fri Dec 24, 2010 2:31 am

Get a new memory :)

Try this:

1. EDIT: admin/view/template/catalog/product_form.tpl

2. FIND:

Code: Select all

<?php echo $heading_title; ?>
3. AFTER, ADD:

Code: Select all

<?php echo $sku; ?>

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by manson » Fri Dec 24, 2010 5:54 am

what about echoing the product name?

I don't know much about PHP...~~
Don't know much about JQuery...~~
But I do know that I love OC!~~
and I know that if you'd guide me, what a wonderful world this would be...!~~

_________________________________________________________________
Using OC 1.4.9.2
http://www.ten2hundred.com


User avatar
New member

Posts

Joined
Mon Dec 06, 2010 6:58 pm

Post by Qphoria » Fri Dec 24, 2010 8:17 am

manson wrote:what about echoing the product name?
Guess!

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by marc_cole » Fri Dec 24, 2010 8:57 am

Qphoria wrote:3. AFTER, ADD:

Code: Select all

<?php echo $sku; ?>
That was too easy! :-[

Thanks, Q. I really appreciate it.

Marc

OpenCart v1.4.9.4
VQMod | Categories Home | Cleaner By Default - 2 Column | Speak Good English


Active Member

Posts

Joined
Tue Dec 14, 2010 11:26 am
Location - Seattle, WA

Post by manson » Fri Dec 24, 2010 9:59 am

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? :o

I don't know much about PHP...~~
Don't know much about JQuery...~~
But I do know that I love OC!~~
and I know that if you'd guide me, what a wonderful world this would be...!~~

_________________________________________________________________
Using OC 1.4.9.2
http://www.ten2hundred.com


User avatar
New member

Posts

Joined
Mon Dec 06, 2010 6:58 pm

Post by manson » Fri Dec 24, 2010 10:04 am

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? :o
no, it's not $product_name nor is it $description! im stumped! ???

I don't know much about PHP...~~
Don't know much about JQuery...~~
But I do know that I love OC!~~
and I know that if you'd guide me, what a wonderful world this would be...!~~

_________________________________________________________________
Using OC 1.4.9.2
http://www.ten2hundred.com


User avatar
New member

Posts

Joined
Mon Dec 06, 2010 6:58 pm

Post by marc_cole » Fri Dec 24, 2010 2:19 pm

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:

Code: Select all

<?php echo $name; ?>
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

Attachments

Screen shot 2010-12-23 at 10.14.32 PM.png

Header with sku and name fields added - Screen shot 2010-12-23 at 10.14.32 PM.png (17.22 KiB) Viewed 5230 times

Last edited by marc_cole on Sat Dec 25, 2010 12:38 am, edited 1 time in total.

OpenCart v1.4.9.4
VQMod | Categories Home | Cleaner By Default - 2 Column | Speak Good English


Active Member

Posts

Joined
Tue Dec 14, 2010 11:26 am
Location - Seattle, WA

Post by manson » Fri Dec 24, 2010 5:23 pm

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?

I don't know much about PHP...~~
Don't know much about JQuery...~~
But I do know that I love OC!~~
and I know that if you'd guide me, what a wonderful world this would be...!~~

_________________________________________________________________
Using OC 1.4.9.2
http://www.ten2hundred.com


User avatar
New member

Posts

Joined
Mon Dec 06, 2010 6:58 pm

Post by marc_cole » Sat Dec 25, 2010 12:37 am

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
Last edited by marc_cole on Sat Dec 25, 2010 5:53 am, edited 3 times in total.

OpenCart v1.4.9.4
VQMod | Categories Home | Cleaner By Default - 2 Column | Speak Good English


Active Member

Posts

Joined
Tue Dec 14, 2010 11:26 am
Location - Seattle, WA

Post by Qphoria » Sat Dec 25, 2010 2:58 am

I've made this a proper VirtualQMod now. Just drop the xml file into the vqmod folder

Attachments


Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by marc_cole » Sat Dec 25, 2010 5:08 am

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

OpenCart v1.4.9.4
VQMod | Categories Home | Cleaner By Default - 2 Column | Speak Good English


Active Member

Posts

Joined
Tue Dec 14, 2010 11:26 am
Location - Seattle, WA

Post by Qphoria » Sat Dec 25, 2010 7:25 am

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

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by (cj) » Tue Jan 04, 2011 11:19 pm

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.

(cj)
http://www.adventhouseplans.com
----
Opencart v2.3.0.2 no VQMod yet


New member

Posts

Joined
Fri Dec 17, 2010 6:17 am

Post by Qphoria » Tue Jan 04, 2011 11:57 pm

Excellent :)

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am
Who is online

Users browsing this forum: No registered users and 89 guests