Jump to content

Invoices : $order_detail


BnJ

Recommended Posts

Can you tell me how to know what exists in the varaible $order_detail in invoice.tpl ?


Like $order_detail.product_name or $order_detail.unit_price_tax_excl.


I try to get the product's short description and the ecotax tax incl., if possible, but I do not know how...


Link to comment
Share on other sites

{$order_detail|@print_r} 

will dump and regarding ecotax, you actually have there

[ecotax] => 0.000000

[ecotax_tax_rate] => 0.000

and nothing mentioned for product's short description.

 

A full dump is pasted below and the data seems to be coming from order_detail table primarily and the related class is classes/order/OrderDetail.php. Most probably, you will need to make an override, get the product id, initialize a product object and get whatever you need from there and inject them to smarty data.

 

 

-----

Array ( [id_order_detail] => 3 [id_order] => 2 [id_order_invoice] => 1 [id_warehouse] => 0 [id_shop] => 1
[product_id] => 1 [product_attribute_id] => 0 [product_name] => Ninja Pricer [product_quantity] => 1
[product_quantity_in_stock] => 1 [product_quantity_refunded] => 0 [product_quantity_return] => 0
[product_quantity_reinjected] => 0 [product_price] => 29.900000 [reduction_percent] => 0.00
[reduction_amount] => 0.000000 [reduction_amount_tax_incl] => 0.000000 [reduction_amount_tax_excl]
=> 0.000000 [group_reduction] => 0.00 [product_quantity_discount] => 0.000000 [product_ean13] =>
[product_upc] => [product_reference] => [product_supplier_reference] => [product_weight] => 0.000000
[tax_computation_method] => 0 [tax_name] => [tax_rate] => 0.000 [ecotax] => 0.000000
[ecotax_tax_rate] => 0.000 [discount_quantity_applied] => 0 [download_hash] =>
2616eab8875fc4ffe2840fe5c189bb4b0846e689 [download_nb] => 0 [download_deadline] => 0000-00-00
00:00:00 [total_price_tax_incl] => 29.900000 [total_price_tax_excl] => 29.900000 [unit_price_tax_incl] =>
29.900000 [unit_price_tax_excl] => 29.900000 [total_shipping_price_tax_incl] => 0.000000
[total_shipping_price_tax_excl] => 0.000000 [purchase_supplier_price] => 0.000000 [original_product_price]
=> 29.900000 [id_product] => 1 [id_supplier] => 0 [id_manufacturer] => 0 [id_category_default] => 2
[id_shop_default] => 1 [id_tax_rules_group] => 0 [on_sale] => 0 [online_only] => 0 [ean13] => [upc] =>
[quantity] => 0 [minimal_quantity] => 1 [price] => 29.900000 [wholesale_price] => 0.000000 [unity] =>
[unit_price_ratio] => 0.000000 [additional_shipping_cost] => 0.00 [reference] => [supplier_reference] =>
[location] => [width] => 0.000000 [height] => 0.000000 [depth] => 0.000000 [weight] => 0.000000
[out_of_stock] => 2 [quantity_discount] => 0 [customizable] => 0 [uploadable_files] => 0 [text_fields] => 0
[active] => 1 [redirect_type] => 404 [id_product_redirected] => 0 [available_for_order] => 1
[available_date] => 0000-00-00 [condition] => new [show_price] => 1 [indexed] => 1 [visibility] => both
[cache_is_pack] => 0 [cache_has_attachments] => 1 [is_virtual] => 1 [cache_default_attribute] => 0
[date_add] => 2014-02-04 12:41:42 [date_upd] => 2014-02-17 08:50:00 [advanced_stock_management]
=> 0 [image] => Image Object ( [id] => 1 [id_image] => 1 [id_product] => 1 [position] => 1 [cover] => 1
[legend] => Array ( [1] => Ninja Pricer ) [image_format] => jpg [source_index] =>
/var/www/aaaps1562/img/p/index.php [folder:protected] => [existing_path:protected] =>
[id_lang:protected] => [id_shop:protected] => 1 [id_shop_list] => [get_shop_from_context:protected] => 1
[table:protected] => image [identifier:protected] => id_image [fieldsRequired:protected] => Array ( [0] =>
id_product ) [fieldsSize:protected] => Array ( ) [fieldsValidate:protected] => Array ( [id_product] =>
isUnsignedId [position] => isUnsignedInt [cover] => isBool ) [fieldsRequiredLang:protected] => Array ( )
[fieldsSizeLang:protected] => Array ( [legend] => 128 ) [fieldsValidateLang:protected] => Array ( [legend]
=> isGenericName ) [tables:protected] => Array ( ) [webserviceParameters:protected] => Array ( )
[image_dir:protected] => /var/www/aaaps1562/img/p/ [def:protected] => Array ( [table] => image [primary]
=> id_image [multilang] => 1 [fields] => Array ( [id_product] => Array ( [type] => 1 [validate] =>
isUnsignedId [required] => 1 ) [position] => Array ( [type] => 1 [validate] => isUnsignedInt ) [cover] =>
Array ( [type] => 2 [validate] => isBool [shop] => 1 ) [legend] => Array ( [type] => 3 [lang] => 1 [validate]
=> isGenericName => 128 ) ) [classname] => Image [associations] => Array ( [l] => Array ( [type]
=> 2 [field] => id_image [foreign_field] => id_image ) ) ) [update_fields:protected] => ) [image_size] =>
[current_stock] => -- [customizedDatas] => [customizationQuantityTotal] => 0 [filename] =>
c7a6b73c3088851a7fba1bc78fa9a65fd7a1c2b4 [display_filename] => ninjapricer.zip [id_address_delivery]
=> 3 )
Edited by prestashopninja (see edit history)
  • Like 3
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...