Forums / Setup & design / How to add product_number to $basket ?

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.