Пример #1
0
 if ($show_shopping_cart_box == true) {
     if ($gBitCustomer->mCart->count_contents() > 0) {
         $id = 'shoppingcart';
         $content = "";
         if ($gBitCustomer->mCart->count_contents() > 0) {
             $content = '<table border="0" width="100%" cellspacing="0" cellpadding="0">';
             foreach (array_keys($gBitCustomer->mCart->contents) as $productKey) {
                 $product = $gBitCustomer->mCart->getProductObject($productKey);
                 $productId = zen_get_prid($productKey);
                 $content .= '<tr><td align="right" valign="top" class="infoboxcontents">';
                 if (!empty($_SESSION['new_products_id_in_cart']) && $_SESSION['new_products_id_in_cart'] == $productId) {
                     $content .= '<span class="newItemInCart">';
                 } else {
                     $content .= '<span class="infoboxcontents">';
                 }
                 $content .= $gBitCustomer->mCart->contents[$productKey]['products_quantity'] . '&nbsp;x&nbsp;</span></td><td valign="top" class="infoboxcontents"><a href="' . CommerceProduct::getDisplayUrlFromId(zen_get_prid($productId)) . '">';
                 if (!empty($_SESSION['new_products_id_in_cart']) && $_SESSION['new_products_id_in_cart'] == $productId) {
                     $content .= '<span class="newItemInCart">';
                 } else {
                     $content .= '<span class="infoboxcontents">';
                 }
                 $content .= $product->getTitle() . '</span></a></td></tr>';
                 if (!empty($_SESSION['new_products_id_in_cart']) && $_SESSION['new_products_id_in_cart'] == $productId) {
                     $_SESSION['new_products_id_in_cart'] = '';
                 }
             }
             $content .= '</table>';
             if ($gvBalance = CommerceVoucher::getGiftAmount()) {
                 $content .= '<table style="margin-top:10px;" cellpadding="0" width="100%" cellspacing="0" border="0"><tr><td class="smalltext">' . tra('Gift Certificate Balance') . '</td><td class="smalltext" align="right" valign="bottom">' . $gvBalance . '</td></tr></table>';
                 $content .= '<table cellpadding="0" width="100%" cellspacing="0" border="0"><tr><td class="smalltext"><a href="' . zen_href_link(FILENAME_GV_SEND) . '">' . tra('Send Gift Certificate') . '</a></td></tr></table>';
             }
    }
    ?>
              <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href='<?php 
    print CommerceProduct::getDisplayUrlFromId($products->fields['products_id']);
    ?>
'">
				<td class="dataTableContent"><?php 
    echo $rows;
    ?>
</td>
                <td class="dataTableContent" align="right"><?php 
    echo $products->fields['products_id'];
    ?>
&nbsp;&nbsp;</td>
                <td class="dataTableContent"><?php 
    echo '<a href="' . CommerceProduct::getDisplayUrlFromId($products->fields['products_id']) . '">' . $products->fields['products_name'] . '</a>';
    ?>
</td>
                <td class="dataTableContent" align="center"><?php 
    echo $products->fields['products_ordered'];
    ?>
&nbsp;</td>
                <td class="dataTableContent" align="center"><?php 
    echo substr($products->fields['first_purchased'], 0, strpos($products->fields['first_purchased'], ' '));
    ?>
&nbsp;</td>
                <td class="dataTableContent" align="center"><?php 
    if ($products->fields['first_purchased'] != $products->fields['last_purchased']) {
        echo substr($products->fields['last_purchased'], 0, strpos($products->fields['last_purchased'], ' '));
    }
    ?>
             $next_item_image = '';
         }
     } else {
         $previous_image = '';
         $next_item_image = '';
     }
 }
 // only display when more than 1
 if ($products_ids->RecordCount() > 1) {
     $gBitSmarty->assign('navPosition', $position);
     $gBitSmarty->assign('navCounter', $counter);
     if (!empty($previous)) {
         $gBitSmarty->assign('navPreviousUrl', CommerceProduct::getDisplayUrlFromId($previous));
     }
     if (!empty($next_item)) {
         $gBitSmarty->assign('navNextUrl', CommerceProduct::getDisplayUrlFromId($next_item));
     }
     /*
     ?>
     <table border="1" align="left" width="100%">
     <?php
         if ( empty( $cPath ) ) {
           $cPath= zen_get_product_path((int)$_GET['products_id']);
         }
     
         if ($module_show_categories != '0') {
           $cPath_new = zen_get_path(zen_get_products_category_id((int)$_GET['products_id']));
           if ((zen_get_categories_image(zen_get_products_category_id((int)$_GET['products_id']))) !='') {
             switch(true) {
               case ($module_show_categories=='1'):
               $align='left';
Пример #4
0
$listHash['sort_mode'] = 'random';
$listHash['commissioned'] = TRUE;
$listHash['thumbnail_size'] = 'avatar';
$row = 0;
$col = 0;
$listBoxContents = '';
// show only when 1 or more
if ($commissionedProducts = $gBitProduct->getList($listHash)) {
    $num_products_count = count($commissionedProducts);
    if ($num_products_count < $columnCount) {
        $col_width = 100 / $num_products_count;
    } else {
        $col_width = 100 / $columnCount;
    }
    foreach (array_keys($commissionedProducts) as $productsId) {
        $products_price = CommerceProduct::getDisplayPriceFromHash($productsId);
        $listBoxContents[$row][$col] = array('align' => 'center', 'params' => 'class="smallText" width="' . $col_width . '%" valign="top"', 'text' => '<a href="' . CommerceProduct::getDisplayUrlFromId($productsId) . '">' . zen_image($commissionedProducts[$productsId]['products_image_url'], $commissionedProducts[$productsId]['products_name']) . '</a><br /><a href="' . CommerceProduct::getDisplayUrlFromId($productsId) . '">' . $commissionedProducts[$productsId]['products_name'] . '</a><br />' . $products_price);
        $col++;
        if ($col > $columnCount - 1) {
            $col = 0;
            $row++;
        }
    }
    if (isset($new_products_category_id)) {
        $category_title = zen_get_categories_name((int) $new_products_category_id);
        $title = $title . ($category_title != '' ? ' - ' . $category_title : '');
    }
    $gBitSmarty->assign('listBoxContents', $listBoxContents);
    $gBitSmarty->assign('productListTitle', $title);
    $gBitSmarty->display('bitpackage:bitcommerce/list_box_content_inc.tpl');
}
Пример #5
0
                    $lc_text .= '<br />' . zen_get_buy_now_button($listing->fields['products_id'], $the_button, $products_link) . '<br />' . zen_get_products_quantity_min_units_display($listing->fields['products_id']);
                    break;
                case 'PRODUCT_LIST_QUANTITY':
                    $lc_align = 'right';
                    $lc_text = '&nbsp;' . $listing->fields['products_quantity'] . '&nbsp;';
                    break;
                case 'PRODUCT_LIST_WEIGHT':
                    $lc_align = 'right';
                    $lc_text = '&nbsp;' . $listing->fields['products_weight'] . '&nbsp;';
                    break;
                case 'PRODUCT_LIST_IMAGE':
                    $lc_align = 'center';
                    if (isset($_GET['manufacturers_id'])) {
                        $lc_text = '<a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), 'manufacturers_id=' . $_GET['manufacturers_id'] . '&products_id=' . $listing->fields['products_id']) . '">' . zen_image(CommerceProduct::getImageUrlFromHash($listing->fields['products_id'], 'avatar'), $listing->fields['products_name']) . '</a>';
                    } else {
                        $lc_text = '&nbsp;<a href="' . CommerceProduct::getDisplayUrlFromId($listing->fields['products_id']) . '">' . zen_image(CommerceProduct::getImageUrlFromHash($listing->fields['products_id'], 'avatar'), $listing->fields['products_name']) . '</a>&nbsp;';
                    }
                    break;
            }
            $list_box_contents[$rows][$col] = array('align' => $lc_align, 'params' => 'class="data"', 'text' => $lc_text);
        }
        $listing->MoveNext();
    }
    $error_categories = false;
} else {
    $list_box_contents = array();
    $list_box_contents[0] = array('params' => 'class="odd"');
    $list_box_contents[0][] = array('params' => 'class="data"', 'text' => TEXT_NO_PRODUCTS);
    $error_categories = true;
}
if ($how_many > 0 and $show_submit == 'true' and $listing_split->number_of_rows > 0 and (PRODUCT_LISTING_MULTIPLE_ADD_TO_CART == 1 or PRODUCT_LISTING_MULTIPLE_ADD_TO_CART == 3)) {
                    break;
                case 'PRODUCT_LIST_WEIGHT':
                    $lc_align = 'right';
                    $lc_text = '&nbsp;' . $listing->fields['products_weight'] . '&nbsp;';
                    break;
                case 'PRODUCT_LIST_IMAGE':
                    $lc_align = 'center';
                    if (isset($_GET['manufacturers_id'])) {
                        $lc_text = '<a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), 'manufacturers_id=' . $_GET['manufacturers_id'] . '&products_id=' . $listing->fields['products_id']) . '">' . zen_image(CommerceProduct::getImageUrlFromHash($listing->fields['products_id'], 'avatar'), $listing->fields['products_name']) . '</a>';
                    } else {
                        $typeClass = BitBase::getParameter($listing->fields, 'type_class', 'CommerceProduct');
                        if (!empty($listing->fields['type_class_file']) && file_exists(BIT_ROOT_PATH . $listing->fields['type_class_file'])) {
                            require_once BIT_ROOT_PATH . $listing->fields['type_class_file'];
                        }
                        if ($thumbnail = $typeClass::getImageUrlFromHash($listing->fields['products_id'], 'avatar')) {
                            $lc_text = '<a href="' . CommerceProduct::getDisplayUrlFromId($listing->fields['products_id']) . '">' . zen_image($thumbnail, $listing->fields['products_name']) . '</a>';
                        }
                    }
                    break;
            }
            $list_box_contents[$rows][$col] = array('align' => $lc_align, 'params' => 'class="data"', 'text' => $lc_text);
        }
        $listing->MoveNext();
    }
    $error_categories = false;
} else {
    $list_box_contents = array();
    $list_box_contents[0] = array('params' => 'class="odd"');
    $list_box_contents[0][] = array('params' => 'class="data"', 'text' => TEXT_NO_PRODUCTS);
    $error_categories = true;
}
Пример #7
0
// $Id$
//
global $gBitDb, $gBitProduct;
require_once BITCOMMERCE_PKG_PATH . 'includes/bitcommerce_start_inc.php';
if ($gBitUser->isRegistered()) {
    // retreive the last x products purchased
    $orders_history_query = "select distinct op.`products_id`, o.date_purchased\n\t\t\t\t\tfrom " . TABLE_ORDERS . " o, " . TABLE_ORDERS_PRODUCTS . " op, " . TABLE_PRODUCTS . " p\n\t\t\t\t\twhere o.`customers_id` = ?\n\t\t\t\t\tand o.`orders_id` = op.`orders_id`\n\t\t\t\t\tand op.`products_id` = p.`products_id`\n\t\t\t\t\tand p.`products_status` = '1'\n\t\t\t\t\torder by o.date_purchased desc";
    $orders_history = $gBitDb->query($orders_history_query, $gBitUser->mUserId, MAX_DISPLAY_PRODUCTS_IN_ORDER_HISTORY_BOX);
    if ($orders_history->RecordCount() > 0) {
        $product_ids = '';
        while (!$orders_history->EOF) {
            $product_ids .= (int) $orders_history->fields['products_id'] . ',';
            $orders_history->MoveNext();
        }
        $product_ids = substr($product_ids, 0, -1);
        $rows = 0;
        $customer_orders_string = '<table border="0" width="100%" cellspacing="0" cellpadding="1">';
        $products_history_query = "select `products_id`, `products_name`\n\t\t\t\t\t\t\tfrom " . TABLE_PRODUCTS_DESCRIPTION . "\n\t\t\t\t\t\t\twhere `products_id` in (" . $product_ids . ")\n\t\t\t\t\t\t\tand `language_id` = '" . (int) $_SESSION['languages_id'] . "'\n\t\t\t\t\t\t\torder by `products_name`";
        $products_history = $gBitDb->Execute($products_history_query);
        while (!$products_history->EOF) {
            $rows++;
            $customer_orders[$rows] = $products_history->fields;
            $customer_orders[$rows]['display_url'] = CommerceProduct::getDisplayUrlFromId($products_history->fields['products_id']);
            $products_history->MoveNext();
        }
        $_template->tpl_vars['sideboxCustomerOrders'] = new Smarty_variable($customer_orders);
    }
    if (empty($moduleTitle)) {
        $_template->tpl_vars['moduleTitle'] = new Smarty_variable('Order History');
    }
}
Пример #8
0
             $gBitCustomer->mCart->addToCart($_POST['products_id'], $gBitCustomer->mCart->get_quantity(zen_get_uprid($_POST['products_id'], $real_ids)) + $_POST['cart_quantity'], $real_ids);
         }
     }
     if ($the_list == '') {
         // no errors
         zen_redirect(zen_href_link($goto, zen_get_all_get_params($parameters)));
     } else {
         // errors - display popup message
     }
     break;
     // performed by the 'buy now' button in product listings and review page
 // performed by the 'buy now' button in product listings and review page
 case 'buy_now':
     if (isset($_REQUEST['products_id'])) {
         if (zen_has_product_attributes($_REQUEST['products_id'])) {
             zen_redirect(CommerceProduct::getDisplayUrlFromId($_REQUEST['products_id']));
         } else {
             $gBitCustomer->mCart->addToCart($_REQUEST['products_id'], $gBitCustomer->mCart->get_quantity($_REQUEST['products_id']) + zen_get_buy_now_qty($_REQUEST['products_id']));
         }
     }
     zen_redirect(zen_href_link($goto, zen_get_all_get_params($parameters)));
     break;
 case 'multiple_products_add_product':
     while (list($key, $qty) = each($_REQUEST['products_id'])) {
         if (!zen_has_product_attributes($_REQUEST['products_id'])) {
             $gBitCustomer->mCart->addToCart($prodId, $gBitCustomer->mCart->get_quantity($prodId) + $qty);
         }
     }
     zen_redirect(zen_href_link($goto, zen_get_all_get_params($parameters)));
     break;
 case 'notify':