- Posts: 424
- Thank you received: 11
How to get vendor adress in product/listing.php view.
- BluepointWebdesign
-
Topic Author
- Offline
Less
More
5 years 3 months ago #333623
by BluepointWebdesign
-- 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
-- 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
Please Log in or Create an account to join the conversation.
5 years 3 months ago #333627
by nicolas
Replied by nicolas on topic How to get vendor adress in product/listing.php view.
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 ?
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.
- BluepointWebdesign
-
Topic Author
- Offline
Less
More
- Posts: 424
- Thank you received: 11
5 years 3 months ago #333647
by BluepointWebdesign
Replied by BluepointWebdesign on topic How to get vendor adress in product/listing.php view.
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.
Really hope you can help..
Thanks.
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.
- BluepointWebdesign
-
Topic Author
- Offline
Less
More
- Posts: 424
- Thank you received: 11
5 years 3 months ago #333648
by BluepointWebdesign
Replied by BluepointWebdesign on topic How to get vendor adress in product/listing.php view.
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.
5 years 3 months ago #333650
by nicolas
Replied by nicolas on topic How to get vendor adress in product/listing.php view.
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
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.
- BluepointWebdesign
-
Topic Author
- Offline
Less
More
- Posts: 424
- Thank you received: 11
5 years 3 months ago #333704
by BluepointWebdesign
Replied by BluepointWebdesign on topic How to get vendor adress in product/listing.php view.
Hi Nicolas,
I am busy with implementing your simpler approach.
I moved the button to the product / listing.php with this code:
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
I am busy with implementing your simpler approach.
I moved the button to the product / listing.php with this code:
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 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.
- BluepointWebdesign
-
Topic Author
- Offline
Less
More
- Posts: 424
- Thank you received: 11
5 years 3 months ago #333705
by BluepointWebdesign
Replied by BluepointWebdesign on topic How to get vendor adress in product/listing.php view.
Please Log in or Create an account to join the conversation.
5 years 3 months ago #333713
by nicolas
Replied by nicolas on topic How to get vendor adress in product/listing.php view.
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.
$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.
- BluepointWebdesign
-
Topic Author
- Offline
Less
More
- Posts: 424
- Thank you received: 11
5 years 3 months ago #333752
by BluepointWebdesign
Replied by BluepointWebdesign on topic How to get vendor adress in product/listing.php view.
Hi Nicolas,
You've guided me the right way.. Thank you very much,
This works as a charme..
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.
- BluepointWebdesign
-
Topic Author
- Offline
Less
More
- Posts: 424
- Thank you received: 11
5 years 3 months ago #333967
by BluepointWebdesign
Replied by BluepointWebdesign on topic How to get vendor adress in product/listing.php view.
Please Log in or Create an account to join the conversation.
5 years 3 months ago #333997
by Jerome
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Replied by Jerome on topic How to get vendor adress in product/listing.php view.
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,
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.
Please Log in or Create an account to join the conversation.
Time to create page: 0.192 seconds