No redirect URL option for Purchase Orders

  • Posts: 86
  • Thank you received: 11
  • Hikashop Business
8 years 3 months ago #247285

-- HikaShop version -- : 2.6.3
-- Joomla version -- : 3.6.2

There is a redirect upon success option for other payment methods but not the Purchase Order method. So users are just stuck on the confirm order page after checking out. Can you help adding that function?

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

  • Posts: 4747
  • Thank you received: 644
  • MODERATOR
8 years 3 months ago #247318

Hello,

You can add a redirection button in the file purchaseorder_end.php, more precisely here :

<span class="hikashop_purchaseorder_end_message" id="hikashop_purchaseorder_end_message">
<?php echo JText::_('ORDER_IS_COMPLETE').'<br/>'.
$this->information.'<br/>'.
JText::_('THANK_YOU_FOR_PURCHASE');?>
ADD YOU REDIRECT BUTTON HERE
</span>


Hope this will help you.

Regards

Last edit: 8 years 3 months ago by Philip.

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

  • Posts: 86
  • Thank you received: 11
  • Hikashop Business
8 years 3 months ago #247454

I'm sorry where is that file located? Is there a way to make it a template override?

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

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
8 years 3 months ago #247458

Hi,

The file is located within the purchaseorder plugin folder.
You can perform an override by copying the "purchaseorder_end.php" file into the folder:

templates/YOUR_TEMPLATE/hikashoppayment/

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: 86
  • Thank you received: 11
  • Hikashop Business
8 years 3 months ago #247529

So I think this plugin is mostly setup with this line:

if(!empty($this->payment_params->return_url)){
	$doc = JFactory::getDocument();
	$doc->addScriptDeclaration("window.hikashop.ready( function() {window.location='".$this->payment_params->return_url."'});");
}

But there is no field within the admin side to set a return url. How can I add the return url?

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

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
8 years 3 months ago #247530

Hi,

In the plugin main file, you can replace the configuration variable with

	var $pluginConfig = array(
		'order_status' => array('ORDER_STATUS', 'orderstatus'),
		'status_notif_email' => array('ORDER_STATUS_NOTIFICATION', 'boolean','0'),
		'information' => array('CREDITCARD_INFORMATION', 'big-textarea'),
		'return_url' => array('RETURN_URL', 'input')
	);
so you will have the "return_url" parameter available.

We will add that parameter in our side for a future release.

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: 215
  • Thank you received: 6
  • Hikashop Business
8 years 1 month ago #252923

this is doesnot work

i copied purchaseorder_end.php to the templates/YOUR_TEMPLATE/hikashoppayment/
but nothing changed - hikashop still use default plugin

also how to include my own plugin ?

i want to take bank transfer and change it - i mean i need 2 bank transfers with diffrent names

Jerome wrote: Hi,

The file is located within the purchaseorder plugin folder.
You can perform an override by copying the "purchaseorder_end.php" file into the folder:

templates/YOUR_TEMPLATE/hikashoppayment/

Regards,

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

  • Posts: 215
  • Thank you received: 6
  • Hikashop Business
8 years 1 month ago #252937

Hi,
i need to send POST data to an outside url from my hikashop
they are 5 strings - information abour order - order id , amount, and cart items

to make my 5 strings i need to obtain

$this->amount
$order->order_full_price,
$order->order_currency_id
$order->order_number
also i need product name and quantity from cart

there is a function in payments plugins called function onAfterOrderConfirm(&$order,&$methods,$method_id)
is it possible to obtain this data in this function ?
and to POST it to outside url and after that to return back to hikashop

i need it to send information to a payment gate to make payment from visa cards

for example i want to change banktranfert payment plugin

banktransfer.php
bamktransfer_end.php

so if i change body of function onAfterOrderConfirm in banktransfer.php
is it possible to send POST data to outside url (it means to open url in new tab)
and after success payment return back into bamktransfer_end.php
to show user - you order is succefully paid

or i need to make button in banktransfer_end.php after order had created ?

or how to ?

thank you

Philip wrote: Hello,

You can add a redirection button in the file purchaseorder_end.php, more precisely here :

<span class="hikashop_purchaseorder_end_message" id="hikashop_purchaseorder_end_message">
<?php echo JText::_('ORDER_IS_COMPLETE').'<br/>'.
$this->information.'<br/>'.
JText::_('THANK_YOU_FOR_PURCHASE');?>
ADD YOU REDIRECT BUTTON HERE
</span>


Hope this will help you.

Regards

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
8 years 1 month ago #252941

Hi,

From what you're saying, it looks like you want to make a standard payment plugin liek the ones integrating with a payment gateway.
So you want to have your redirect in the onAfterOrderConfirm.
In standard payment plugins, the end file is actually called by the onAfterOrderConfirm function. So whether you put the redirect in one or the other, it doesn't change anything.
I would recommend to have a look at our developer documentation:
www.hikashop.com/support/documentation/6...r-documentation.html
We have an example payment plugin you can use to understand how it works and what to do.

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

  • Posts: 215
  • Thank you received: 6
  • Hikashop Business
8 years 3 weeks ago #254229

Hi, thanks - that is i need

could you explain please:
there are 3 url in paypal.php also in my plugin

$notify_url .....
$return_url ....
$cancel_url ....

what is the difference beetween notify_url and return_url ?

is it right what onPaymentNotification(&$statuses) will call if $notify_url is declared ?

p.s. in my paymentgate provider use PostLink to send xml data on 80 or 443 port during payment procedure to send specific data
this data contains information about payment status
is it right to declare PostLink as a $notify_url <input type hidden name=PostLink values=$notify_url>
and to use onPaymentNotification to make any staff with this data ?

