Transistor Posted January 14, 2014 Share Posted January 14, 2014 skins/mican/templates/content.checkout.php has lines {foreach from=$item.options item=option} <p> <strong>{$option.option_name}</strong>: {$option.value_name|truncate:45:"…":true} {if !empty($option.price_display)} ({$option.price_display}){/if} </p> {/foreach} How would I add in, for example, the UPC, EAN code, etc.? I imagine it's something like $option.upc_code but can't think of anything to make it work and there doesn't seem to be any documentation. Any ideas? Many thanks. Quote Link to comment Share on other sites More sharing options...
bsmither Posted January 14, 2014 Share Posted January 14, 2014 Almost. In (CC525) Catalogue->getProductData (near line 454), there is a section that will fetch most data from the CC_option_matrix database table if there is an options_identifier. The data fetched is: 'stock_level' ,'product_code', 'upc', 'jan', 'isbn', 'image' but not 'ean', nor are there columns for 'gtin' and 'mpn' like what is available in the CC_inventory table. The keys/values of these columns are put in place of the related keys/values from the CC_inventory table. So, for each item in the shopping cart (a unique combination of chosen options makes a unique item), there will be the respective keys in the $item array. $item.stock_level, $item.product_code, $item.upc, $item.jan, $item.isbn, $item.image But these are valid only if there is a value to be had. For example, if 'jan' is null in the database, then $item.jan will be empty. So it's best to test {if !empty($item.jan)}{$item.jan}{/if} Quote Link to comment Share on other sites More sharing options...
Transistor Posted January 14, 2014 Author Share Posted January 14, 2014 It took me a little while to realise I shouldn't be using the $option but rather the $item. Funny that not all the fields are available from the query result. Thank you very much. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.