display product code

  • Posts: 52
  • Thank you received: 0
13 years 1 month ago #11795

Hi,

I feel like I must be missing this setting somewhere and I have searched the forums and do not see this topic.

I want the product code to appear on the listings - both the category listing and the individual product details.

is this a setting or is there some edit I can make to the view files?

thank for your help.

Please Log in or Create an account to join the conversation.

  • Posts: 81605
  • Thank you received: 13083
  • MODERATOR
13 years 1 month ago #11797

Hi

For the product page, you can just remove the CSS:
.hikashop_product_code_main {
display: none;
}

from the front end css file of hikashop (you can edit it in the config under the tab display).

For the listings, the product code is actually not displayed at all. So you will have to edit the file listing_img_title of the view product via the menu Display->Views and add the code:
echo $this->row->product_code;
before or after the code:
echo $this->row->product_name;

Please Log in or Create an account to join the conversation.

  • Posts: 52
  • Thank you received: 0
13 years 1 month ago #11800

thank you for the quick response!

the css did the trick very well on the individual view, thanks.


the edit of the listing_img_title does not seem to do anything.

since I had already adjusted the price to show under the name I am sure I am in the right file.

Please Log in or Create an account to join the conversation.

  • Posts: 81605
  • Thank you received: 13083
  • MODERATOR
13 years 1 month ago #11805

You need to double check your modifications because that change works.

Please Log in or Create an account to join the conversation.

  • Posts: 52
  • Thank you received: 0
13 years 1 month ago #11810

hello, I have double checked. I will attach a screenshot since html/php mix does not render well here. I must be missing something. thanks again for the quick replies.

Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 81605
  • Thank you received: 13083
  • MODERATOR
13 years 1 month ago #11816

Just to make sure, please add temporarily an exit; after the product code line. That will stop the processing of the page and you should see the first product code at the end of the page. If you don't see any change to the listing, that means that you're not editing the good file.
There is no reason the product code would not be displayed with the modification you did unless you're not in the good file.

Please Log in or Create an account to join the conversation.

  • Posts: 52
  • Thank you received: 0
13 years 1 month ago #11859

this is very weird. I will have to investigate further.

I edited the listing_img_title file (with an exit and also just a random echo to see) and it does nothing.

and yet if I look in ftp in com_hiksahop I can see that it is not using that view>product>tmpl file but is pulling from the one in my template>html>product>com_hikashop because in the edited file the price is after the name. I tried placing the code bit in the component one just to see and it doesn't work from there either.

please let me know if you think of anything else (like maybe the table row wasn't called? - I'm just basic in php) and I will update if/when I figure out wtf is going on.

Please Log in or Create an account to join the conversation.

  • Posts: 52
  • Thank you received: 0
13 years 1 month ago #11869

ok I feel like I am losing my mind.

I have dumped every single mod'd file (the four little trash cans) in admin backend. I double checked in ftp and deleted the whole com_hikashop folder from my_template (beez20)>html folder. however, the price is still below the name. I have no idea where that is happening!

I have not only F5'd but even opened a completely new browser just to be sure and it is still loading the name then the price below, like I had mod'd it in the files that are now gone!

Please Log in or Create an account to join the conversation.

  • Posts: 81605
  • Thank you received: 13083
  • MODERATOR
13 years 1 month ago #11870

Maybe you modified directly the listing_img_title.php file in the folder components/com_hikashop/views/product/tmpl ?
Or maybe you're using another template ? Or maybe you have the joomla cache activated (not your browser) in the joomla config ?

Please Log in or Create an account to join the conversation.

  • Posts: 52
  • Thank you received: 0
13 years 1 month ago #11871

nicolas wrote:

Maybe you modified directly the listing_img_title.php file in the folder components/com_hikashop/views/product/tmpl ?

TRIPLE checking that now

Or maybe you're using another template ?

nope sure on that (and even though sure, checked every template folder to be sure, lol)

Or maybe you have the joomla cache activated (not your browser) in the joomla config ?

nope I never use that but even did the purge expired cache to be sure.

now you see why I say I feel like I am losing my mind. lol

Last edit: 13 years 1 month ago by dontflinch.

Please Log in or Create an account to join the conversation.

  • Posts: 52
  • Thank you received: 0
13 years 1 month ago #11872

ok, I finally deleted the entire listing_img_title.php file and didn't break anything so I looked in listing_title and voila. that's where I made the edit I guess? I added the echo $this->row->product_code; there and bingo it worked. that's what I get for flailing around in the code late at night. hahaa

thanks for your help.

Please Log in or Create an account to join the conversation.

  • Posts: 81605
  • Thank you received: 13083
  • MODERATOR
13 years 1 month ago #11875

I'm glad you figured it out :)

Please Log in or Create an account to join the conversation.

Time to create page: 0.078 seconds
Powered by Kunena Forum