Jump to content



Latest News: (loading..)

Better Description for Paypal Standard in v2.3.1


  • Please log in to reply
5 replies to this topic

#1 ONLINE   kenkja

kenkja
  • Members
  • 242 posts
  • Real Name:Ken Johnson
  • Gender:Male
  • Location:Uk, Yorkshire

Posted 08 July 2012 - 07:51 PM

I'm hoping to make this into add on, I would be grateful if some of you you are better than me at coding/add-ons would have a look, test it and suggest where I could improve the installation file

Below is my draft of the installation file

*********************************************
All Credit goes to Chritian at Hockrockhosting.com

and to

PiLLaO/reflex-ocasion

*********************************************
As always backup your database and files
*********************************************


This add on is intending to provide users of v2.31 and paypal standard with a more complete description of any sales which have taken place..

At present v2.3.1 only passes to PayPal standard, the details of who has been paid, the total goods quantity, shipping and total price.

I can not gaurantee that this will show show any more than 3 lines on your primary e-mail addess, as this is eactly what it shows my Just Host e-mail account, however I have opted for a second e-mail to be directed to our Microsoft Live e-mail account which shows full details of the order.

So just try it and see if works for you


As always backup your database and files:
************************************************************************
Instructions to manually alfter yor files
************************************************************************

There are no files to upload, just modifiications of 2 files, I suggest you make a copy of both files by adding "bak" just before the .php of each of these so that at least you original files are retained.

*************************************************************************

Files to alter

catalog/includes/modules/payment/paypal_standard.php
catalog/checkout_confirmation.php

*************************************************************************

So here are the alterations to make


1- Open catalog/includes/modules/payment/paypal_standard.php

Find:
-----
  'item_name' => STORE_NAME,

Replace with this:
------------------
  'item_name' => $_SESSION['FixOrder'],



2- Open catalog/checkout_confirmation.php

(2A)

Find:
-----
  require('includes/application_top.php');

Add after:
----------
  $_SESSION['FixOrder'] = "";

(2B)

Find: (it should be in standard v2.3.1. install around line 159)
-----
<?php
  } else {
?>
  <tr>
<td class="main" colspan="3"><?php echo '<b>' . HEADING_PRODUCTS . '</b> <a href="' . tep_href_link(FILENAME_SHOPPING_CART) . '"><span class="orderEdit">(' . TEXT_EDIT . ')</span></a>'; ?></td>
  </tr>
<?php
  }


Add after:
----------
   $_SESSION['FixOrder'] =  $_SESSION['FixOrder'] . $order->products[$i]['name'] . " x " . $order->products[$i]['qty'] . " ";

(2C)

Find:
-----
if ( (isset($order->products[$i]['attributes'])) && (sizeof($order->products[$i]['attributes']) > 0) ) {
  for ($j=0, $n2=sizeof($order->products[$i]['attributes']); $j<$n2; $j++) {
echo '<br><nobr><small>&nbsp;<i> - ' . $order->products[$i]['attributes'][$j]['option'] . ': ' . $order->products[$i]['attributes'][$j]['value'] . '</i></small></nobr>';
  }
}

Replace with this:
------------------
if ( (isset($order->products[$i]['attributes'])) && (sizeof($order->products[$i]['attributes']) > 0) ) {
  for ($j=0, $n2=sizeof($order->products[$i]['attributes']); $j<$n2; $j++) {
echo '<br><nobr><small>&nbsp;<i> - ' . $order->products[$i]['attributes'][$j]['option'] . ': ' . $order->products[$i]['attributes'][$j]['value'] . '</i></small></nobr>';
   $_SESSION['FixOrder'] =  $_SESSION['FixOrder'] . "(". $order->products[$i]['attributes'][$j]['option'] . ': ' . $order->products[$i]['attributes'][$j]['value'] .")";
  }
}
   $_SESSION['FixOrder'] =  $_SESSION['FixOrder']  ." | ";

************************************************************************
That's all
************************************************************************

Thanks ken

Edited by kenkja, 08 July 2012 - 07:53 PM.

Os-commerce v2.3.3
Security Pro v11
Site Monitor
IP Trap
htaccess Protection
Bad Behaviour Block
Year Make Model
Document Manager
X Sell
Star Product
Modular Front Page
Modular Header Tags
Ultimate SEO Urls Pro

#2   DunWeb

DunWeb

    The Censored One

  • Members
  • 12,720 posts
  • Real Name:Chris
  • Gender:Male
  • Location:Ontario, Canada

Posted 08 July 2012 - 09:18 PM

@kenkja

Already done, check HERE


Chris
:|: Was this post helpful ? Click the LIKE THIS button :|:

See my Profile (click here)

#3 ONLINE   kenkja

kenkja
  • Members
  • 242 posts
  • Real Name:Ken Johnson
  • Gender:Male
  • Location:Uk, Yorkshire

Posted 10 July 2012 - 07:28 PM

Hi Chris

Thanks for the link, but I'm still a bit unsure about it as the installation file tells me in part 2 find 2, to locate the second occurence of

<?php
  } else {
?>
				  <tr>
					<td class="main" colspan="3"><?php echo '<b>' . HEADING_PRODUCTS . '</b> <a href="' . tep_href_link(FILENAME_SHOPPING_CART) . '"><span class="orderEdit">(' . TEXT_EDIT . ')</span></a>'; ?></td>
				  </tr>
<?php
  }
  for ($i=0, $n=sizeof($order->products); $i<$n; $i++) {

within catalog/checkout_confirmation.php but I can only find 1 instance of this code block.

Ken
Os-commerce v2.3.3
Security Pro v11
Site Monitor
IP Trap
htaccess Protection
Bad Behaviour Block
Year Make Model
Document Manager
X Sell
Star Product
Modular Front Page
Modular Header Tags
Ultimate SEO Urls Pro

#4   DunWeb

DunWeb

    The Censored One

  • Members
  • 12,720 posts
  • Real Name:Chris
  • Gender:Male
  • Location:Ontario, Canada

Posted 10 July 2012 - 07:39 PM

@kenkja

Are you using a template ?  Or have you modified the code already for another contribution ?  If so, that might explain the difference.



Chris
:|: Was this post helpful ? Click the LIKE THIS button :|:

See my Profile (click here)

#5 ONLINE   kenkja

kenkja
  • Members
  • 242 posts
  • Real Name:Ken Johnson
  • Gender:Male
  • Location:Uk, Yorkshire

Posted 10 July 2012 - 08:04 PM

Hi Chris,

I'm not using any templates, I re-downloaded v2.3.1 and tried to find the second instance of the code block concerned, but just can not see it.

Either I am just being dumb, or the instruction is for v2.2

Probably me being dumb.

ken
Os-commerce v2.3.3
Security Pro v11
Site Monitor
IP Trap
htaccess Protection
Bad Behaviour Block
Year Make Model
Document Manager
X Sell
Star Product
Modular Front Page
Modular Header Tags
Ultimate SEO Urls Pro

#6   pweden

pweden
  • Members
  • 13 posts
  • Real Name:weston

Posted 11 July 2012 - 11:55 PM

I am not using any extras. Just the files that are in 2.3.1 Did not work for me. I have three items at $.25 each. This is what the PayPal Summary looks like:


Your order summary

Descriptions  Amount

x | | |     $0.75
Item price:      $0.75
Quantity: 1

Item total     $0.75
Tax $0.03
Shipping and handling: $0.50

Total $1.28 USD
  • Total $1.28 USD