Results 1 to 10 of 10
  1. #1
    Join Date
    Jul 2005
    Posts
    31
    Plugin Contributions
    0

    Default Incorrect Paypal Item Names

    Hello,

    When processing orders via Paypal I recieve payment. The customer gets 2 emails 1 from paypal, 1 from my store confirming the order, and in my admin area shows the paypal order The only problem is when the customer sends payment through paypal my invoices are a little messed up.

    Item Amount:
    $0.22 USD
    Shipping:
    $0.00 USD
    Handling:
    $0.00 USD
    Quantity:
    1
    Item Title:
    Xtreme Surf and Sport
    Item Number:
    1

    Both the Item number and the Item title are incorrect. The Item title shows up as my store name and not the item(s) purchased. And the item number does not correspond with the item title which is also wrong. How do I get my paypal invoices to display what has been purchased?

  2. #2
    Join Date
    Jan 2004
    Posts
    66,443
    Plugin Contributions
    279

    Default Re: Incorrect Paypal Item Names

    Your PayPal email will show your store name as the item purchased.
    Details of the transaction will be on the email that comes from your store.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  3. #3
    Join Date
    Feb 2005
    Posts
    8
    Plugin Contributions
    0

    Default Re: Incorrect Paypal Item Names

    Quote Originally Posted by xtreme
    Hello,

    When processing orders via Paypal I recieve payment. The customer gets 2 emails 1 from paypal, 1 from my store confirming the order, and in my admin area shows the paypal order The only problem is when the customer sends payment through paypal my invoices are a little messed up.

    Item Amount:
    $0.22 USD
    Shipping:
    $0.00 USD
    Handling:
    $0.00 USD
    Quantity:
    1
    Item Title:
    Xtreme Surf and Sport
    Item Number:
    1

    Both the Item number and the Item title are incorrect. The Item title shows up as my store name and not the item(s) purchased. And the item number does not correspond with the item title which is also wrong. How do I get my paypal invoices to display what has been purchased?
    Perhaps this will shed some light on things. I see this question come up several times concerning item numbers and item title for PayPal payments. When multiple items are purchased, you can only pass the amount of the purchase and shipping if required. PayPal will figure the total. So multiple item amounts can not be passed to PayPal's IPN.

    There is a somewhat alternative to this. Here is what I've done to make customer's happy. Remember to backup your files before making changes!

    In the /includes/modules/payment/paypal.php file, around line 186, find the following lines:

    zen_draw_hidden_field('item_name', 'STORE_NAME') .
    zen_draw_hidden_field('item_number', '1') .

    Then just change the first line to display your Store Name plus the word puchase on it and comment out the item_number line. See below example.

    zen_draw_hidden_field('item_name', 'Xtreme Surf and Sport Purchase') .
    // zen_draw_hidden_field('item_number', '1') .

    What this does is show on PayPal for item, "Xtreme Surf and Sport Purchase" and also does not show any item number so the customer is not confused.

    To prepare the customer for this I have put a "Important Note" at the bottom of my /includes/templates/template_default/templates/tpl_checkout_confirmation_default.php file. Note that if you have a custom template that this file may be in a different folder.

    At the bottom of tpl_checkout_confirmation_default.php, just put the following and you can change the wording to your liking.

    <br><br><br>
    <div class="alert"><b>IMPORTANT NOTE: Upon confirming order, you will be taken to
    PayPal for your secure payment. PayPal will list this as a payment to us for a
    Quantity of 1 and will give you a total purchase price. Once you have finished your completed payment, please return to our site to complete the order. Once this has been done, you will be sent a detailed receipt of your order. Remember that unless you click "Return to Complete Order" after paying, your order may not be shipped.</b></div><br><br>

    Remember this is at the very end of the file tpl_checkout_confirmation_default.php after everything else in the code. I made it RED with the alert class from the css file but you can make it any color you want. Red seems to get attention though.

    Hope that helps a lot of people because this is a very easy workaround to the PayPal Item display problem.

  4. #4
    Join Date
    Jan 2004
    Posts
    66,443
    Plugin Contributions
    279

    Default Re: Incorrect Paypal Item Names

    note that STORE_NAME is actually the name of your store as you set it up in the Admin->My Store->Store Name.... so changing that line is not necessary.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  5. #5
    Join Date
    Feb 2005
    Posts
    8
    Plugin Contributions
    0

    Default Re: Incorrect Paypal Item Names

    Quote Originally Posted by DrByte
    note that STORE_NAME is actually the name of your store as you set it up in the Admin->My Store->Store Name.... so changing that line is not necessary.
    This is true, but it is also what will display as Item Name on PayPal's payment screen. Since you can't actually pass the name(s) of the actual items that were purchased, then a lot of customers get confused or hesitant because they don't see what they are paying for listed there. So this was my way of getting around that.

    The point is that if you put "Purchase" at the end of it in the paypal.php file, then when people checkout, they will then see on the PayPal payment screen:

    Item: Store Name Purchase
    QTY: 1
    Price: $49.95

    rather than:

    Item: Store Name
    QTY: 1
    Price: $49.95

    You could even go so far as to hard code in "Order Purchase From My Store" if you wanted.

    Instead of letting ZenCart pass the STORE_NAME and then adding . 'Purchase' to the end of it, I simply hard coded it into the paypal.php file. Was a simpler solution because PayPal is just looking for a value to put in there.

    Same outcome overall. But the important thing is that now my customers see that they are paying for a "Store Purchase" rather than just a "Store Name."

  6. #6
    Join Date
    Jun 2008
    Location
    Fort Lauderdale, Florida
    Posts
    3
    Plugin Contributions
    0

    Default Re: Incorrect Paypal Item Names

    The code has changed since 2006.
    However, telling someone to hard code some litteral is a "non-answer" so,
    I am using the "PayPal IPN - Website Payments Standard" module
    and in /includes/modules/payment/paypal.php at about line 261,
    change 'item_name' => MODULE_PAYMENT_PAYPAL_PURCHASE_DESCRIPTION_TITLE,
    to 'item_name' => $order->products[0]['name'],
    if you are only selling 1 product at a time (as we are),
    otherwise, create a loop and append all of them together into 1 string and assign it to 'item_name'.
    That should help for the standard module.
    Last edited by gregsmith; 6 Jun 2008 at 01:21 AM.

  7. #7
    Join Date
    Jun 2009
    Location
    Europe
    Posts
    59
    Plugin Contributions
    1

    Idea or Suggestion Re: Incorrect Paypal Item Names

    Quote Originally Posted by gregsmith View Post
    The code has changed since 2006.
    However, telling someone to hard code some litteral is a "non-answer" so,
    I am using the "PayPal IPN - Website Payments Standard" module
    and in /includes/modules/payment/paypal.php at about line 261,
    change 'item_name' => MODULE_PAYMENT_PAYPAL_PURCHASE_DESCRIPTION_TITLE,
    to 'item_name' => $order->products[0]['name'],
    if you are only selling 1 product at a time (as we are),
    otherwise, create a loop and append all of them together into 1 string and assign it to 'item_name'.
    That should help for the standard module.
    I have made the following small changes in /includes/modules/payment/paypal.php
    I have added two new variables to the function process_button() at around line 165:

    $itemlist = '';
    $itemamount = 0;

    Itemlist is a string where a concatenated string for all the items will be formed. Itemamount is an integer where the number of total items will be calculated.
    Next, added the following piece just before $optionsAggregate = ... around line 260:

    for ($i=0, $n=sizeof($order->products); $i<$n; $i++) {
    $itemlist = $itemlist . strval($order->products[$i]['qty']) . 'x ' . $order->products[$i]['name'];
    if ($i<$n-1) $itemlist = $itemlist . ', ';
    $itemamount = $itemamount + $order->products[$i]['qty'];
    }

    and finally change the 'item_name' and 'item_number' assignments as also gregsmith suggested:

    'item_name' => MODULE_PAYMENT_PAYPAL_PURCHASE_DESCRIPTION_TITLE . $itemlist,
    'item_number' => MODULE_PAYMENT_PAYPAL_PURCHASE_DESCRIPTION_ITEMNUM . strval($itemamount),

    This way your Paypal item will show items' quantities and items' names listed (comma seperated) next to your store name.
    The Paypal item # will show total amount of items in this payment.

    I also suggest you to edit your /includes/languages/modules/payment/paypal.php define's as follows so that the line looks neat.

    define('MODULE_PAYMENT_PAYPAL_PURCHASE_DESCRIPTION_TITLE', 'Purchases from ' . STORE_NAME . ': ');
    define('MODULE_PAYMENT_PAYPAL_PURCHASE_DESCRIPTION_ITEMNUM', '');

    Finally your payment in Paypal IPN will show like this:

    Purchases from yourstore.com: 3x Adjustable Amount Gift Certificates, 1x Gift Certificate 10$
    Item # 4


  8. #8
    Join Date
    Jun 2009
    Location
    Europe
    Posts
    59
    Plugin Contributions
    1

    Default Re: Incorrect Paypal Item Names

    Quote Originally Posted by zamzom View Post
    I also suggest you to edit your /includes/languages/modules/payment/paypal.php define's as follows so that the line looks neat.
    The correct path is off course:
    includes/languages/english/modules/payment

  9. #9
    Join Date
    Jan 2004
    Posts
    66,443
    Plugin Contributions
    279

    Default Re: Incorrect Paypal Item Names

    Keep in mind that that field has a limited maximum length, and your approach does not take into account anything related to product attribute choices, so is thus not a universal fix, and thus not suitable for all stores. If it works for you, great. USE AT OWN RISK.

    And ... remember ... you STILL need the IPN infrastructure working properly if you want your store to be notified of updates to payments, including echecks, pending payment changes, voids, refunds, and so on. So, if you're trying to add item names because you have problems with orders not being added to your store, then the above fix is a huge red herring for you, and you should fix the root problem first instead of making the suggested code change.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  10. #10
    Join Date
    Nov 2009
    Posts
    13
    Plugin Contributions
    0

    Default Re: Incorrect Paypal Item Names

    Quote Originally Posted by zamzom View Post
    I have made the following small changes in /includes/modules/payment/paypal.php
    I have added two new variables to the function process_button() at around line 165:

    $itemlist = '';
    $itemamount = 0;

    Itemlist is a string where a concatenated string for all the items will be formed. Itemamount is an integer where the number of total items will be calculated.
    Next, added the following piece just before $optionsAggregate = ... around line 260:

    for ($i=0, $n=sizeof($order->products); $i<$n; $i++) {
    $itemlist = $itemlist . strval($order->products[$i]['qty']) . 'x ' . $order->products[$i]['name'];
    if ($i<$n-1) $itemlist = $itemlist . ', ';
    $itemamount = $itemamount + $order->products[$i]['qty'];
    }

    and finally change the 'item_name' and 'item_number' assignments as also gregsmith suggested:

    'item_name' => MODULE_PAYMENT_PAYPAL_PURCHASE_DESCRIPTION_TITLE . $itemlist,
    'item_number' => MODULE_PAYMENT_PAYPAL_PURCHASE_DESCRIPTION_ITEMNUM . strval($itemamount),

    This way your Paypal item will show items' quantities and items' names listed (comma seperated) next to your store name.
    The Paypal item # will show total amount of items in this payment.

    I also suggest you to edit your /includes/languages/modules/payment/paypal.php define's as follows so that the line looks neat.

    define('MODULE_PAYMENT_PAYPAL_PURCHASE_DESCRIPTION_TITLE', 'Purchases from ' . STORE_NAME . ': ');
    define('MODULE_PAYMENT_PAYPAL_PURCHASE_DESCRIPTION_ITEMNUM', '');

    Finally your payment in Paypal IPN will show like this:

    Purchases from yourstore.com: 3x Adjustable Amount Gift Certificates, 1x Gift Certificate 10$
    Item # 4

    In the above example, I need the actual "item number" from zencart to be passed through to paypal standard. As it stands
    with this code, the "item #" is actually calculating the total number
    of ordered items and NOT the zencart "Catalog Number."

    What would be the code to do that?

    P.S. The first part of the code passes through the DESCRIPTION_TITLE perfectly.

 

 

Similar Threads

  1. changing the color of item names
    By auction_okc in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 1 Jun 2010, 10:57 PM
  2. master list of template item names?
    By PapaLion in forum Templates, Stylesheets, Page Layout
    Replies: 6
    Last Post: 5 Jul 2008, 04:18 AM
  3. Group pricing per item plug-in for v1.3.7 has incorrect cart subtotal
    By monkle in forum All Other Contributions/Addons
    Replies: 2
    Last Post: 15 Jun 2008, 01:00 AM
  4. Paypal IPN - item name / item number
    By syntrix in forum Built-in Shipping and Payment Modules
    Replies: 1
    Last Post: 28 Feb 2008, 07:24 AM
  5. Group pricing (per item) showing incorrect amount on cart subtotal
    By jase_31 in forum All Other Contributions/Addons
    Replies: 5
    Last Post: 22 Jan 2008, 04:43 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg