After_End must be messed up as i got an error mess

  • Posts: 92
  • Thank you received: 0
10 years 2 months ago #192169

-- url of the page with the problem -- : arma15.com/products/checkout/step/step-2
-- HikaShop version -- : 2.3.5
-- Joomla version -- : 3.4.0
-- Error-message(debug-mod must be tuned on) -- :

(function() {
var _fbq = window._fbq || (window._fbq = []);
if (!_fbq.loaded) {
var fbds = document.createElement('script');
fbds.async = true;
fbds.src = '//connect.facebook.net/en_US/fbds.js';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(fbds, s);
_fbq.loaded = true;
}
})();
window._fbq = window._fbq || [];
window._fbq.push();


enqueueMessage( JText::_('THANK_YOU_FOR_PURCHASE') );

After_End plugin must be messed up.

I added a FB script to this to help track conversions sales. My only thought is that some how I must have put the script in the wrong place? The first Screen Shot is of the error I got and it didnt send me to thank you page.

The transaction works and charges the customer it just does not give them a "thank you" page as configured in the after_end.

I also took a screen shot of my after end hopefully we can find the error. Here it is:

<?php
/**
* @package HikaShop for Joomla!
* @version 2.3.5
* @author hikashop.com
* @copyright (C) 2010-2015 HIKARI SOFTWARE. All rights reserved.
* @license GNU/GPLv3 www.gnu.org/licenses/gpl-3.0.html
*/
defined('_JEXEC') or die('Restricted access');
?>
<!-- Facebook Conversion Code for Arma15 checkout -->
<script>(function() {
var _fbq = window._fbq || (window._fbq = []);
if (!_fbq.loaded) {
var fbds = document.createElement('script');
fbds.async = true;
fbds.src = '//connect.facebook.net/en_US/fbds.js';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(fbds, s);
_fbq.loaded = true;
}
})();
window._fbq = window._fbq || [];
window._fbq.push();
</script>
<noscript><img height="1" width="1" alt="" style="display:none" src=" www.facebook.com/tr?ev=6021596052447&cd [value]=0.01&cd[currency]=USD&noscript=1" /></noscript>
<?php
$app = JFactory::getApplication();
$app->enqueueMessage( JText::_('THANK_YOU_FOR_PURCHASE') );




Attachments:

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

  • Posts: 13201
  • Thank you received: 2322
10 years 2 months ago #192186

Hi,

If you remove the script, do you have the 404 error ?
Please try to put the code after the thank you message code.
Could you check if there is no Javascript error present on the page ?

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

  • Posts: 92
  • Thank you received: 0
10 years 2 months ago #192293

I put the facebook code after as you said. Still getting the error. I turned the Java Script tool on and took a screen shot.

Attachments:

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

  • Posts: 83811
  • Thank you received: 13571
  • MODERATOR
10 years 2 months ago #192309

Hi,

I don't think that it comes from the after_end view file and the code you posted looks good.
Your error either comes from the customization of the "end" view file or the end files of the payment plugin you're using.

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

  • Posts: 92
  • Thank you received: 0
10 years 2 months ago #192465

I am not sure the "End" code is messed up as it hasnt been edited in anyway. I took a screen shot of it anyway.

As far as the plugin I took a screen shot of the settings. The only thing I can think is the redirect url is blank but I figured that is only if you want to add a custom redirect url. I took a screen shot of the plug in settings. The DEBUG was turned on could this have affected anything? I turned it off since it doesnt appear to be providing any extra info.



Attachments:
Last edit: 10 years 2 months ago by target4fun.

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

  • Posts: 83811
  • Thank you received: 13571
  • MODERATOR
10 years 2 months ago #192532

Hi,

I've checked your website and I think that it comes from the settings of your PayPal advanced payment method.
Can you check that the URL you entered in the "return URL" parameter there is valid ?
What if you change the "type" option ? Does it help ?

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

  • Posts: 92
  • Thank you received: 0
