How to add product_number to $basket ?

Author Message

laurent le cadet

Thursday 04 August 2005 3:06:01 am

Hi,

I'm using the webshop with Pay Paland I need to add the "product_number" attribute to the basket.
It seems to be a deal beetween basket.tpl and basket.php.

I added this line in basket.php in order to save the attribute in $basket :

$item->setAttribute( 'product_number', $object->attribute( 'product_number' ) );

I'm not sure I did it right but I can't print the product number.

I tried different ways in basket.tpl :

{$Basket:ProductItem:item.object_product_number}
{$Basket:ProductItem:item.product_number}
{$Basket:ProductItem:item.object.product_number}
...

No way !

Any hints ?

Thanks.

Laurent

Peter Schnuerer

Thursday 04 August 2005 9:31:07 pm

I did it the following way:

in basket.tpl i just fetched the "real" node by node_id and had full access to all node features...

need the code?

laurent le cadet

Friday 05 August 2005 12:07:46 am

Hi Peter,

yes please for the code, I'm sure it will help.
Laurent.

laurent le cadet

Wednesday 17 August 2005 6:13:14 am

Peter ?

Help please, I'm stuck...

Laurent

bisk

Wednesday 17 August 2005 8:12:44 am

Try this, I think both will work:

{attribute_view_gui attribute=$product_item.item.item_object.contentobject.main_node.data_map.product_number}

or

{$product_item.item.item_object.contentobject.main_node.data_map.product_number.content|wash()}

-------------------------------
http://www.kookfijn.nl & http://www.magento.be

laurent le cadet

Wednesday 17 August 2005 8:44:53 am

Hi Bisk,

So in basket.tpl i add this :

{$Basket:ProductItem:item.item_object.contentobject.main_node.data_map.product_number.content|wash()}

and in confirmorder.tpl this :
{$product_item.item.item_object.contentobject.main_node.data_map.product_number.content|wash()}

It's ok, but PayPal just print the product name, price...but not the product number...

I don't know how to add the product number to the URL generated :

https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_ext-enter&redirect_cmd=_xclick&business=lazy_seller%40ukr.net&item_name=Gobelet+OHOH%2CAssiette+plate&custom=41&amount=9.75&currency_code=EUR&first_name=aaa&last_name=aaa&address1=&zip=&state=&city=&image_url=http://www.bazaravenue.com%2Fvar%2Fshop%2Fimages%2Fmylogo.png&cs=0&page_style=&no_shipping=1&cn=Some+Label&no_note=0&lc=FR&notify_url=http://www.bazaravenue.com/fr/paypal/notify_url/&return=http://www.bazaravenue.com/fr/shop/checkout/&cancel_return=http://www.bazaravenue.com/fr/shop/basket

:(

Ɓukasz Serwatka

Wednesday 17 August 2005 11:09:54 am

Hi Laurent,

Look in to extension/ezpaypal/classes/ezpaypalgateway.php, there you will have to add item_number variable to generated URL.

I hope this will help you.

Personal website -> http://serwatka.net
Blog (about eZ Publish) -> http://serwatka.net/blog

laurent le cadet

Thursday 18 August 2005 12:01:16 am

Thanks.

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 31 2025 04:27:16
Script start
Timing: Jan 31 2025 04:27:16
Module start 'layout'
Timing: Jan 31 2025 04:27:16
Module start 'content'
Timing: Jan 31 2025 04:27:16
Module end 'content'
Timing: Jan 31 2025 04:27:16
Script end

Main resources:

Total runtime0.0123 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0044 588.2500151.2266
Module start 'layout' 0.00440.0024 739.476636.6641
Module start 'content' 0.00680.0042 776.140698.2656
Module end 'content' 0.01090.0013 874.406341.9922
Script end 0.0123  916.3984 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002318.3710140.0002
Check MTime0.00108.2769140.0001
Mysql Total
Database connection0.00054.456510.0005
Mysqli_queries0.002318.448630.0008
Looping result0.00000.097010.0000
Template Total0.00107.910.0010
Template load0.00086.229010.0008
Template processing0.00021.634810.0002
Override
Cache load0.00054.221910.0005
General
dbfile0.00021.982080.0000
String conversion0.00000.064040.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs