Forums / Developer / basket dont send quantity to paypal [solved]

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

eZ debug

Timing: Jan 15 2025 01:09:33
Script start
Timing: Jan 15 2025 01:09:33
Module start 'content'
Timing: Jan 15 2025 01:09:34
Module end 'content'
Timing: Jan 15 2025 01:09:34
Script end

Main resources:

Total runtime1.0005 sec
Peak memory usage6,144.0000 KB
Database Queries182

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0084 686.3906214.7734
Module start 'content' 0.00840.8652 901.16411,760.1328
Module end 'content' 0.87370.1268 2,661.2969635.4844
Script end 1.0004  3,296.7813 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00790.7941210.0004
Check MTime0.00150.1482210.0001
Mysql Total
Database connection0.00130.133010.0013
Mysqli_queries0.904690.41351820.0050
Looping result0.00160.15781790.0000
Template Total0.965096.520.4825
Template load0.00520.515020.0026
Template processing0.959995.937720.4799
Template load and register function0.00160.159110.0016
states
state_id_array0.00140.135910.0014
state_identifier_array0.00070.069520.0003
Override
Cache load0.00460.4554270.0002
Sytem overhead
Fetch class attribute can translate value0.00210.208820.0010
Fetch class attribute name0.00230.228330.0008
XML
Image XML parsing0.00220.224320.0011
class_abstraction
Instantiating content class attribute0.00000.001140.0000
General
dbfile0.00260.2614210.0001
String conversion0.00000.000930.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

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
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 21
 Number of unique templates used: 7

Time used to render debug report: 0.0002 secs