Jump to content

Order Summary


Cpup

Recommended Posts

These details about the product are not saved with the Order Inventory. We will need to fetch them.

Fortunately, there is a hook we can use. So, in admin, Manage Hooks, Code Snippets tab, click Add Snippet.

On the form shown, below the list of existing snippets:

Enabled: Checked
Unique ID: addean2receipt@cc62+
Execution Order: 1
Description: Adds the EAN code from Inventory to the Customer Receipt at CubeCart->_complete().
Trigger: class.cubecart.order_summary
Version 1.0
Author: https://forums.cubecart.com/topic/56300-order-summary/
PHP Code:
<?php
// Adds the EAN code from Inventory to the Customer Receipt at CubeCart->_complete().
if(isset($vars['items']) && !empty($vars['items'])){
  foreach($vars['items'] as &$addean2receipt_item){
    $addean2receipt_item['ean'] = $GLOBALS['db']->select('CubeCart_inventory','ean',array('product_id'=>$addean2receipt_item['product_id']))[0]['ean'];
  }
  $GLOBALS['smarty']->assign('ITEMS', $vars['items']);
}

Save.

Then, in the template code, where $ITEMS (the items purchased) are getting listed, use {$item.ean}.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...