How to get vendor adress in product/listing.php view.

  • Posts: 386
  • Thank you received: 7
  • Hikashop Business
2 years 10 months ago #333623

-- HikaShop version -- : 4.4.2
-- Joomla version -- : 3.9.26
-- PHP version -- : 7.4

Hi,
In the old threads there is spoken of getting phone number etc. on the product views e.g. (product_listing_table or product_listing_img).
But what i would like is to have a button next to the filter( see screenshot) to show the information as adress phonenumber name etc. from this vendors product_listing in a pop up. So it is directly after pushing the button visible publicly in a pop up screen. How can i accomplish that??



I now have this code in the prduct/filter.php but then it says : vendor does not exists.


Hope you can help
Thanks

Attachments:

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

  • Posts: 81504
  • Thank you received: 13064
  • MODERATOR
2 years 10 months ago #333627

Hi,

Well, on a products listing, you can have products from different vendors displayed. How do you know which vendor to use for that button ?
Or you configured your products to only have products of the same vendor in each category of your shop ?
Also, could you provide a link to the page from your screenshot so that we can check on the situation there ?

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

  • Posts: 386
  • Thank you received: 7
  • Hikashop Business
2 years 10 months ago #333647

Hi,

I know that mostly a product listing can have that. But we configured the joomla environment so that the different product listing pages only contains one vendor. As you said also configured the categories only to one vendor and so the menu items product listings in a special group and asigned to one vendor.

This message contains confidential information


Really hope you can help..
Thanks.

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

  • Posts: 386
  • Thank you received: 7
  • Hikashop Business
2 years 10 months ago #333648

The views i alterd for this plus sign is in template: halaltimebestellen and product / filter.php

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

  • Posts: 81504
  • Thank you received: 13064
  • MODERATOR
2 years 10 months ago #333650

Hi,

It's going to be hard to do in product / filter.php
Basically, you need to:
- load the settings of the current menu item ( stackoverflow.com/questions/13952199/joo...3-get-the-menu-title )
- get the id of the current category from there and run a MySQL query to load a product from that category with a left join between the hikashop_product an the hikashop_product_category tables.
- use the product_vendor_id of the product in the URL of the link.
- you also need to add the &tmpl=component parameter to your link URL so that it only displays the component area in the popup and not the whole template.
A way simpler approach would be to move that button to product / listing.php. There, you can directly access the product_vendor_id of the first product of the listing like so: reset($this->rows)->product_vendor_id

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

  • Posts: 386
  • Thank you received: 7
  • Hikashop Business
2 years 9 months ago #333704

Hi Nicolas,

I am busy with implementing your simpler approach.
I moved the button to the product / listing.php with this code:

<?php
$popupHelper = hikashop_get('helper.popup');
echo ' '.$popupHelper->display(
'<i class="hikabtn" style="background: transparent; border-color: #3182CE;" ><img src="/images//Plusje.png"/></i>',
'HIKASHOP_EDIT_CART_PRODUCT',
$link = hikamarket::completeLink('vendor&task=show&cid=' . $this->row->vendor->vendor_id . '&name=' . $this->row->vendor->alias . $url_itemid . '&tmpl=component'),
'edit_cart_product',
600, 600, 'title="'.JText::_('CHOOSE_OPTIONS').'"', '', 'link'
);

?>
But still no success of finding the vendor information.
But when i do the same in the product / listing_table.php
i get the information neatly in a pop up except the first one? very strange.
see screenshot.
What am i doing wrong for the pop up to work in the products / listing_php and not in the listing_table?

Thanks

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

  • Posts: 386
  • Thank you received: 7
  • Hikashop Business
2 years 9 months ago #333705

forgot the screenshot. :)

Attachments:

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

  • Posts: 81504
  • Thank you received: 13064
  • MODERATOR
2 years 9 months ago #333713

Hi,

$this->row is initialized with the line:
$this->row =& $row;
inside the foreach loop on all the products stored in $this->rows in listing_table.php
So if you have your code before that line, you won't get anything in $this->row.
You'll get it the second time you arrive in listing_table.php because it will be the left over of the first loop and thus you'll actually have the data of the last product of the previous category.
That's why I suggested to use instead reset($this->rows) which will give the data of the first product of the current category, regardless of where you put your code in the views of the listing.

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

  • Posts: 386
  • Thank you received: 7
  • Hikashop Business
2 years 9 months ago #333752

Hi Nicolas,

You've guided me the right way.. Thank you very much,
This works as a charme.. :)

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

  • Posts: 386
  • Thank you received: 7
  • Hikashop Business
2 years 9 months ago #333967

Hi,

Another question about triggering the vendor name in a listing this time i would like to get it in the ordermarket/listing.php how can i do that?



Hope you can help once again.. :)

Thanks
Mark

Attachments:

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

  • Posts: 26000
  • Thank you received: 4004
  • MODERATOR
2 years 9 months ago #333997

Hello,

Even if you're in the HikaMarket front-end, the listing you have is an "HikaShop" order listing.
The same kind of order listing you have in the HikaShop backend.

Because an HikaShop order can have multiple sub-orders (and so, multiple vendors), you can't extract one vendor name for one order.
Even if you're using the vendor limitation in the cart, you can't be sure that you won't have orders with multiple vendors.

If we're talking about "code", you'll have to load the sub-orders in order to get the vendors for the customer order and display them.
It requires to perform an SQL query and load the corresponding data to be able to display that.
Such modification needs development skills.

Regards,


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.

Time to create page: 0.083 seconds
Powered by Kunena Forum