Jump to content

ecommforum

Members
  • Content count

    10
  • Joined

  • Last visited

  • Days Won

    1

Reputation Activity

  1. Like
    ecommforum got a reaction from Oza in Store title instead of item on Paypal page   
    Thanks a lot!!!! This was big help even 3 years later...thanks again for your help.
    I just wonder if there is any possible way to send the order comments that the user post in oscommerce to the PayPal invoice...so I can see these comments without checking my orders in oscommerce....Thanks so much in advance
  2. Like
    ecommforum reacted to kymation in [Addon} Modular Front Page   
    I've uploaded a new version to the usual location. The file is also available from my server until the official upload is approved.
     
    This version makes all of the modules multi-language, and fixes some bugs in others. It also includes the previous improvements and translations by others. Thanks to everyone who has helped with code and translations. Of course more translations are welcome, as are fixes and new modules.
     
    Regards
    Jim
  3. Like
    ecommforum reacted to 14steve14 in Select Product Image Directory & Instant Update For Products   
    Will this contribution work with 2.3.1. Its something that may be usefull.
  4. Like
    ecommforum reacted to derektimbrell in Store title instead of item on Paypal page   
    I've made a change in my paypal_standard.php so that my Paypal Website Standard module now passes through the item details rather than the store name and order information that goes though in the released version. It also passes the product model number and the name and value of the first two product attributes if they've been used. As far as I'm aware Paypal only supports two optional attributes.
     
    To make this work, and to keep the shipping, tax and totals that Paypal displays in line with what was actually ordered, I've had to do a slight fiddle when passing the tax and shipping through. The tax and shipping for the entire order are passed through with the first item; the tax and shipping for all remaining items are set to zero. That was the only way I could find to make Paypal display the order totals correctly.
     
    Here's the change (to file includes/modules/payment/paypal_standard.php )
     
    Find this

    $parameters = array('cmd' => '_xclick', 'item_name' => STORE_NAME, 'shipping' => $this->format_raw($order->info['shipping_cost']), 'tax' => $this->format_raw($order->info['tax']), 'business' => MODULE_PAYMENT_PAYPAL_STANDARD_ID, 'amount' => $this->format_raw($order->info['total'] - $order->info['shipping_cost'] - $order->info['tax']), 'currency_code' => $currency, 'invoice' => substr($cart_PayPal_Standard_ID, strpos($cart_PayPal_Standard_ID, '-')+1), 'custom' => $customer_id, 'no_note' => '1', 'notify_url' => tep_href_link('ext/modules/payment/paypal/standard_ipn.php', '', 'SSL', false, false), 'return' => tep_href_link(FILENAME_CHECKOUT_PROCESS, '', 'SSL'), 'cancel_return' => tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'), 'bn' => 'osCommerce22_Default_ST', 'paymentaction' => ((MODULE_PAYMENT_PAYPAL_STANDARD_TRANSACTION_METHOD == 'Sale') ? 'sale' : 'authorization')); if (is_numeric($sendto) && ($sendto > 0)) {
     
    and replace it with
     

    $parameters = array('cmd' => '_cart', 'upload' => '1', 'business' => MODULE_PAYMENT_PAYPAL_STANDARD_ID, 'currency_code' => $currency, 'invoice' => substr($cart_PayPal_Standard_ID, strpos($cart_PayPal_Standard_ID, '-')+1), 'custom' => $customer_id, 'no_note' => '1', 'notify_url' => tep_href_link('ext/modules/payment/paypal/standard_ipn.php', '', 'SSL', false, false), 'return' => tep_href_link(FILENAME_CHECKOUT_PROCESS, '', 'SSL'), 'cancel_return' => tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'), 'bn' => 'osCommerce22_Default_ST', 'paymentaction' => ((MODULE_PAYMENT_PAYPAL_STANDARD_TRANSACTION_METHOD == 'Sale') ? 'sale' : 'authorization')); for ($i=0; $i<sizeof($order->products); $i++) { $j = $i+1; $parameters['item_name_' . $j] = $order->products[$i]['name']; $parameters['item_number_' . $j] = $order->products[$i]['model']; $parameters['amount_' . $j] = $this->format_raw($order->products[$i]['final_price']); $parameters['quantity_' . $j] = $order->products[$i]['qty']; $parameters['on0_' . $j] = $order->products[$i]['attributes'][0]['option']; $parameters['os0_' . $j] = $order->products[$i]['attributes'][0]['value']; $parameters['on1_' . $j] = $order->products[$i]['attributes'][1]['option']; $parameters['os1_' . $j] = $order->products[$i]['attributes'][1]['value']; // the total shipping and tax values for the order are output against the // first product, and tax and shipping are set to zero for all subsequent // products. // the order tax applied to the first product has to be divided by the // quantity for that product because paypal treats this as the tax for // 1 of that product and will multiply it by the quantity. if ( $i == 0 ) { $parameters['shipping_' . $j] = $this->format_raw($order->info['shipping_cost']); $parameters['tax_' . $j] = $this->format_raw($order->info['tax']) / $order->products[$i]['qty']; } else { $parameters['shipping_' . $j] = 0; $parameters['tax_' . $j] = 0; } } if (is_numeric($sendto) && ($sendto > 0)) {
     
    While this works i.e. it passes the item details rather than the store name and order details, I'm not sure whether there's anything I've done that makes it any less secure or more hackable than it was before. Any thoughts on that would be appreciated.
     
    Anyone wanting to look at the changes in detail might also find this useful : https://www.paypal.com/IntegrationCenter/ic...-reference.html
     
    Thanks.
×