i cut some code from paypal.php and included it to my plugin
decalared PostLink as a notify_url
and tried to echo on screen POST data but nothing on screen

	function onPaymentNotification(&$statuses) {
		$vars = array();
		$data = array();
		$filter = JFilterInput::getInstance();
		foreach($_REQUEST as $key => $value) {
			$key = $filter->clean($key);
			if(preg_match('#^[0-9a-z_-]{1,30}$#i', $key) && !preg_match('#^cmd$#i', $key)) {
				$value = JRequest::getString($key);
				$vars[$key] = $value;
				$data[] = $key . '=' . urlencode($value);
			}
		}
		$data = implode('&', $data) . '&cmd=_notify-validate';
		$dbOrder = $this->getOrder((int)@$vars['invoice']);
		$this->loadPaymentParams($dbOrder);
		if(empty($this->payment_params))
			return false;
		$this->loadOrderData($dbOrder);
		if(!$this->payment_params->notification)
			return false;
		[b]echo print_r($vars, true) . "\r\n\r\n";[/b]
		if(empty($dbOrder)) {
			echo 'Could not load any order for your notification ' . @$vars['invoice'];
			return false;
		}
		[b]echo print_r($dbOrder, true) . "\r\n\r\n";[/b]
		$order_id = $dbOrder->order_id;
}

nicolas wrote: Hi,

From what you're saying, it looks like you want to make a standard payment plugin liek the ones integrating with a payment gateway.
So you want to have your redirect in the onAfterOrderConfirm.
In standard payment plugins, the end file is actually called by the onAfterOrderConfirm function. So whether you put the redirect in one or the other, it doesn't change anything.
I would recommend to have a look at our developer documentation:
www.hikashop.com/support/documentation/6...r-documentation.html
We have an example payment plugin you can use to understand how it works and what to do.

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
8 years 3 weeks ago #254231

Hi,

1. The notify_url is the URL used by the PayPal server to notify the payment plugin that the payment has been made. The return_url is the URL where PayPal redirects the customer at the end of the payment so that he can go back to your website.

2. Yes, onPaymentNotification will be called in your plugin if you use the notify_url

3. Yes, you want to use the notify_url as PostLink from what I understand and use the onPaymentNotification function to change the status of the orders to confirmed, like it's done in the example payment plugin.

4. Note that the onPaymentNotification automatically logs what you echo in the payment log file of HikaShop that you can find under the "Files" section of the HikaShop configuration. That's because that notify_url is usually called by the payment gateway so if you try displaying something, it would actually be sent to the payment gateway, which doesn't care about it and even worst, might create a problem.

The following user(s) said Thank You: Bender

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

  • Posts: 215
  • Thank you received: 6
  • Hikashop Business
8 years 1 week ago #255369

how to obtain manufacturer name if i know product_manufactuter_id ?

Last edit: 8 years 1 week ago by Bender.

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
8 years 1 week ago #255378

Hi,

You can do like that:

$class = hikashop_get('class.category');
$brand = $class->get($product_manufactuter_id);
echo $brand->category_name;

The following user(s) said Thank You: Bender

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

  • Posts: 215
  • Thank you received: 6
  • Hikashop Business
7 years 9 months ago #261153

Hi,
after update my hikashop to version 3.0 i got following warning and error messages

warning Could not copy the file from /var/www/............/components/com_hikashop/extensions/plg_hikashoppayment_creditcard/creditcard_end.php to /var/www/........./plugins/hikashoppayment/creditcard/creditcard_end.php

error Could not copy the file from /var/www/....../components/com_hikashop/extensions/plg_hikashoppayment_purchaseorder/purchaseorder_end.php to /var/www/....../plugins/hikashoppayment/purchaseorder/purchaseorder_end.php

is it because i have changes in these files or why so ?
what should i do ?

the second question is - how to configure infinite scroll ? i switched it on module configuration but it does not work correctly
i see message - "loading" but data do not load (i have 4x4 table and more than 100 products in category)

also the print button disappered on the checkout page and from my orders in user control centre -
how to return ?
thanks

Last edit: 7 years 9 months ago by Bender.

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

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
7 years 9 months ago #261197

Hi,

These errors are related to your hosting and write permissions ; I'm afraid there is no link with HikaShop.

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: 215
  • Thank you received: 6
  • Hikashop Business
7 years 9 months ago #261259

ok i see
what about infinite scrolls ?
how to check ?

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
7 years 9 months ago #261262

Hi,

Hard to say. Could you provide a link to the page with the issue so that we can have a look ?

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

  • Posts: 215
  • Thank you received: 6
  • Hikashop Business
7 years 9 months ago #261325

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

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
7 years 9 months ago #261340

Hi,

In the view "product / listing_div", please replace

var url = 'index.php?option=com_hikashop&ctrl=product&task=listing&cid=<?php echo (int)$this->pageInfo->filter->cid; ?>&limitstart=HIKAPAGE<?php echo $filters_params; ?>&Itemid=<?php echo (int)$Itemid; ?>&tmpl=ajax';
By
var url = '<?php echo HIKASHOP_LIVE; ?>index.php?option=com_hikashop&ctrl=product&task=listing&cid=<?php echo (int)$this->pageInfo->filter->cid; ?>&limitstart=HIKAPAGE<?php echo $filters_params; ?>&Itemid=<?php echo (int)$Itemid; ?>&tmpl=ajax';
It should fix your issue.

In our side we will see to integrate a similar patch and upload new HikaShop 3 packages.

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: 215
  • Thank you received: 6
  • Hikashop Business
7 years 9 months ago #261469

no effect - still does not work

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

Time to create page: 0.114 seconds
Powered by Kunena Forum