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.

eZ debug

Timing: Jan 18 2025 16:10:56
Script start
Timing: Jan 18 2025 16:10:56
Module start 'content'
Timing: Jan 18 2025 16:10:57
Module end 'content'
Timing: Jan 18 2025 16:10:57
Script end

Main resources:

Total runtime1.2815 sec
Peak memory usage4,096.0000 KB
Database Queries213

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0075 588.9453180.8281
Module start 'content' 0.00751.0837 769.7734686.9063
Module end 'content' 1.09120.1902 1,456.6797340.4609
Script end 1.2814  1,797.1406 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00410.3210210.0002
Check MTime0.00160.1228210.0001
Mysql Total
Database connection0.00150.114910.0015
Mysqli_queries1.178891.98392130.0055
Looping result0.00270.20862110.0000
Template Total1.252997.820.6265
Template load0.00220.168220.0011
Template processing1.250897.601120.6254
Template load and register function0.00010.008110.0001
states
state_id_array0.00090.073510.0009
state_identifier_array0.00150.119820.0008
Override
Cache load0.00190.1516560.0000
Sytem overhead
Fetch class attribute can translate value0.00220.171750.0004
Fetch class attribute name0.00240.1862110.0002
XML
Image XML parsing0.00260.206750.0005
class_abstraction
Instantiating content class attribute0.00000.0023150.0000
General
dbfile0.00440.3405410.0001
String conversion0.00000.000430.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
7content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
8content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
14content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
4content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
3content/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: 38
 Number of unique templates used: 7

Time used to render debug report: 0.0002 secs