Jump to content

[SOLVED] Problem when modifying Paypal redirect page.


MrBaseball34

Recommended Posts

I'm trying to "spiff up" our PayPal redirect page. I want to make
it look kind of like our Payment notification emails.

I made this mod:

>
</pre>
<table style="font-family:Verdana, sans-serif;font-size:11px;width:550px;">






           {$redirect_text}

{$cancel_text}

</table>
<br>   <form action="{$paypal_url}" method="post" id="paypal_form" class="hidden"><br>     < the rest of the form that is submitted on redirect ><br>   </form&gt



I also added this code to redirect.php:

$smarty->assign(array(
 'shop_url' => 'http://'.Tools::getHttpHost(false, true).__PS_BASE_URI__,
 'shop_name' => Configuration::get('PS_SHOP_NAME'),
 'shop_logo' => _PS_IMG_DIR_.'logo.jpg',
 'redirect_text' => $paypal->getL('Please wait, redirecting to Paypal... Thanks.'),
 < more assignments >
));



But I continue to get this error:

Fatal error: Smarty error: [in /home/mydir/public_html/modules/paypal/redirect.tpl line 10]: 
syntax error: unrecognized tag 'shop_url' (Smarty_Compiler.class.php, line 590) in 
/home/mydir/public_html/tools/smarty/Smarty.class.php on line 1095



I've clear out the Smarty cache and still get the error. I've tried puting a {debug} marker at
the top of redirect.tpl but it does not throw the debug window.

Any ideas?

Link to comment
Share on other sites

  • 1 month later...

Yes, I use the standard module also. Can you send me a link and show me what your redirect page looks like. The default one is not very good and "encourages" the buyer to take action by adding a "cancel" button. I would love to modify this page. Actually, I would prefer if the page didn't exist - what purpose does it serve?

Link to comment
Share on other sites

Want to see it in action?
Unless you want to buy one of my reports, I can't show you a screen shot.

The redirect.tpl is actually a form that has all the parameters for the order that gets sent to PayPal.
Personally, I think they could have done it with cURL instead of a redirect but that is just my opinion.

I added a animated gif, too. Here's the entire code:(of course it matches my theme, and I use onepagecheckout, too)

I am attaching the TPL because this stupid forum takes out the javascript from the code tag.

redirect_tpl.zip

Link to comment
Share on other sites

And here's my redirect.php:

<?php

include(dirname(__FILE__).'/../../config/config.inc.php');
include(dirname(__FILE__).'/../../init.php');
include(dirname(__FILE__).'/paypal.php');

$paypal = new Paypal();
$cart = new Cart(intval($cookie->id_cart));

$address = new Address(intval($cart->id_address_invoice));
$country = new Country(intval($address->id_country));
$state = NULL;
if ($address->id_state)
   $state = new State(intval($address->id_state));
$customer = new Customer(intval($cart->id_customer));
$business = Configuration::get('PAYPAL_BUSINESS');
$header = Configuration::get('PAYPAL_HEADER');
$currency_order = new Currency(intval($cart->id_currency));
$currency_module = $paypal->getCurrency();

if (!Validate::isEmail($business))
   die($paypal->getL('Paypal error: (invalid or undefined business account email)'));

if (!Validate::isLoadedObject($address) OR !Validate::isLoadedObject($customer) OR !Validate::isLoadedObject($currency_module))
   die($paypal->getL('Paypal error: (invalid address or customer)'));

// check currency of payment
if ($currency_order->id != $currency_module->id)
{
   $cookie->id_currency = $currency_module->id;
   $cart->id_currency = $currency_module->id;
   $cart->update();
}

$smarty->assign(array(
 'shop_logo' => _PS_IMG_DIR_.'logo.jpg',
 'shop_url' => 'http://'.Tools::getHttpHost(false, true).__PS_BASE_URI__,
   'redirect_text' => $paypal->getL('Please wait, redirecting to Paypal... Thanks.'),
   'cancel_text' => $paypal->getL('Cancel'),
   'cart_text' => $paypal->getL('My cart'),
   'return_text' => $paypal->getL('Return to shop'),
   'paypal_url' => $paypal->getPaypalUrl(),
   'address' => $address,
   'country' => $country,
   'state' => $state,
   'amount' => floatval($cart->getOrderTotal(true, 4)),
   'customer' => $customer,
   'total' => floatval($cart->getOrderTotal(true, 3)),
   'shipping' => Tools::ps_round(floatval($cart->getOrderShippingCost()) + floatval($cart->getOrderTotal(true, 6)), 2),
   'discount' => $cart->getOrderTotal(true, 2),
   'business' => $business,
   'currency_module' => $currency_module,
   'cart_id' => intval($cart->id),
   'products' => $cart->getProducts(),
   'paypal_id' => intval($paypal->id),
   'header' => $header,
   'url' => Tools::getHttpHost(false, true).__PS_BASE_URI__
));


if (is_file(_PS_THEME_DIR_.'modules/paypal/redirect.tpl'))
   $smarty->display(_PS_THEME_DIR_.'modules/'.$paypal->name.'/redirect.tpl');
else
   $smarty->display(_PS_MODULE_DIR_.$paypal->name.'/redirect.tpl');

?>

Link to comment
Share on other sites

Hello everyone! I have a problem about the redirect page. After I have changed the redirect text in redirect.php of the paypal module 1.6, the redirect text disappear. Only a blank line and Cancel button is shown in the redirect page.

Please help! Thank you very much!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...