Vendor ACL not working for Vendor page for viewing

  • Posts: 28
  • Thank you received: 1
9 years 8 months ago #198436

-- HikaShop version -- : 2.4.0
-- HikaMarket version -- : 1.6.2
-- Joomla version -- : 3.4.0
-- PHP version -- : 5.4.38
-- Browser(s) name and version -- : Safari 8.0.5(Mac), Chrome (Mac) 41.0.2272.118 (64-bit)
-- Error-message(debug-mod must be tuned on) -- : Vendor ACL not working for Vendor page for viewing orders

My goal is to remove any information relating to the billing and shipping address for each order from the vendor's order detail page and the invoice as well.

Because shipping address will always be different from the billing address for our orders, and the fact that the system default is to force the shipping address to show the same info as the billing's, we have decided to remove both from the Checkout completely. And because we prefer to not give away the customer's information to our vendors, I would like to remove vendor's access to this information. We are even removing the 'Customer' field from order detail page because it contains the customer's email address, unfortunately.

For some reason in hikamarket, there are two ACL areas and they are both name sort of similar. I tried to disable but both of them separately, and at the same time, but none of these are removing the 'billing', 'shipping' or the 'customer' fields from vendor's order details or the invoice. Am I doing something wrong? Please have a look at the screenshot for further information.





Attachments:

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

  • Posts: 26166
  • Thank you received: 4029
  • MODERATOR
9 years 8 months ago #198472

Hi,

Thanks for your feedback.

I am currently working on an improvement of the display of the order in the HikaMarket front-end.
For the moment, the order page is the same if you're a vendor or if you're a admin ; but when you're a vendor you can't edit a lot of elements so the interface is not like I want it today.

The ACL for the order edition is just for the right to edit parts of the order.
The idea is to give more rights to vendor in the future version of HikaMarket even if for the moment the vendor can just edit the order status.

If you want to hide the address, there is no ACL for that but you can use a view override to fix that.
Your idea is a good idea and I will add in a future release (the release with the new order display) settings for that.

In the view "ordermarket | show", you will find the display of the addresses.
You can replace

	<tr>
		<td class="hikam_block_l">
			<fieldset class="hikam_field" id="hikamarket_order_field_billing_address">
By
<?php if($this->vendor->vendor_id <= 1) { ?>
	<tr>
		<td class="hikam_block_l">
			<fieldset class="hikam_field" id="hikamarket_order_field_billing_address">

And also replace
	</tr>
	<tr>
		<td colspan="2">
			<fieldset class="hikam_field" id="hikamarket_order_products">
By
	</tr>
<?php } ?>
	<tr>
		<td colspan="2">
			<fieldset class="hikam_field" id="hikamarket_order_products">

And the addresses won't be display anymore for the vendors.

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.

  • Posts: 28
  • Thank you received: 1
9 years 8 months ago #198729

Hi Jerome:

That is working nicely. Since my post I have worked out a way to use the hockshop's built-in Shipping address, so your code have allow the vendor's view to show shipping address and not billing address. So thank you so much for that!

I have two questions:

1) With the INVOICE that is available inside the order view in Vendor Control, how can I remove the billing address and show the Shipping Address instead?

2) Is there anyway possible to show the Product Image on the order screen and the invoice as well?

3) I notice that there is a Main Order's Order Number, and a Hikamarket's Order's Order Number. In Joomla, only the Main Order's Order Number can be searched to locate orders. I know that inside the Main Order's Order detail, I can find the link to the Hikamarket's Order's Order Number...but in Vendor Control, only the Hikamarket's Order Number is displayed. This will get very confusing, especially when we have to locate an order in the system. Could we have the Main Order's Order Number displayed in the vendor control, their invoice as well?

(Perhaps you could consider giving these numbers a unique name for future release, for example: Main Orders: Main Order Number, Hikamarket: Market Order Number)

3) For order listing, I have only managed to turn off the billing address's email. Could you tell me how to remove the billing address city and country from the listing. I would like to show these in the listing if possible: the shipping address's customer first and last name, and the 'date for delivery'.




Attachments:

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

  • Posts: 26166
  • Thank you received: 4029
  • MODERATOR
9 years 8 months ago #198749

Hi,

1/ The invoice is displayed by the view "ordermarket | invoice".
You can use the same kind of override to hide the addresses.

2/ The product image will be added in the next HikaMarket release ; we are working on a new design for the vendor orders and we already added in the product image in the future version.
In the "ordermaket | show_products" view, just before the "foreach" on the order products, you have to add the code

if(empty($this->db))
	$this->db = JFactory::getDBO();
if(empty($this->imageHelper))
	$this->imageHelper = hikamarket::get('shop.helper.image');
$product_ids = array();
$this->product_images = array();
foreach($this->order->products as $k => $product) {
	if(!empty($product->product_id))
		$product_ids[(int)$product->product_id] = (int)$product->product_id;
}
if(!empty($product_ids)) {
	$this->db->setQuery('SELECT * FROM '.hikamarket::table('shop.file').' WHERE file_ref_id IN ('.implode(',', array_keys($product_ids)).') AND file_type=\'product\' ORDER BY file_ref_id ASC, file_ordering ASC, file_id ASC');
	$images = $this->db->loadObjectList();
}
if(!empty($images)) {
	foreach($images as $image) {
		if(isset($this->product_images[(int)$image->file_ref_id]))
			continue;
		$this->product_images[(int)$image->file_ref_id] = new stdClass();
		foreach(get_object_vars($image) as $key => $name) {
			$this->product_images[(int)$image->file_ref_id]->$key = $name;
		}
	}
}
Then, in the foreach, you can display a product image using
		if(isset($this->product_images[(int)$product->product_id])) {
			$thumb = $this->imageHelper->getThumbnail(@$this->product_images[(int)$product->product_id]->file_path, array(50,50), array('default' => 1, 'forcesize' => 1));
			if(!empty($thumb->path))
				echo '<img src="'. $this->imageHelper->uploadFolder_url . str_replace('\\', '/', $thumb->path).'" alt="" class="hikam_imglist" />';
		}

3/ At this moment, I will suggest you to use the option "Use same order number for sub-orders"
www.hikashop.com/support/documentation/1...onfig_market_general
But I will take your interesting idea for some future improvements.

4/ In the order listing, the addresses are displayed using this code
if(!empty($order->order_shipping_address_id)) {
	$full_address = $this->addressClass->maxiFormat($this->addresses[(int)$order->order_shipping_address_id], $this->address_fields, true);
	$country = $this->addressClass->miniFormat($this->addresses[(int)$order->order_shipping_address_id], $this->address_fields, '{address_city}, {address_state_code_3} {address_country_code_3}');
	echo hikamarket::tooltip($full_address, JText::_('HIKASHOP_SHIPPING_ADDRESS'), '', $country, '', 0);
}
You can remove the use of hikamarket::tooltip and just echo the address miniFormat.
For that specific functinon, the last parameter is the format used for the address. If you want to display the address_firstname and address_lastname ; you just have to put them instead of the current city, state and country.

About the date of delivery, because it's an order custom field, you can display it directly ; you will find the information in the order object. Depending the custom field type you're using (advanced date picker), you might need to use the HikaShop field class to display the date with a good format.

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.

  • Posts: 28
  • Thank you received: 1
9 years 8 months ago #199436

Hi Jerome:

Wonderful. Can't wait to see future updates of Hikashop, sounds like you guys always have so much more to come!

I'm always amazed with how well your suggestions work and how (not too difficult) they are to implement even for me. Thanks for the help!

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

Moderators: Obsidev
Time to create page: 0.060 seconds
Powered by Kunena Forum