10 years 2 months ago #192593

I changed the type to form and if you look at the return url it is blank. Should there be something in the return url? Please see screen shot above. I am not sure if the return url has to have something in it or not?

Changed the form "type" back to iframe as it redirected the user to a paypal site which defeats the purpose of that plugin as I want the customer to do it all on my site.

Last edit: 10 years 2 months ago by target4fun.

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

  • Posts: 26234
  • Thank you received: 4036
  • MODERATOR
10 years 2 months ago #193196

Hi,

Please edit your paypal advanced plugin "plugins/hikashoppayment/paypaladvanced/paypaladvanced.php" and update the content of the last function

	function onPaymentConfigurationSave(&$element) {
		parent::onPaymentConfigurationSave($element);
		$secret = $element->payment_params->secret_code;
		if(empty($element->payment_id)) {
			$pluginClass = hikashop_get('class.payment');
			$status = $pluginClass->save($element);
			if(!$status)
				return true;
			$element->payment_id = $status;
		}

		$app = JFactory::getApplication();
		jimport('joomla.filesystem.file');
		jimport('joomla.filesystem.path');
		$lang = JFactory::getLanguage();
		$locale = strtolower(substr($lang->get('tag'),0,2));
		$content = '<?php
		$_GET[\'option\']=\'com_hikashop\';
		$_GET[\'tmpl\']=\'component\';
		$_GET[\'ctrl\']=\'checkout\';
		$_GET[\'task\']=\'notify\';
		$_GET[\'notif_payment\']=\'paypaladvanced\';
		$_GET[\'format\']=\'html\';
		$_GET[\'lang\']=\''.$locale.'\';
		$_GET[\'notif_id\']=\''.$element->payment_id.'\';
		$_GET[\'secret_code\']=\''.$secret.'\';
		$_REQUEST[\'option\']=\'com_hikashop\';
		$_REQUEST[\'tmpl\']=\'component\';
		$_REQUEST[\'ctrl\']=\'checkout\';
		$_REQUEST[\'task\']=\'notify\';
		$_REQUEST[\'notif_payment\']=\'paypaladvanced\';
		$_REQUEST[\'format\']=\'html\';
		$_REQUEST[\'lang\']=\''.$locale.'\';
		$_REQUEST[\'notif_id\']=\''.$element->payment_id.'\';
		$_REQUEST[\'secret_code\']=\''.$secret.'\';
		include(\'index.php\');';
		JFile::write(JPATH_ROOT.DS.'paypaladvanced_'.$element->payment_id.'_'.$secret.'.php', $content);

		return true;
	}
By:
	function onPaymentConfigurationSave(&$element) {
		parent::onPaymentConfigurationSave($element);
		$secret = $element->payment_params->secret_code;
		if(empty($element->payment_id)) {
			$pluginClass = hikashop_get('class.payment');
			$status = $pluginClass->save($element);
			if(!$status)
				return true;
			$element->payment_id = $status;
		}

		jimport('joomla.filesystem.file');
		$lang = JFactory::getLanguage();
		$locale = strtolower(substr($lang->get('tag'), 0, 2));

		$opts = array(
			'option' => 'com_hikashop',
			'tmpl' => 'component',
			'ctrl' => 'checkout',
			'task' => 'notify',
			'notif_payment' => $this->name,
			'format' => 'html',
			'local' => $locale,
			'notif_id' => $element->payment_id,
		);
		$content = '<?php' . "\r\n";
		foreach($opts as $k => $v) {
			$v = str_replace(array('\'','\\'), '', $v);
			$content .= '$_GET[\''.$k.'\']=\''.$v.'\';'."\r\n".
						'$_REQUEST[\''.$k.'\']=\''.$v.'\';'."\r\n";
		}
		$content .= 'include(\'index.php\');'."\r\n";
		JFile::write(JPATH_ROOT.DS.$this->name.'_'.$element->payment_id.'.php', $content);

		//
		$opts['secret_code'] = $secret;

		$content = '<?php' . "\r\n";
		foreach($opts as $k => $v) {
			$v = str_replace(array('\'','\\'), '', $v);
			$content .= '$_GET[\''.$k.'\']=\''.$v.'\';'."\r\n".
						'$_REQUEST[\''.$k.'\']=\''.$v.'\';'."\r\n";
		}
		$content .= 'include(\'index.php\');'."\r\n";
		JFile::write(JPATH_ROOT.DS.$this->name.'_'.$element->payment_id.'_'.$secret.'.php', $content);

		return true;
	}
Then you will need to re-save your paypal advanced configuration.
So you will have two "paypaladvanced" php file in the root of your Joomla website ; one for the private notification and another for the user return.

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.
Last edit: 10 years 2 months ago by Jerome.

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

  • Posts: 92
  • Thank you received: 0
10 years 2 months ago #193776

I edit the code changing the first code to the code you wrote after "BY:" under the file you told me to. But I dont understand what you mean at all by the one for private notification and another for user return? The only thing I did was open up paypaladvanced.php and edit the code function to what you said to do in the updated code and saved that php file. Past that i am confused of what i need to do to get this working. Thanks.

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

  • Posts: 92
  • Thank you received: 0
10 years 2 months ago #193777

Just checked this also didnt fix the problem. I updated paypaladvanced.php function to read:

function onPaymentConfigurationSave(&$element) {
		parent::onPaymentConfigurationSave($element);
		$secret = $element->payment_params->secret_code;
		if(empty($element->payment_id)) {
			$pluginClass = hikashop_get('class.payment');
			$status = $pluginClass->save($element);
			if(!$status)
				return true;
			$element->payment_id = $status;
		}

		jimport('joomla.filesystem.file');
		$lang = JFactory::getLanguage();
		$locale = strtolower(substr($lang->get('tag'), 0, 2));

		$opts = array(
			'option' => 'com_hikashop',
			'tmpl' => 'component',
			'ctrl' => 'checkout',
			'task' => 'notify',
			'notif_payment' => $this->name,
			'format' => 'html',
			'local' => $locale,
			'notif_id' => $element->payment_id,
		);
		$content = '<?php' . "\r\n";
		foreach($opts as $k => $v) {
			$v = str_replace(array('\'','\\'), '', $v);
			$content .= '$_GET[\''.$k.'\']=\''.$v.'\';'."\r\n".
						'$_REQUEST[\''.$k.'\']=\''.$v.'\';'."\r\n";
		}
		$content .= 'include(\'index.php\');'."\r\n";
		JFile::write(JPATH_ROOT.DS.$this->name.'_'.$element->payment_id.'.php', $content);

		//
		$opts['secret_code'] = $secret;

		$content = '<?php' . "\r\n";
		foreach($opts as $k => $v) {
			$v = str_replace(array('\'','\\'), '', $v);
			$content .= '$_GET[\''.$k.'\']=\''.$v.'\';'."\r\n".
						'$_REQUEST[\''.$k.'\']=\''.$v.'\';'."\r\n";
		}
		$content .= 'include(\'index.php\');'."\r\n";
		JFile::write(JPATH_ROOT.DS.$this->name.'_'.$element->payment_id.'_'.$secret.'.php', $content);

		return true;
	}

Last edit: 10 years 2 months ago by Jerome. Reason: [code] is nice

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

  • Posts: 83811
  • Thank you received: 13571
  • MODERATOR
10 years 2 months ago #193985

Hi,

As Jerome said, once you do the change in the code of the plugin, you will need to re-save your paypal advanced configuration. Otherwise it won't help.

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

  • Posts: 92
  • Thank you received: 0
10 years 2 months ago #193994

Either I completely dont understand what your trying to tell me to do or I did it and it didnt work. Most likely I didnt understand. I went to the plugin and clicked save and close. I tried to do yet another purchase on my website and still I get the 404 error with no change of any kind after updating this code. Can you please let me know what I am supposed to do because something isnt right and it still isnt working. After the customer buys the product i just get a 404 page and they have no idea the order went threw ... same as screen shot shows above. Please help, my customers are complaining big time and I am trying my best to get this resolved and its be on going for quite some time now.

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

  • Posts: 26234
  • Thank you received: 4036
  • MODERATOR
10 years 2 months ago #194079

Hi,

Please provide a backend and a ftp access to your website thanks to the contact us form.
www.hikashop.com/support/contact-us.html
Please also include a link to that forum thread so the support team will understand what to do with the credentials.

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: 92
  • Thank you received: 0
10 years 2 months ago #194212

okay email sent with both ftp and backend access.

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

  • Posts: 26234
  • Thank you received: 4036
  • MODERATOR
10 years 2 months ago #194407

Hi,

Thanks for the access.
I tried to connect to the FTP but the host does not allow me to connect to the ftp port (21). I can access to the Joomla admin but not to the FTP.
So I'm not able to check the two PHP files that the plugin "paypal advanced" should create.

Does your server have some IP filtering ?

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: 92
  • Thank you received: 0
10 years 2 months ago #195300

I just logged in to the ftp with that user name and pw that I sent you. I am not sure why you cant on your end? How do i proceed to get this resolved?

I sent a screen shot of my ftp accounts to your contact page. Hopefully this works.

Last edit: 10 years 2 months ago by target4fun.

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

  • Posts: 13201
  • Thank you received: 2322
10 years 2 months ago #195325

Hi,

I confirm that we get a "connection reset" error. So potentially an IP filtering as Jerome said.
Please see with your host provider if this kind of restriction is in place.

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

  • Posts: 92
  • Thank you received: 0
10 years 2 months ago #195427

I just finished talking to my service provider. They said the only IP filter is for blacklisted IP's and to check if yours is on there they would need your IP. They gave me all info required to login to port 21 and said there is nothing in place other than blacklisted IP's. My only guess was one of the addresses or user names was not correct. Please see your email for full conversation and passwords... I just sent you an updated email to your "contact us" page. Thanks!

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

  • Posts: 83811
  • Thank you received: 13571
  • MODERATOR
10 years 2 months ago #195429

Hi,

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

I suppose that they must be blocking it. Our ISP (OVH) is only for companies and is also a hosting company so I suppose that they must have blocked the whole range of IP addresses of OVH because of the servers they have and in the process, also blocked all the customers of the ISP side of their business to access their servers, including yours.

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

  • Posts: 92
  • Thank you received: 0
10 years 2 months ago #195631

chris stocktonhat
can you check if that ip is blacklisted or what
10:23:11pmchris stockton
"IP deleted for safety reasons but I gave them the Ip posted above."
10:25:02pmJacob
Are you using file zilla though?
10:25:26pmchris stockton
i have no idea what they are using. I have two moderators try to get access and cant.
10:25:34pmchris stockton
www.hikashop.com/forum/checkout/875247-a...t-an-error-mess.html
10:26:54pmJacob
Ok let me check a few things
10:27:11pmJacob
That IP is not blocked
10:27:42pmchris stockton
Is there some common problems where I can bring them up to speed that they might need to know
10:27:58pmchris stockton
I dont know why they cant get access to port 21.
10:28:36pmchris stockton
I gave them the user name and pw to fix my website they are the program developers so I imagine they know how to work an ftp but who knows whats going on
10:28:33pmJacob
File zilla can cause problems if they are using the new version of that. Have them follow this link
10:28:40pmJacob
my.bluehost.com/cgi/help/264
10:28:59pmchris stockton
Thanks jacob for all your help. I will update them on this issue.
send

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

Time to create page: 0.104 seconds
Powered by Kunena Forum