For non SBA-products, the product model replaces the custom ID. This works fine in the cart, but yet again, not in the checkout nor order/invoice/etc.
Reading the code, it seems like this was supposed to work. (
/includes/templates/YOUR_TEMPLATE/templates/tpl_checkout_confirmation_default.php line 165)
PHP Code:
<?php
// START "Stock by Attributes"
$customid = null;
$tmpCheck = null;
if( STOCK_SBA_DISPLAY_CUSTOMID == 'true'){
if ( (isset($order->products[$i]['attributes'])) && (sizeof($order->products[$i]['attributes']) > 0) ) {
//create array for use in zen_get_customid
for ($j = 0, $n2 = sizeof($order->products[$i]['attributes']); $j < $n2; $j++) {
$attributes[] = $order->products[$i]['attributes'][$j]['value_id'];//value_id option_id
}
$customid = '(';
//get custom ID
for ($j = 0, $n2 = sizeof($order->products[$i]['attributes']); $j < $n2; $j++) {
if( $tmpCheck != zen_get_customid($order->products[$i]['id'],$attributes) ){
$tmpCheck = zen_get_customid($order->products[$i]['id'],$attributes);
$customid .= ' ' . zen_get_customid($order->products[$i]['id'],$attributes) . ' ';
}
}
$customid .= ')';
}
elseif(isset($order->products[$i]['products_model'])){
$customid = '(' . $order->products[$i]['products_model'] . ')';
}
}
echo $customid;
// END "Stock by Attributes"
?>
That
elseif is suposed to grab the products_model and use it in place of the custom ID, but it does not work.
At line 158, several calls in the non-SBA code omits the products_ prefix, so I did the same. And that worked.
PHP Code:
<?php // now loop thru all products to display quantity and price ?>
<?php for ($i=0, $n=sizeof($order->products); $i<$n; $i++) { ?>
<tr class="<?php echo $order->products[$i]['rowClass']; ?>">
<td class="cartQuantity"><?php echo $order->products[$i]['qty']; ?> x</td>
<td class="cartProductDisplay"><?php echo $order->products[$i]['name']; ?>
<?php echo $stock_check[$i]; ?>
Now, if I alter
/admin/orders.php to display custom ID instead of product model, there will be a consistent display throughout the catalog and admin.
At every step, each product or product attribute, representing actual products in my store, are listed with their unique EAN.
This may not be how everyone uses SBA, but it certainly is how I want it to work.
At any rate.. are these alterations I've made fixes to flaws in the code, or should I look elsewhere for the actual cause of my problem?
Thanks for any help!
Bookmarks