Share » Forums » Developer » basket dont send quantity to paypal...

basket dont send quantity to paypal [solved]

basket dont send quantity to paypal [solved]

Thursday 25 August 2005 8:04:12 am - 1 reply

Modified on Tuesday 30 August 2005 1:09:46 am by ludo thomas

Author Message

ludo thomas

Tuesday 30 August 2005 1:09:09 am

I've solved this problem:
by default paypal extension is configured to send the basket content as a unik object:
name:'object1,object2,object3...'
price=basket total price.
that is transmit into the url

you can send to paypal the differents object:
you have to edit and modify extension/ezpaypal/classes/ezpaypalgateway.
here is the code I've modified:


        $accountInfo    = $order->attribute( 'account_information' );
        $first_name     = urlencode( $accountInfo['first_name'] );
        $last_name      = urlencode( $accountInfo['last_name'] );
        $street         = urlencode( $accountInfo['street2'] );
        $zip            = urlencode( $accountInfo['zip'] );
        $state          = urlencode( $accountInfo['state'] );
        $place          = urlencode( $accountInfo['place'] );
        $image_url      = "http://$localHost" . urlencode( $paypalINI->variable( 'PaypalSettings', 'LogoURI' ) );
        $background     = urlencode( $paypalINI->variable( 'PaypalSettings', 'BackgroundColor' ) );
        $pageStyle      = urlencode( $paypalINI->variable( 'PaypalSettings', 'PageStyle' ) );
        $noNote         = urlencode( $paypalINI->variable( 'PaypalSettings', 'NoNote' ) );
        $noteLabel      = ($noNote == 1) ? '' : urlencode( $paypalINI->variable( 'PaypalSettings', 'NoteLabel' ) );
        $noShipping     = 1;
//////////////////////////modif for basket multiref/////////////////////////////////////////////////////
 
        $productItems   = $order->productItems();
		$listeArticles='';
		$x=1;
        foreach( $productItems as $item )
        {	
			 
			 $noeudID = $item['node_id'];
			 $node =& eZContentObjectTreeNode::fetch( $noeudID);
			 
			 
			$datamap =& $node->attribute('data_map');
			$ref=$datamap['product_number']->content();
			
            $listeArticles .= '&item_name_'.$x.'='.$item['object_name'].'&amount_'.$x.'='.$item['price_inc_vat'].'&quantity_'.$x.'='.$item['item_count'].'&item_number_'.$x.'='.$ref ;
			$x+=1;
        }


///////////////////////////////////////////////////////////////////////////////


        $url =  $paypalServer  . $requestURI    .
                "?cmd=_cart"               		.
                "&redirect_cmd=_cart"         	.
				"&upload=1"         			.
                "&business=$business"           .
				"$listeArticles"				.
                //"&item_name=$itemName"          .
                "&custom=$orderID"              .
                //"&amount=$amount"               .
                "&currency_code=$currency"      .
                "&first_name=$first_name"       .
                "&last_name=$last_name"         .
                "&address1=$street"             .
                "&zip=$zip"                     .
                "&state=$state"                 .
                "&city=$place"                  .
                "&image_url=$image_url"         .
                "&cs=$background"               .
                "&page_style=$pageStyle"        .
                "&no_shipping=$noShipping"      .
                "&cn=$noteLabel"                .
                "&no_note=$noNote"              .
                "&lc=$countryCode"              .
                "&notify_url=http://$localHost" . $indexDir . "/paypal/notify_url/".
                "&return=http://$localHost"     . $indexDir . "/shop/checkout/" .
                "&cancel_return=http://$localHost" . $indexDir. "/shop/basket/";

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu