Skip to main content

add "product_manufacturer_id"

More
10 years 6 months ago - 10 years 6 months ago #233737 by arthurk
-- url of the page with the problem -- : arthurk.nl/orkestbanden/index.php/catego...tels-a-z-engelstalig
-- HikaShop version -- : HikaShop Starter 2.6.1,
-- Joomla version -- : 3.4.8
-- PHP version -- : 5.6.17
-- Browser(s) name and version -- : Chrome
-- Error-message(debug-mod must be tuned on) -- : none

Hello, my first time for working with Hikashop.
Can you tell me how i can put "product_manufacturer_id" in the same row as "product_name" (see img)

I am trying to fix it in "components/com_hikashop/views/category/tmpl", tried several files but no results.

Link

thank you
Arthur
Last edit: 10 years 6 months ago by arthurk.

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

More
10 years 6 months ago #233749 by Jerome
Hi,

Please read that documentation :
www.hikashop.com/support/documentation/1...-display.html#layout

And please understand that if your listing is a product listing ; you have to perform an override (and not modify files directly) for the products ; not the categories.

Regards,

PS : With our support ticket system ; more you edit your own post, more you would wait for an answer from the support.

Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

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

More
10 years 6 months ago #233813 by korzo
Replied by korzo on topic add "product_manufacturer_id"
Do you want to display product_manufacturer_id, manufacturer name or link to manufacturer listing?

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

More
10 years 6 months ago #233873 by arthurk
@Jerome, sorry for the edits, the links where broken so i changed it in the post. tnx for pointing to the doc file.

@Korzo, let me try to explain what i want.
I have a csv file with mp3 data. Hikashop is the only shop i can find where i can import that list (for free)
Take a look to img1, i found out that this way of importing it will set the data to the fields in img2.
So if i can place the field "Brand" after "Name" in the tabel then i can try to find a way when you select the artist that all his songs come in a list.

I used the menu option Categories Listing, and set by products "Tabel"

Sorry for the bad English :-)

Arthur

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

More
10 years 6 months ago - 10 years 6 months ago #233875 by korzo
Replied by korzo on topic add "product_manufacturer_id"
I was confused, because product_manufacturer_id is numeric value.

At first create override of file listing_table.php in product view
hikashop.com/support/documentation/153-c...-display.html#layout

At the start of the file, right after
Code:
defined('_JEXEC') or die('Restricted access');
insert this code
Code:
if (!function_exists('get_manufacturer')) { function get_manufacturer ($product) { static $manufacturers = array(); if (empty($product->product_manufacturer_id)) { return false; } if (isset($manufacturers[$product->product_manufacturer_id])) { return $manufacturers[$product->product_manufacturer_id]; } $catclass = hikashop_get('class.category'); $manufacturer = $catclass->get($product->product_manufacturer_id); if ($manufacturer->category_published) { $menuclass = hikashop_get("class.menus"); $manufacturer_itemid = $menuclass->loadAmenuItemId('manufacturer', 'listing'); if (empty($manufacturer_itemid)) { $manufacturer_itemid = $menuclass->loaddAmenuItemId('', ''); } $catclass->AddAlias($manufacturer); $manufacturer->url = hikashop_contentLink('category&task=listing&cid='.$manufacturer->category_id.'&name=' .$manufacturer->alias.'&Itemid='.$manufacturer_itemid, $manufacturer); $manufacturers[$product->product_manufacturer_id] = $manufacturer; return $manufacturer; } return false; } }

On the line cca 81 before
Code:
<?php if($this->params->get('show_vote_product')){ ?>
insert this code (header of the table)
Code:
<th class="hikashop_product_manufacturer">Artist</th>

On the line cca 200 before
Code:
<?php if($this->params->get('show_vote_product')){ ?>

insert this
Code:
<?php $artist = get_manufacturer($row); echo '<td class="hikashop_product_manufacturer" >'; if ($artist) { //echo $artist->category_name; echo '<a href="'.$artist->url.'">'.$artist->category_name.'</a>'; } echo '</td>'; ?>

It will display link to brand/artist page.
If you want to display only brand name, move // one line down.

Here is link to modified file ( changes ).
Last edit: 10 years 6 months ago by korzo.

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

More
10 years 6 months ago #233965 by arthurk
Hey Korzo, great that you made the coding but the result looks like the image.

Maybe i did or understand something wrong.
I go to Hikashop/display
choose protostar template/Iproduct / listing_table.php
then copy and paste your code (from the link)

Arthur

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

More
10 years 6 months ago #233980 by arthurk
ok, i put in the code paece by peace and that looks better now, colomname Artist is there but no artist name was filled in.

Arthur

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

More
10 years 6 months ago #233982 by arthurk
so it's official, i am confused to!
When i import a csv file like i discribed before the product_manufacturer_id filled in the artist name in the Brand field
Now i did a export from hikashop and the id shows numbers?

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

More
10 years 6 months ago - 10 years 6 months ago #233983 by korzo
Replied by korzo on topic add "product_manufacturer_id"
product_manufacturer_id should be numeric id of manufacturer, but Hikashop is smart enough to figure out there is name instead of id.
Code I posted should work as it's working on my website.
If you have no other modification, you can copy whole file from here:
gist.githubusercontent.com/korzo/e12d893...3a/listing_table.php
Last edit: 10 years 6 months ago by korzo.

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

More
10 years 6 months ago #234371 by arthurk
ok, but there must be a relationship between the number and name i guess
Hikashop shows the name in product specs.
How can i resolve the name thats connected to the numbers.
In phpmyadmin i cant find anything thats related to each other.

grtz Arthur

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

More
10 years 6 months ago #234388 by korzo
Replied by korzo on topic add "product_manufacturer_id"
Manufacturers are stored in table hikashop_category.

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

More
10 years 6 months ago #234401 by nicolas
Hi,

The brand is stored in the hikashop_category table and the category_id of the row of the brand there is used in the product_manufacturer_id column of the hikashop_product table to link the brand and the product together.
The following user(s) said Thank You: arthurk

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

More
10 years 6 months ago #234632 by arthurk
Thank you guy's but it's still not working.

I copy'd all the code, made a new joomla instal, new hikashop install but what ever i try, no output on that field.

Can somebody take a look in my admin why i'ts not working?

tnx
Arthur

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

More
10 years 6 months ago #234708 by Xavier
Hi,

You can send a backend access via our contact form: www.hikashop.com/support/contact-us.html
Don't forget to give the link to that topic in your message.

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

More
10 years 6 months ago #234756 by Xavier
Done ;)
You can see the modifications in the view "product / listing_table".
The following user(s) said Thank You: arthurk

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

More
10 years 6 months ago #234796 by arthurk
Thanks Xavier!

Great and quick support.

Arthur

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

Time to create page: 0.312 seconds
Powered by Kunena Forum