Example #1
0
    $product_name = zen_get_products_name($pr_list->fields['product_id'], $_SESSION['languages_id']);
    ?>
                <td class="dataTableContent"><?php 
    echo $_GET['cid'];
    ?>
</td>
                <td class="dataTableContent" align="center"><?php 
    echo $coupon->fields['coupon_name'];
    ?>
</td>
                <td class="dataTableContent" align="center"><?php 
    echo $pr_list->fields['product_id'];
    ?>
</td>
                <td class="dataTableContent" align="left"><?php 
    echo '<strong>' . $product_name . '</strong><br />' . TEXT_CATEGORY . zen_get_categories_name_from_product($pr_list->fields['product_id']) . '<br />' . TEXT_MANUFACTURER . zen_get_products_manufacturers_name($pr_list->fields['product_id']);
    ?>
</td>
<?php 
    if ($pr_list->fields['coupon_restrict'] == 'N') {
        echo '<td class="dataTableContent" align="center"><a href="' . zen_href_link('coupon_restrict.php', zen_get_all_get_params(array('info', 'action', 'x', 'y')) . 'action=switch_status&info=' . $pr_list->fields['restrict_id'], 'NONSSL') . '" onClick="divertClickSwitchStatus(this.href);return false;" >' . zen_image(DIR_WS_IMAGES . 'icon_status_green.gif', IMAGE_ALLOW) . '</a></td>';
    } else {
        echo '<td class="dataTableContent" align="center"><a href="' . zen_href_link('coupon_restrict.php', zen_get_all_get_params(array('info', 'action', 'x', 'y')) . 'action=switch_status&info=' . $pr_list->fields['restrict_id'], 'NONSSL') . '" onClick="divertClickSwitchStatus(this.href);return false;" >' . zen_image(DIR_WS_IMAGES . 'icon_status_red.gif', IMAGE_DENY) . '</a></td>';
    }
    if ($pr_list->fields['coupon_restrict'] == 'Y') {
        echo '<td class="dataTableContent" align="center"><a href="' . zen_href_link('coupon_restrict.php', zen_get_all_get_params(array('info', 'action', 'x', 'y')) . 'action=switch_status&info=' . $pr_list->fields['restrict_id'], 'NONSSL') . '" onClick="divertClickSwitchStatus(this.href);return false;" >' . zen_image(DIR_WS_IMAGES . 'icon_status_green.gif', IMAGE_DENY) . '</a></td>';
    } else {
        echo '<td class="dataTableContent" align="center"><a href="' . zen_href_link('coupon_restrict.php', zen_get_all_get_params(array('info', 'action', 'x', 'y')) . 'action=switch_status&info=' . $pr_list->fields['restrict_id'], 'NONSSL') . '" onClick="divertClickSwitchStatus(this.href);return false;" >' . zen_image(DIR_WS_IMAGES . 'icon_status_red.gif', IMAGE_ALLOW) . '</a></td>';
    }
    echo '<td class="dataTableContent" align="center"><a href="' . zen_href_link('coupon_restrict.php', zen_get_all_get_params(array('info', 'action', 'x', 'y')) . 'action=remove&info=' . $pr_list->fields['restrict_id'], 'NONSSL') . '" onClick="divertClickActionRemove(this.href);return false;" >' . zen_image(DIR_WS_IMAGES . 'icons/delete.gif', IMAGE_REMOVE) . '</a></td>';
    ?>
     default:
         $ga_order = $order->customer;
         break;
 }
 // get total tax shipping
 $ga_order['total'] = number_format(zen_round($order->info['total'], $currencies[$order->info['currency']]['decimal_places']), $currencies[$order->info['currency']]['decimal_places'], $currencies[$order->info['currency']]['decimal_point'], '');
 $ga_order['tax'] = number_format(zen_round($order->info['tax'], $currencies[$order->info['currency']]['decimal_places']), $currencies[$order->info['currency']]['decimal_places'], $currencies[$order->info['currency']]['decimal_point'], '');
 $orders_total_query = "select value from " . TABLE_ORDERS_TOTAL . "\n                           where orders_id = :ordersid\n                           and class = 'ot_shipping'";
 $orders_total_query = $db->bindvars($orders_total_query, ':ordersid', $orders_id, 'integer');
 $orders_total = $db->execute($orders_total_query);
 $ga_order['shippingcost'] = number_format(zen_round($orders_total->fields['value'], $currencies[$order->info['currency']]['decimal_places']), $currencies[$order->info['currency']]['decimal_places'], $currencies[$order->info['currency']]['decimal_point'], '');
 $ga_order['affiliation'] = MODULE_GOOGLE_ANALYTICS_AFFILIATION;
 // get products data
 $ga_products = array();
 for ($i = 0; $i < sizeof($order->products); $i++) {
     $ga_products[$i]['categories_name'] = zen_get_categories_name_from_product(zen_get_prid($order->products[$i]['id']));
     if (MODULE_GOOGLE_ANALYTICS_SKU_OR_CODE == 'products_model') {
         $ga_products[$i]['skucode'] = $order->products[$i]['model'];
     } else {
         $ga_products[$i]['skucode'] = $order->products[$i]['id'];
     }
     $ga_products[$i]['final_price'] = number_format(zen_round($order->products[$i]['final_price'], $currencies[$order->info['currency']]['decimal_places']), $currencies[$order->info['currency']]['decimal_places'], $currencies[$order->info['currency']]['decimal_point'], '');
     $ga_products[$i]['qty'] = $order->products[$i]['qty'];
     // get product name and attributes_name
     $ga_products[$i]['name'] = $order->products[$i]['name'];
     if (isset($order->products[$i]['attributes'])) {
         $products_attributes = array();
         for ($j = 0; $j < sizeof($order->products[$i]['attributes']); $j++) {
             $products_attributes[$j] = $order->products[$i]['attributes'][$j]['option'] . ': ' . $order->products[$i]['attributes'][$j]['value'];
         }
         $attributes = substr(MODULE_GOOGLE_ANALYTICS_BRACKETS, 0, 1) . implode(MODULE_GOOGLE_ANALYTICS_DELIMITER, $products_attributes) . substr(MODULE_GOOGLE_ANALYTICS_BRACKETS, -1, 1);