basket dont send quantity to paypal [solved]

Author Message

ludo thomas

Thursday 25 August 2005 8:04:12 am

I all,
I've installed paypal payment gateway on a webshop(ez v3.5.2).

All is working fine, but when customer access to paypal page, quantity of items is equal to 1...
even if I have 15 items.

the total count is right, but I need a list of all the items.
for the moment I only have one item (whose name is like item1,item2,itemxx.)

Do someone has resolved this problem?

i found this:
https://www.paypal.com/fr/cgi-bin/webscr?cmd=_pdn_howto_checkout_outside#methodtwo

but where can i put these lines?
I dont find the template or php_file that send the form to paypal.

thx in advance.

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/";

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 20 2025 12:54:17
Script start
Timing: Jan 20 2025 12:54:17
Module start 'layout'
Timing: Jan 20 2025 12:54:17
Module start 'content'
Timing: Jan 20 2025 12:54:19
Module end 'content'
Timing: Jan 20 2025 12:54:19
Script end

Main resources:

Total runtime1.3160 sec
Peak memory usage4,096.0000 KB
Database Queries52

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0066 589.2891152.6406
Module start 'layout' 0.00660.0036 741.929739.4766
Module start 'content' 0.01021.3044 781.4063487.8359
Module end 'content' 1.31460.0014 1,269.242212.1250
Script end 1.3160  1,281.3672 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00350.2697160.0002
Check MTime0.00140.1087160.0001
Mysql Total
Database connection0.00120.088110.0012
Mysqli_queries1.254895.3467520.0241
Looping result0.00050.0356500.0000
Template Total1.284397.620.6422
Template load0.00220.168920.0011
Template processing1.282197.422220.6410
Template load and register function0.00010.010010.0001
states
state_id_array0.00060.048710.0006
state_identifier_array0.00120.093020.0006
Override
Cache load0.00180.1390270.0001
Sytem overhead
Fetch class attribute can translate value0.00080.061710.0008
Fetch class attribute name0.00120.088730.0004
XML
Image XML parsing0.00050.041610.0005
class_abstraction
Instantiating content class attribute0.00000.001040.0000
General
dbfile0.00290.2192160.0002
String conversion0.00000.000640.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
2content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
2content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
7content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
7content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 21
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs