Jump to content

Order Summary


Cpup
 Share

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: [email protected]+
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}.

Edited by bsmither
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...