add "product_manufacturer_id"

  • Posts: 11
  • Thank you received: 0
9 years 5 months ago #233737

-- 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

Attachments:
Last edit: 9 years 5 months ago by arthurk.

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

  • Posts: 26264
  • Thank you received: 4043
  • MODERATOR
9 years 5 months ago #233749

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.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

  • Posts: 193
  • Thank you received: 76
9 years 5 months ago #233813

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.

  • Posts: 11
  • Thank you received: 0
9 years 4 months ago #233873

@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

Attachments:

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

  • Posts: 193
  • Thank you received: 76
9 years 4 months ago #233875

I was confused, because product_manufacturer_id is numeric value.

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

At the start of the file, right after

defined('_JEXEC') or die('Restricted access');
insert this 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
<?php if($this->params->get('show_vote_product')){ ?>
insert this code (header of the table)
<th class="hikashop_product_manufacturer">Artist</th>

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

insert this
                    <?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: 9 years 4 months ago by korzo.

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

  • Posts: 11
  • Thank you received: 0
9 years 4 months ago #233965

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

Attachments:

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

  • Posts: 11
  • Thank you received: 0
9 years 4 months ago #233980

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.

  • Posts: 11
  • Thank you received: 0
9 years 4 months ago #233982

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.

  • Posts: 193
  • Thank you received: 76
9 years 4 months ago #233983

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:
https://gist.githubusercontent.com/korzo/e12d89316af88a8e2298/raw/bd69d7adfe61fb00fa0a2b2a9040fee7574cdc3a/listing_table.php

Last edit: 9 years 4 months ago by korzo.

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

  • Posts: 11
  • Thank you received: 0
9 years 4 months ago #234371

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.

  • Posts: 193
  • Thank you received: 76
9 years 4 months ago #234388

Manufacturers are stored in table hikashop_category.

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

  • Posts: 84233
  • Thank you received: 13675
  • MODERATOR
9 years 4 months ago #234401

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.

  • Posts: 11
  • Thank you received: 0
9 years 4 months ago #234632

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.

  • Posts: 13201
  • Thank you received: 2322
9 years 4 months ago #234708

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.

  • Posts: 13201
  • Thank you received: 2322
9 years 4 months ago #234756

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.

  • Posts: 11
  • Thank you received: 0
9 years 4 months ago #234796

Thanks Xavier!

Great and quick support.

Arthur

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

Time to create page: 0.118 seconds
Powered by Kunena Forum