X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (https://forum.x-cart.com/forumdisplay.php?f=20)
-   -   Passing Product Name to SecPay (https://forum.x-cart.com/showthread.php?t=18772)

JannieB 12-20-2005 10:01 AM

Passing Product Name to SecPay
 
Just doing some integration with SECpay and noticed Xcart only passes through the product code so that the email generated by SECPay which shows details of the order, only shows the product code and not the product name. Thought it would be a bit more user friendly to have the name as well....so...

Here is the code to acheive this:

In payment cc_secpay.php change this
Code:

        $prod = array();
        if (!empty($products)) {
                foreach ($products as $p) {
                        $prod[] = "prod=".str_replace(array(",",";","\n","\r"), array("","","",""), $p['productcode']).",item_amount=".price_format($p['price'])."x".$p['amount'];

                }
        }


to this:

Code:

        $prod = array();
        if (!empty($products)) {
                foreach ($products as $p) {
                        $prod_and_name = $p['productcode']." ".$p['product'];
                        $prod[] = "prod=".str_replace(array(",",";","\n","\r"), array("","","",""), $prod_and_name).",item_amount=".price_format($p['price'])."x".$p['amount'];

                }
        }



Hope this helps someone!

Jan

balinor 02-20-2006 03:50 AM

Moving to Custom Mods.


All times are GMT -8. The time now is 05:26 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.