Vendor's contact information in Checkout Finish step.

  • Posts: 177
  • Thank you received: 5
7 years 3 months ago #257938

-- HikaShop version -- : Demo site
-- HikaMarket version -- : Demo site
-- Joomla version -- : Demo site


How to display for example vendor's phone number/address information in finish checkout page, where order was made.

I will have 30+ vendors and customer should know phone number of vendor, where he ordered.

Attachments:

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

  • Posts: 25994
  • Thank you received: 4004
  • MODERATOR
7 years 3 months ago #257960

Hi,

Like for the addition of "commerce trackers", the customization of that view can be made by changing the "checkout / after_end" or by creating an override for the "end" of the specific payment method (depending which payment you're using).

Now, in that view you will have access to the order ID ; so you can add a little query in order to load the "sub order" and then display the details of the vendor(s).
It requires a small PHP code to put in the view but that is not something really big.

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: 177
  • Thank you received: 5
7 years 3 months ago #258246

Try to cnange checkout / after_end.php and checkout / end.php. Add echo to that files. On last step I see checkout / end.php. How can I get order number? I saw $this in checkout / end.php, but print_r didn't show order number. My PHP is very bad) Which variable contents order number?

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

  • Posts: 25994
  • Thank you received: 4004
  • MODERATOR
7 years 3 months ago #258250

Hi,

In the view "checkout / end" (or "after_end) you will have access to

$this->order
which is the object of the HikaShop (full) order.
In that object you can already access to a lot of details (but not the vendors)
$this->order->order_id

Afterwards, thanks to that order_id, you can load the vendors.
$db = JFactory::getDBO();
$query = 'SELECT hmv.* '.
	' FROM ' . hikashop_table('order'). ' AS hko '.
	' INNER JOIN ' .'#__hikamarket_vendor'. ' AS hmv ON hmv.vendor_id = hko.order_vendor_id '.
	' WHERE hko.order_type = \'subsale\' AND hko.order_parent_id = '. (int)$this->order->order_id .
	' ORDER BY hko.order_id DESC';
$db->setQuery($query);
$vendors = $db->loadObjectList('vendor_id');

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.
The following user(s) said Thank You: alikon1

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

  • Posts: 177
  • Thank you received: 5
7 years 3 months ago #258271

Tried, but $this->order or $this->order->order_id don't display anything.
I'm using "HikaShop collect on delivery payment plugin" and "HikaShop manual shipping plugin".

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

  • Posts: 177
  • Thank you received: 5
7 years 3 months ago #258274

Order id shows only in $this->html as html formatted text.

Part of the message is hidden for the guests. Please log in or register to see it.

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

  • Posts: 177
  • Thank you received: 5
7 years 3 months ago #258275

Disable in configuration "Advanced checkout workflow edition".
My Checkout workflow looks like: cart_status_shipping_payment_fields_confirm,end.
All customers are guests without registration.

Last edit: 7 years 3 months ago by alikon1.

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

  • Posts: 25994
  • Thank you received: 4004
  • MODERATOR
7 years 3 months ago #258272

Hi,

Okay, so you need to override the collect on delivery "end" view.
In that view there is no access to the order object ; but if you perform a little modification in the plugin (that I will add in HikaShop 3 too), you will gain that access.

In the plugin you need to replace :

		$this->order_number = $order->order_number;

		$this->showPage('end');
By
		$this->order_number = $order->order_number;
		$this->order = $order;

		$this->showPage('end');

And then, for the override of the view "collectondelivery_end.php", you have copy the plugin file into :
/templates/YOUR_TEMPLATE/hikashoppayment/collectondelivery_end.php

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.
The following user(s) said Thank You: alikon1

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

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