当前位置: 首页>>代码示例>>PHP>>正文


PHP osC_Product::getPriceFormated方法代码示例

本文整理汇总了PHP中osC_Product::getPriceFormated方法的典型用法代码示例。如果您正苦于以下问题:PHP osC_Product::getPriceFormated方法的具体用法?PHP osC_Product::getPriceFormated怎么用?PHP osC_Product::getPriceFormated使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在osC_Product的用法示例。


在下文中一共展示了osC_Product::getPriceFormated方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: initialize

 function initialize()
 {
     global $osC_Cache, $osC_Database, $osC_Services, $osC_Currencies, $osC_Specials, $osC_Language, $osC_Image;
     $this->_title_link = osc_href_link(FILENAME_PRODUCTS, 'new');
     $data = array();
     if (BOX_WHATS_NEW_CACHE > 0 && $osC_Cache->read('box-whats_new-' . $osC_Language->getCode() . '-' . $osC_Currencies->getCode(), BOX_WHATS_NEW_CACHE)) {
         $data = $osC_Cache->getCache();
     } else {
         $Qnew = $osC_Database->query('select products_id from :table_products where products_status = :products_status order by products_date_added desc limit :max_random_select_new');
         $Qnew->bindTable(':table_products', TABLE_PRODUCTS);
         $Qnew->bindInt(':products_status', 1);
         $Qnew->bindInt(':max_random_select_new', BOX_WHATS_NEW_RANDOM_SELECT);
         $Qnew->executeRandomMulti();
         if ($Qnew->numberOfRows()) {
             $osC_Product = new osC_Product($Qnew->valueInt('products_id'));
             $data = $osC_Product->getData();
             $data['display_price'] = $osC_Product->getPriceFormated(true);
             $data['display_image'] = $osC_Product->getImage();
         }
         $osC_Cache->write($data);
     }
     if (!empty($data)) {
         $this->_content = '';
         if (!empty($data['display_image'])) {
             $this->_content .= osc_link_object(osc_href_link(FILENAME_PRODUCTS, $data['keyword']), $osC_Image->show($data['display_image'], $data['name'])) . '<br />';
         }
         $this->_content .= osc_link_object(osc_href_link(FILENAME_PRODUCTS, $data['keyword']), $data['name']) . '<br />' . $data['display_price'];
     }
 }
开发者ID:heshuai64,项目名称:gamestore,代码行数:29,代码来源:whats_new.php

示例2: initialize

 function initialize()
 {
     global $osC_Cache, $osC_Database, $osC_Services, $osC_Currencies, $osC_Specials, $osC_Language, $osC_Image;
     $this->_title_link = osc_href_link(FILENAME_PRODUCTS, 'new');
     if (BOX_WHATS_NEW_CACHE > 0 && $osC_Cache->read('box-whats_new-' . $osC_Language->getCode() . '-' . $osC_Currencies->getCode(), BOX_WHATS_NEW_CACHE)) {
         $data = $osC_Cache->getCache();
     } else {
         $data = array();
         $Qnew = $osC_Database->query('select p.products_id, p.products_tax_class_id, p.products_price, pd.products_name, pd.products_keyword, i.image from :table_products p left join :table_products_images i on (p.products_id = i.products_id and i.default_flag = :default_flag), :table_products_description pd where p.products_status = 1 and p.products_id = pd.products_id and pd.language_id = :language_id order by p.products_date_added desc limit :max_random_select_new');
         $Qnew->bindTable(':table_products', TABLE_PRODUCTS);
         $Qnew->bindTable(':table_products_images', TABLE_PRODUCTS_IMAGES);
         $Qnew->bindTable(':table_products_description', TABLE_PRODUCTS_DESCRIPTION);
         $Qnew->bindInt(':default_flag', 1);
         $Qnew->bindInt(':language_id', $osC_Language->getID());
         $Qnew->bindInt(':max_random_select_new', BOX_WHATS_NEW_RANDOM_SELECT);
         $Qnew->executeRandomMulti();
         if ($Qnew->numberOfRows()) {
             $data = $Qnew->toArray();
             $osC_Product = new osC_Product($Qnew->valueInt('products_id'));
             $products_price = $osC_Currencies->displayPrice($Qnew->valueDecimal('products_price'), $Qnew->valueInt('products_tax_class_id'));
             if ($osC_Services->isStarted('specials') && $osC_Specials->isActive($Qnew->valueInt('products_id'))) {
                 $products_price = '<s>' . $products_price . '</s>&nbsp;<span class="productSpecialPrice">' . $osC_Currencies->displayPrice($osC_Specials->getPrice($Qnew->valueInt('products_id')), $Qnew->valueInt('products_tax_class_id')) . '</span>';
             }
             $data['products_price'] = $osC_Product->getPriceFormated(true);
         }
         $osC_Cache->writeBuffer($data);
     }
     if (empty($data) === false) {
         $this->_content = '';
         if (empty($data['image']) === false) {
             $this->_content .= osc_link_object(osc_href_link(FILENAME_PRODUCTS, $data['products_id']), $osC_Image->show($data['image'], $data['products_name'])) . '<br />';
         }
         $this->_content .= '<span>' . osc_link_object(osc_href_link(FILENAME_PRODUCTS, $data['products_id']), $data['products_name']) . '</span><br /><span class="productPrice">' . $data['products_price'] . '</span>';
     }
 }
开发者ID:Doluci,项目名称:tomatocart,代码行数:35,代码来源:whats_new.php

示例3: initialize

 function initialize()
 {
     global $osC_Database, $osC_Services, $osC_Language, $osC_Currencies, $osC_Image, $osC_Specials, $current_category_id;
     if ($current_category_id < 1) {
         $Qproducts = $osC_Database->query('select p.products_id, p.products_tax_class_id, p.products_price, pd.products_name, pd.products_keyword, pf.sort_order, i.image from :table_products p left join :table_products_images i on (p.products_id = i.products_id and i.default_flag = :default_flag), :table_products_description pd, :table_products_frontpage pf where p.products_status = 1 and p.products_id = pd.products_id and pd.products_id = pf.products_id and pd.language_id = :language_id order by pf.sort_order limit :max_display_feature_products');
     } else {
         $Qproducts = $osC_Database->query('select distinct p.products_id, p.products_tax_class_id, p.products_price, pd.products_name, pf.sort_order, pd.products_keyword, i.image from :table_products p left join :table_products_images i on (p.products_id = i.products_id and i.default_flag = :default_flag), :table_products_description pd, :table_products_to_categories p2c, :table_categories c, :table_products_frontpage pf where c.parent_id = :parent_id and c.categories_id = p2c.categories_id and p2c.products_id = p.products_id and p.products_id = pf.products_id and p.products_status = 1 and p.products_id = pd.products_id and pd.language_id = :language_id order by pf.sort_order limit :max_display_feature_products');
         $Qproducts->bindTable(':table_products_to_categories', TABLE_PRODUCTS_TO_CATEGORIES);
         $Qproducts->bindTable(':table_categories', TABLE_CATEGORIES);
         $Qproducts->bindInt(':parent_id', $current_category_id);
     }
     $Qproducts->bindTable(':table_products', TABLE_PRODUCTS);
     $Qproducts->bindTable(':table_products_images', TABLE_PRODUCTS_IMAGES);
     $Qproducts->bindTable(':table_products_frontpage', TABLE_PRODUCTS_FRONTPAGE);
     $Qproducts->bindTable(':table_products_description', TABLE_PRODUCTS_DESCRIPTION);
     $Qproducts->bindInt(':default_flag', 1);
     $Qproducts->bindInt(':language_id', $osC_Language->getID());
     $Qproducts->bindInt(':max_display_feature_products', MODULE_CONTENT_FEATURE_PRODUCTS_MAX_DISPLAY);
     $Qproducts->setCache('feature-products-' . $osC_Language->getCode() . '-' . $osC_Currencies->getCode() . '-' . $current_category_id);
     $Qproducts->execute();
     if ($Qproducts->numberOfRows()) {
         $this->_content = '<div style="overflow: auto; height: 100%;">';
         $i = 0;
         while ($Qproducts->next()) {
             if ($i % 3 == 0 && $i != 0) {
                 $this->_content .= '<div style="clear:both"></div>';
             }
             $osC_Product = new osC_Product($Qproducts->valueInt('products_id'));
             $this->_content .= '<span style="width: 32%; float: left; text-align: center; padding: 2px;">' . osc_link_object(osc_href_link(FILENAME_PRODUCTS, $Qproducts->value('products_id')), $osC_Image->show($Qproducts->value('image'), $Qproducts->value('products_name'))) . '<br />' . osc_link_object(osc_href_link(FILENAME_PRODUCTS, $Qproducts->value('products_id')), $Qproducts->value('products_name')) . '<br />' . $osC_Product->getPriceFormated(true) . '</span>';
             $i++;
         }
         $this->_content .= '</div>';
     }
     $Qproducts->freeResult();
 }
开发者ID:4DvAnCeBoY,项目名称:tomatocart-shoppingcart,代码行数:35,代码来源:feature_products.php

示例4: initialize

 function initialize()
 {
     global $osC_Database, $osC_Cache, $osC_Language, $osC_Currencies, $osC_Image, $current_category_id;
     $data = array();
     if (MODULE_CONTENT_NEW_PRODUCTS_CACHE > 0 && $osC_Cache->read('new_products-' . $osC_Language->getCode() . '-' . $osC_Currencies->getCode() . '-' . $current_category_id, MODULE_CONTENT_NEW_PRODUCTS_CACHE)) {
         $data = $osC_Cache->getCache();
     } else {
         if ($current_category_id < 1) {
             $Qproducts = $osC_Database->query('select products_id from :table_products where products_status = :products_status and parent_id is null order by products_date_added desc limit :max_display_new_products');
         } else {
             $Qproducts = $osC_Database->query('select distinct p2c.products_id from :table_products p, :table_products_to_categories p2c, :table_categories c where c.parent_id = :category_parent_id and c.categories_id = p2c.categories_id and p2c.products_id = p.products_id and p.products_status = :products_status and p.parent_id is null order by p.products_date_added desc limit :max_display_new_products');
             $Qproducts->bindTable(':table_products_to_categories', TABLE_PRODUCTS_TO_CATEGORIES);
             $Qproducts->bindTable(':table_categories', TABLE_CATEGORIES);
             $Qproducts->bindInt(':category_parent_id', $current_category_id);
         }
         $Qproducts->bindTable(':table_products', TABLE_PRODUCTS);
         $Qproducts->bindInt(':products_status', 1);
         $Qproducts->bindInt(':max_display_new_products', MODULE_CONTENT_NEW_PRODUCTS_MAX_DISPLAY);
         $Qproducts->execute();
         while ($Qproducts->next()) {
             $osC_Product = new osC_Product($Qproducts->valueInt('products_id'));
             $data[$osC_Product->getID()] = $osC_Product->getData();
             $data[$osC_Product->getID()]['display_price'] = $osC_Product->getPriceFormated(true);
             $data[$osC_Product->getID()]['display_image'] = $osC_Product->getImage();
         }
         $osC_Cache->write($data);
     }
     if (!empty($data)) {
         $this->_content = '<div style="overflow: auto; height: 100%;">';
         foreach ($data as $product) {
             $this->_content .= '<span style="width: 33%; float: left; text-align: center;">' . osc_link_object(osc_href_link(FILENAME_PRODUCTS, $product['keyword']), $osC_Image->show($product['display_image'], $product['name'])) . '<br />' . osc_link_object(osc_href_link(FILENAME_PRODUCTS, $product['keyword']), $product['name']) . '<br />' . $product['display_price'] . '</span>';
         }
         $this->_content .= '</div>';
     }
 }
开发者ID:Jon86,项目名称:oscommerce,代码行数:35,代码来源:new_products.php

示例5: getProducts

 function getProducts()
 {
     global $osC_Database, $osC_Language, $toC_Json, $osC_Image;
     if (defined('IMAGE_GROUP_AUTO_COMPLETER')) {
         $image_group = IMAGE_GROUP_AUTO_COMPLETER;
     } else {
         $image_group = 'mini';
     }
     if (defined('MAX_CHARACTERS_AUTO_COMPLETER')) {
         $max_name_len = MAX_CHARACTERS_AUTO_COMPLETER;
     } else {
         $max_name_len = 40;
     }
     $products = array();
     if (isset($_POST['keywords']) && !empty($_POST['keywords'])) {
         $Qproducts = $osC_Database->query("select distinct p.products_id as products_id, pd.products_name from :table_products_description pd, :table_products p where pd.products_id = p.products_id and p.products_status = :products_status and products_name like :keywords and language_id =" . $osC_Language->getID() . ' limit :max_results');
         $Qproducts->bindTable(':table_products_description', TABLE_PRODUCTS_DESCRIPTION);
         $Qproducts->bindTable(':table_products', TABLE_PRODUCTS);
         $Qproducts->bindInt(':products_status', 1);
         $Qproducts->bindInt(':max_results', MAX_DISPLAY_AUTO_COMPLETER_RESULTS);
         $Qproducts->bindValue(':keywords', '%' . $_POST['keywords'] . '%');
         $Qproducts->execute();
         while ($Qproducts->next()) {
             $osC_Product = new osC_Product($Qproducts->valueInt('products_id'));
             $products_name = $Qproducts->value('products_name');
             if (strlen($products_name) > $max_name_len) {
                 $products_name = substr($products_name, 0, $max_name_len) . '...';
             }
             $products[] = '<div class="image">' . $osC_Image->show($osC_Product->getImage(), null, null, $image_group) . '</div><div class="details">' . osc_link_object(osc_href_link(FILENAME_PRODUCTS, $Qproducts->valueInt('products_id')), $products_name) . '<strong class="price">' . $osC_Product->getPriceFormated(true) . '</strong></div>';
         }
     }
     echo $toC_Json->encode($products);
 }
开发者ID:seshna,项目名称:Tomatocart-Bootstrap,代码行数:33,代码来源:auto_completer.php

示例6: initialize

 function initialize()
 {
     global $osC_Database, $osC_Services, $osC_Language, $osC_Currencies, $osC_Image, $osC_Specials, $current_category_id;
     if ($current_category_id < 1) {
         $Qnewproducts = $osC_Database->query('select p.products_id, p.products_tax_class_id, p.products_price, pd.products_name, pd.products_keyword, i.image from :table_products p left join :table_products_images i on (p.products_id = i.products_id and i.default_flag = :default_flag), :table_products_description pd where p.products_status = 1 and p.products_id = pd.products_id and pd.language_id = :language_id order by p.products_date_added desc limit :max_display_new_products');
     } else {
         $Qnewproducts = $osC_Database->query('select distinct p.products_id, p.products_tax_class_id, p.products_price, pd.products_name, pd.products_keyword, i.image from :table_products p left join :table_products_images i on (p.products_id = i.products_id and i.default_flag = :default_flag), :table_products_description pd, :table_products_to_categories p2c, :table_categories c where c.parent_id = :parent_id and c.categories_id = p2c.categories_id and p2c.products_id = p.products_id and p.products_status = 1 and p.products_id = pd.products_id and pd.language_id = :language_id order by p.products_date_added desc limit :max_display_new_products');
         $Qnewproducts->bindTable(':table_products_to_categories', TABLE_PRODUCTS_TO_CATEGORIES);
         $Qnewproducts->bindTable(':table_categories', TABLE_CATEGORIES);
         $Qnewproducts->bindInt(':parent_id', $current_category_id);
     }
     $Qnewproducts->bindTable(':table_products', TABLE_PRODUCTS);
     $Qnewproducts->bindTable(':table_products_images', TABLE_PRODUCTS_IMAGES);
     $Qnewproducts->bindTable(':table_products_description', TABLE_PRODUCTS_DESCRIPTION);
     $Qnewproducts->bindInt(':default_flag', 1);
     $Qnewproducts->bindInt(':language_id', $osC_Language->getID());
     $Qnewproducts->bindInt(':max_display_new_products', MODULE_CONTENT_NEW_PRODUCTS_MAX_DISPLAY);
     if (MODULE_CONTENT_NEW_PRODUCTS_CACHE > 0) {
         $Qnewproducts->setCache('new_products-' . $osC_Language->getCode() . '-' . $osC_Currencies->getCode() . '-' . $current_category_id, MODULE_CONTENT_NEW_PRODUCTS_CACHE);
     }
     $Qnewproducts->execute();
     if ($Qnewproducts->numberOfRows()) {
         $i = 0;
         while ($Qnewproducts->next()) {
             if ($i % 3 == 0 && $i != 0) {
                 $this->_content .= '<div style="clear:both"></div>';
             }
             $product = new osC_Product($Qnewproducts->valueInt('products_id'));
             $this->_content .= '<div style="margin-top: 10px; float:left; width: 33%; text-align: center">' . '<span style="display:block; height: 32px; text-align: center">' . osc_link_object(osc_href_link(FILENAME_PRODUCTS, $Qnewproducts->value('products_id')), $Qnewproducts->value('products_name')) . '</span>' . osc_link_object(osc_href_link(FILENAME_PRODUCTS, $Qnewproducts->value('products_id')), $osC_Image->show($Qnewproducts->value('image'), $Qnewproducts->value('products_name')), 'id="productImage' . $Qnewproducts->value('products_id') . '"') . '<span style="display:block; padding: 3px; text-align: center">' . $product->getPriceFormated(true) . '</span>' . osc_link_object(osc_href_link(FILENAME_PRODUCTS, $Qnewproducts->valueInt('products_id') . '&action=cart_add'), osc_draw_image_button('button_add_to_cart.png', $osC_Language->get('button_add_to_cart'), 'class="ajaxAddToCart" id="ac_newproductsmodule_' . $Qnewproducts->value('products_id') . '"')) . '</div>';
             $i++;
         }
         $this->_content .= '<div style="clear:both"></div>';
     }
     $Qnewproducts->freeResult();
 }
开发者ID:Doluci,项目名称:tomatocart,代码行数:35,代码来源:new_products.php

示例7: outputCompareProductsTable

 function outputCompareProductsTable()
 {
     global $osC_Language, $osC_Image, $osC_Weight;
     $content = '';
     $products_images = '';
     $products_titles = '';
     $products_price = '';
     $products_weight = '';
     $products_sku = '';
     $products_manufacturers = '';
     $products_desciptions = '';
     $products_attributes = '';
     if ($this->hasContents()) {
         foreach ($this->getProducts() as $products_id) {
             $osC_Product = new osC_Product($products_id);
             $image = $osC_Product->getImages();
             $products_images .= '<td width="120" valign="top" align="center">' . osc_link_object(osc_href_link(FILENAME_PRODUCTS, $products_id), $osC_Image->show($image[0]['image'], $osC_Product->getTitle())) . '<br /><br />' . osc_link_object(osc_href_link(FILENAME_PRODUCTS, $products_id . '&action=cart_add'), osc_draw_image_button('button_in_cart.gif', $osC_Language->get('button_add_to_cart'))) . '</td>';
             $products_titles .= '<td valign="top" align="center">' . $osC_Product->getTitle() . '</td>';
             $products_price .= '<td valign="top" align="center">' . $osC_Product->getPriceFormated(true) . '</td>';
             $products_weight .= '<td valign="top" align="center">' . $osC_Weight->display($osC_Product->getWeight(), $osC_Product->getWeightClass()) . '</td>';
             $products_sku .= '<td valign="top" align="center">' . $osC_Product->getSKU() . '</td>';
             $products_manufacturers .= '<td valign="top" align="center">' . $osC_Product->getManufacturer() . '</td>';
             $products_desciptions .= '<td valign="top" align="center">' . $osC_Product->getDescription() . '</td>';
             if ($osC_Product->hasAttributes()) {
                 foreach ($osC_Product->getAttributes() as $attribute) {
                     $products_attributes[$attribute['name']][$products_id] = $attribute['value'];
                 }
             }
         }
         $content .= '<table id="compareProducts" cellspacing="0" cellpadding="2" border="0">';
         $content .= '<tr class="odd"><td width="120">&nbsp;</td>' . $products_images . '</tr>';
         $content .= '<tr class="even"><td valign="top" align="left" class="label">' . $osC_Language->get('field_products_name') . '</td>' . $products_titles . '</tr>';
         $content .= '<tr class="odd"><td valign="top" align="left" class="label">' . $osC_Language->get('field_products_price') . '</td>' . $products_price . '</tr>';
         $content .= '<tr class="even"><td valign="top" align="left" class="label">' . $osC_Language->get('field_products_weight') . '</td>' . $products_weight . '</tr>';
         $content .= '<tr class="odd"><td valign="top" align="left" class="label">' . $osC_Language->get('field_products_sku') . '</td>' . $products_sku . '</tr>';
         $content .= '<tr class="even"><td valign="top" align="left" class="label">' . $osC_Language->get('field_products_manufacturer') . '</td>' . $products_manufacturers . '</tr>';
         if (!empty($products_attributes)) {
             $rows = 0;
             foreach ($products_attributes as $name => $attribute) {
                 $content .= '<tr class="' . ($rows / 2 == floor($rows / 2) ? 'odd' : 'even') . '">';
                 $content .= '<td valign="top" align="left" class="label">' . $name . ':</td>';
                 foreach ($this->getProducts() as $products_id) {
                     if (isset($attribute[$products_id])) {
                         $content .= '<td align = "center">' . $attribute[$products_id] . '</td>';
                     } else {
                         $content .= '<td align = "center"> -- </td>';
                     }
                 }
                 $content .= '</tr>';
                 $rows++;
             }
         }
         $content .= '<tr class="' . ($rows / 2 == floor($rows / 2) ? 'odd' : 'even') . '"><td valign="top" align="left" class="label">' . $osC_Language->get('field_products_description') . '</td>' . $products_desciptions . '</tr>';
         $content .= '</table></div>';
     }
     return $content;
 }
开发者ID:Doluci,项目名称:tomatocart,代码行数:57,代码来源:compare_products.php

示例8: getVariantsFormattedPrice

 function getVariantsFormattedPrice()
 {
     global $toC_Json;
     $response = array();
     if (isset($_POST['products_id_string']) && preg_match('/^[0-9]+(#([0-9]+:?[0-9]+)+(;?([0-9]+:?[0-9]+)+)*)$/', $_POST['products_id_string'])) {
         $response['success'] = true;
         $variants = osc_parse_variants_from_id_string($_POST['products_id_string']);
         $osC_Product = new osC_Product($_POST['products_id_string']);
         $formatted_price = $osC_Product->getPriceFormated(true, $variants);
         $response['formatted_price'] = $formatted_price;
     } else {
         $response['success'] = false;
         $response['feedback'] = 'The products id string is not valid';
     }
     echo $toC_Json->encode($response);
 }
开发者ID:4DvAnCeBoY,项目名称:tomatocart-shoppingcart,代码行数:16,代码来源:products.php

示例9: initialize

    function initialize()
    {
        global $osC_Database, $osC_Language, $osC_Currencies, $osC_Image, $osC_Template;
        $Qupcoming = $osC_Database->query('select p.products_id, p.products_price, p.products_tax_class_id, p.products_date_available as date_expected, pd.products_name, pd.products_keyword, s.specials_new_products_price, i.image from :table_products p left join :table_products_images i on (p.products_id = i.products_id and i.default_flag = :default_flag) left join :table_specials s on (p.products_id = s.products_id and s.status = 1), :table_products_description pd where to_days(p.products_date_available) >= to_days(now()) and p.products_status = :products_status and p.products_id = pd.products_id and pd.language_id = :language_id order by p.products_date_available limit :max_display_upcoming_products');
        $Qupcoming->bindTable(':table_products', TABLE_PRODUCTS);
        $Qupcoming->bindTable(':table_products_images', TABLE_PRODUCTS_IMAGES);
        $Qupcoming->bindTable(':table_specials', TABLE_SPECIALS);
        $Qupcoming->bindTable(':table_products_description', TABLE_PRODUCTS_DESCRIPTION);
        $Qupcoming->bindInt(':default_flag', 1);
        $Qupcoming->bindInt(':products_status', 1);
        $Qupcoming->bindInt(':language_id', $osC_Language->getID());
        $Qupcoming->bindInt(':max_display_upcoming_products', MODULE_CONTENT_UPCOMING_PRODUCTS_MAX_DISPLAY);
        if (MODULE_CONTENT_UPCOMING_PRODUCTS_CACHE > 0) {
            $Qupcoming->setCache('upcoming_products-' . $osC_Language->getCode() . '-' . $osC_Currencies->getCode(), MODULE_CONTENT_UPCOMING_PRODUCTS_CACHE);
        }
        $Qupcoming->execute();
        $i = 0;
        if ($Qupcoming->numberOfRows() > 0) {
            $this->_content = '<div class="upcomingProductsModule clearfix">';
            while ($Qupcoming->next()) {
                $osC_Product = new osC_Product($Qupcoming->valueInt('products_id'));
                if ($i % 3 == 0 && $i != 0) {
                    $this->_content .= '<div class="productItem clearLeft">';
                } else {
                    $this->_content .= '<div class="productItem">';
                }
                $this->_content .= '<div class="productName">' . osc_link_object(osc_href_link(FILENAME_PRODUCTS, $Qupcoming->value('products_id')), $Qupcoming->value('products_name')) . '</div>' . '<div>' . osc_link_object(osc_href_link(FILENAME_PRODUCTS, $Qupcoming->value('products_id')), $osC_Image->show($Qupcoming->value('image'), $Qupcoming->value('products_name'))) . '</div>' . '<div>' . $osC_Product->getPriceFormated(true) . '</div>' . '<div><strong>' . osC_DateTime::getLong($Qupcoming->value('date_expected')) . '</strong></div>';
                $this->_content .= '</div>';
                $i++;
            }
            $this->_content .= '</div>';
            //add the css block for this module
            $osC_Template->addStyleDeclaration('.clearLeft{clear:left;}
	                                          .upcomingProductsModule{overflow: auto; height: 100%;}
	                                          .upcomingProductsModule .productItem{width: 32%; float: left; text-align: center; padding: 2px;}
	                                          .upcomingProductsModule .productItem .productName{height:30px;}
	                                          .upcomingProductsModule .productItem div {margin:3px 0;}');
        }
        $Qupcoming->freeResult();
    }
开发者ID:ellipsonic,项目名称:tomato_app,代码行数:40,代码来源:upcoming_products.php

示例10: initialize

 function initialize()
 {
     global $osC_Database, $osC_Language, $osC_Currencies;
     $Qupcoming = $osC_Database->query('select p.products_id, pa.value as date_expected from :table_products p, :table_templates_boxes tb, :table_product_attributes pa where tb.code = :code and tb.id = pa.id and to_days(str_to_date(pa.value, "%Y-%m-%d")) >= to_days(now()) and pa.products_id = p.products_id and p.products_status = :products_status order by pa.value limit :max_display_upcoming_products');
     $Qupcoming->bindTable(':table_products', TABLE_PRODUCTS);
     $Qupcoming->bindTable(':table_templates_boxes', TABLE_TEMPLATES_BOXES);
     $Qupcoming->bindTable(':table_product_attributes', TABLE_PRODUCT_ATTRIBUTES);
     $Qupcoming->bindValue(':code', 'date_available');
     $Qupcoming->bindInt(':products_status', 1);
     $Qupcoming->bindInt(':max_display_upcoming_products', MODULE_CONTENT_UPCOMING_PRODUCTS_MAX_DISPLAY);
     if (MODULE_CONTENT_UPCOMING_PRODUCTS_CACHE > 0) {
         $Qupcoming->setCache('upcoming_products-' . $osC_Language->getCode() . '-' . $osC_Currencies->getCode(), MODULE_CONTENT_UPCOMING_PRODUCTS_CACHE);
     }
     $Qupcoming->execute();
     if ($Qupcoming->numberOfRows() > 0) {
         $this->_content = '<ol style="list-style: none;">';
         while ($Qupcoming->next()) {
             $osC_Product = new osC_Product($Qupcoming->valueInt('products_id'));
             $this->_content .= '<li>' . osC_DateTime::getLong($Qupcoming->value('date_expected')) . ': ' . osc_link_object(osc_href_link(FILENAME_PRODUCTS, $osC_Product->getKeyword()), $osC_Product->getTitle()) . ' ' . $osC_Product->getPriceFormated(true) . '</li>';
         }
         $this->_content .= '</ol>';
     }
     $Qupcoming->freeResult();
 }
开发者ID:heshuai64,项目名称:gamestore,代码行数:24,代码来源:upcoming_products.php

示例11: getProducts

 function getProducts()
 {
     $history = array();
     if (isset($this->visits['products']) && empty($this->visits['products']) === false) {
         $counter = 0;
         foreach ($this->visits['products'] as $k => $v) {
             $counter++;
             $osC_Product = new osC_Product($v['id']);
             $osC_Category = new osC_Category($osC_Product->getCategoryID());
             if ($osC_Product->isValid() === true) {
                 $history[] = array('name' => $osC_Product->getTitle(), 'id' => $osC_Product->getID(), 'keyword' => $osC_Product->getKeyword(), 'price' => SERVICE_RECENTLY_VISITED_SHOW_PRODUCT_PRICES == '1' ? $osC_Product->getPriceFormated(true) : '', 'image' => $osC_Product->getImage(), 'category_name' => $osC_Category->getTitle(), 'category_path' => $osC_Category->getPath());
             }
             if ($counter == SERVICE_RECENTLY_VISITED_MAX_PRODUCTS) {
                 break;
             }
         }
     }
     return $history;
 }
开发者ID:4DvAnCeBoY,项目名称:tomatocart-shoppingcart,代码行数:19,代码来源:recently_visited.php

示例12:

     if (isset($_GET['manufacturers'])) {
         $lc_text = osc_link_object(osc_href_link(FILENAME_PRODUCTS, $osC_Product->getKeyword() . '&manufacturers=' . $_GET['manufacturers']), $osC_Product->getTitle());
     } else {
         $lc_text = '&nbsp;' . osc_link_object(osc_href_link(FILENAME_PRODUCTS, $osC_Product->getKeyword() . ($cPath ? '&cPath=' . $cPath : '')), $osC_Product->getTitle()) . '&nbsp;';
     }
     break;
 case 'PRODUCT_LIST_MANUFACTURER':
     $lc_align = '';
     $lc_text = '&nbsp;';
     if ($osC_Product->hasManufacturer()) {
         $lc_text = '&nbsp;' . osc_link_object(osc_href_link(FILENAME_DEFAULT, 'manufacturers=' . $osC_Product->getManufacturerID()), $osC_Product->getManufacturer()) . '&nbsp;';
     }
     break;
 case 'PRODUCT_LIST_PRICE':
     $lc_align = 'right';
     $lc_text = '&nbsp;' . $osC_Product->getPriceFormated() . '&nbsp;';
     break;
 case 'PRODUCT_LIST_QUANTITY':
     $lc_align = 'right';
     $lc_text = '&nbsp;' . $osC_Product->getQuantity() . '&nbsp;';
     break;
 case 'PRODUCT_LIST_WEIGHT':
     $lc_align = 'right';
     $lc_text = '&nbsp;' . $osC_Product->getWeight() . '&nbsp;';
     break;
 case 'PRODUCT_LIST_IMAGE':
     $lc_align = 'center';
     if (isset($_GET['manufacturers'])) {
         $lc_text = osc_link_object(osc_href_link(FILENAME_PRODUCTS, $osC_Product->getKeyword() . '&manufacturers=' . $_GET['manufacturers']), $osC_Image->show($osC_Product->getImage(), $osC_Product->getTitle()));
     } else {
         $lc_text = '&nbsp;' . osc_link_object(osc_href_link(FILENAME_PRODUCTS, $osC_Product->getKeyword() . ($cPath ? '&cPath=' . $cPath : '')), $osC_Image->show($osC_Product->getImage(), $osC_Product->getTitle())) . '&nbsp;';
开发者ID:heshuai64,项目名称:gamestore,代码行数:31,代码来源:product_listing.php

示例13: while

    $Qproducts->bindInt(':parent_id', $current_category_id);
}
$Qproducts->bindTable(':table_products', TABLE_PRODUCTS);
$Qproducts->bindTable(':table_products_images', TABLE_PRODUCTS_IMAGES);
$Qproducts->bindTable(':table_products_description', TABLE_PRODUCTS_DESCRIPTION);
$Qproducts->bindInt(':default_flag', 1);
$Qproducts->bindInt(':language_id', $osC_Language->getID());
$Qproducts->bindInt(':max_display_new_products', MODULE_CONTENT_NEW_PRODUCTS_MAX_DISPLAY);
if (MODULE_CONTENT_NEW_PRODUCTS_CACHE > 0) {
    $Qproducts->setCache('new_products-' . $osC_Language->getCode() . '-' . $osC_Currencies->getCode() . '-' . $current_category_id, MODULE_CONTENT_NEW_PRODUCTS_CACHE);
}
$Qproducts->execute();
if ($Qproducts->numberOfRows()) {
    $i = 0;
    while ($Qproducts->next()) {
        if ($i % 3 == 0 && $i != 0) {
            echo '<div style="clear:both"></div>';
        }
        $osC_Product = new osC_Product($Qproducts->valueInt('products_id'));
        echo '<div style="margin-top: 10px; float:left; width: 33%; text-align: center">' . '<span style="display:block; height: 32px; text-align: center">' . osc_link_object(osc_href_link(FILENAME_PRODUCTS, $Qproducts->value('products_id')), $Qproducts->value('products_name')) . '</span>' . osc_link_object(osc_href_link(FILENAME_PRODUCTS, $Qproducts->value('products_id')), $osC_Image->show($Qproducts->value('image'), $Qproducts->value('products_name'))) . '<span style="display:block; padding: 3px; text-align: center">' . $osC_Product->getPriceFormated(true) . '</span>' . osc_link_object(osc_href_link(FILENAME_PRODUCTS, $Qproducts->value('products_id') . '&action=cart_add'), osc_draw_image_button('button_add_to_cart.png', $osC_Language->get('button_add_to_cart'))) . '</div>';
        $i++;
    }
    echo '<div style="clear:both"></div>';
}
$Qproducts->freeResult();
?>
  </div>
</div>
<!-- module new_products end //-->
<?php 
unset($osC_Box);
开发者ID:Doluci,项目名称:tomatocart,代码行数:31,代码来源:new_products.php

示例14: outputCompareProductsTable

 function outputCompareProductsTable()
 {
     global $osC_Language, $osC_Image, $osC_Weight, $osC_Currencies;
     $content = '';
     $products_images = array();
     $products_titles = array();
     $products_price = array();
     $products_weight = array();
     $products_sku = array();
     $products_manufacturers = array();
     $products_desciptions = array();
     $products_attributes = array();
     $products_variants = array();
     $cols = array('<col width="20%">');
     $col_width = round(80 / count($this->getProducts()));
     if ($this->hasContents()) {
         foreach ($this->getProducts() as $products_id) {
             $cols[] = '<col width="' . $col_width . '%">';
             $osC_Product = new osC_Product($products_id);
             $image = $osC_Product->getImages();
             $product_title = $osC_Product->getTitle();
             $product_price = $osC_Product->getPriceFormated(true);
             $product_weight = $osC_Product->getWeight();
             $product_sku = $osC_Product->getSKU();
             //if the product have any variants, it means that the $products_id should be a product string such as 1#1:1;2:2
             $variants = array();
             if ($osC_Product->hasVariants()) {
                 $product_variants = $osC_Product->getVariants();
                 if (preg_match('/^[0-9]+(#?([0-9]+:?[0-9]+)+(;?([0-9]+:?[0-9]+)+)*)+$/', $products_id)) {
                     $products_variant = $product_variants[$products_id];
                     $variants = osc_parse_variants_from_id_string($products_id);
                 } else {
                     $products_variant = $osC_Product->getDefaultVariant();
                     $variants = $products_variant['groups_id'];
                 }
                 //if the product have any variants, get the group_name:value_name string
                 if (isset($products_variant) && isset($products_variant['groups_name']) && is_array($products_variant['groups_name']) && !empty($products_variant['groups_name'])) {
                     $products_variants[$products_id]['variants'] = array();
                     foreach ($products_variant['groups_name'] as $groups_name => $value_name) {
                         $products_variants[$products_id]['variants'][] = array('name' => $groups_name, 'value' => $value_name);
                     }
                 }
                 $product_price = $osC_Currencies->displayPrice($osC_Product->getPrice($variants), $osC_Product->getTaxClassID());
                 $product_weight = $products_variant['weight'];
                 $product_sku = $products_variant['sku'];
                 $image = $products_variant['image'];
             }
             $image = is_array($image) ? $image[0]['image'] : $image;
             $products_titles[] = $product_title;
             if (!osc_empty($product_price)) {
                 $products_price[] = $product_price;
             }
             if (!osc_empty($product_weight)) {
                 $products_weight[] = $osC_Weight->display($product_weight, $osC_Product->getWeightClass());
             }
             if (!osc_empty($product_sku)) {
                 $products_sku[] = $product_sku;
             }
             if (!osc_empty($osC_Product->getManufacturer())) {
                 $products_manufacturers[] = $osC_Product->getManufacturer();
             }
             if (!osc_empty($osC_Product->getDescription())) {
                 $products_desciptions[] = $osC_Product->getDescription();
             }
             if ($osC_Product->hasAttributes()) {
                 foreach ($osC_Product->getAttributes() as $attribute) {
                     $products_attributes[$products_id]['attributes'][] = array('name' => $attribute['name'], 'value' => $attribute['value']);
                 }
             }
             $products_id = str_replace('#', '_', $products_id);
             $products_images[] = '<div class="image">' . osc_link_object(osc_href_link(FILENAME_PRODUCTS, $products_id), $osC_Image->show($image, $osC_Product->getTitle())) . '</div>' . '<div class="button">' . osc_link_object(osc_href_link(FILENAME_PRODUCTS, $products_id . '&action=cart_add' . (osc_empty(osc_parse_variants_array($variants)) ? '' : '&variants=' . osc_parse_variants_array($variants))), osc_draw_image_button('button_in_cart.gif', $osC_Language->get('button_add_to_cart'))) . '</div>';
         }
         $content .= '<table id="compareProducts" cellspacing="0" cellpadding="2" border="0">';
         //add col groups
         $content .= '<colgroup>';
         foreach ($cols as $col) {
             $content .= $col;
         }
         $content .= '</colgroup>';
         //add product header
         $content .= '<tbody>';
         $content .= '<tr class="first">';
         $content .= '<th>&nbsp;</th>';
         if (!osc_empty($products_images)) {
             foreach ($products_images as $k => $product_image) {
                 $content .= '<td' . ($k == count($products_images) - 1 ? ' class="last"' : '') . '>' . $product_image . '</td>';
             }
         }
         $content .= '</tr>';
         $content .= '</tbody>';
         //add compare details
         $content .= '<tbody>';
         $row_class = 'even';
         //add product name
         if (!osc_empty($products_titles)) {
             $content .= '<tr class="' . $row_class . '">' . '<th>' . $osC_Language->get('field_products_name') . '</th>';
             foreach ($products_titles as $k => $product_title) {
                 $content .= '<td' . ($k == count($products_titles) - 1 ? ' class="last"' : '') . '>' . $product_title . '</td>';
             }
             $content .= '</tr>';
//.........这里部分代码省略.........
开发者ID:4DvAnCeBoY,项目名称:tomatocart-shoppingcart,代码行数:101,代码来源:compare_products.php

示例15:

  <tr>
    <td width="<?php 
        echo $osC_Image->getWidth('thumbnails') + 10;
        ?>
" valign="top" align="center">

<?php 
        if ($osC_Product->hasImage()) {
            echo osc_link_object(osc_href_link(FILENAME_PRODUCTS, $osC_Product->getKeyword()), $osC_Image->show($osC_Product->getImage(), $osC_Product->getTitle()));
        }
        ?>

    </td>
    <td valign="top"><?php 
        echo osc_link_object(osc_href_link(FILENAME_PRODUCTS, $osC_Product->getKeyword()), '<b><u>' . $osC_Product->getTitle() . '</u></b>') . '<br />' . $osC_Language->get('date_added') . ' ' . osC_DateTime::getLong($osC_Product->getDateAdded()) . '<br />' . $osC_Language->get('manufacturer') . ' ' . $osC_Product->getManufacturer() . '<br /><br />' . $osC_Language->get('price') . ' ' . $osC_Product->getPriceFormated();
        ?>
</td>
    <td align="right" valign="middle"><?php 
        echo osc_link_object(osc_href_link(FILENAME_PRODUCTS, $osC_Product->getKeyword() . '&action=cart_add'), osc_draw_image_button('button_in_cart.gif', $osC_Language->get('button_add_to_cart')));
        ?>
</td>
  </tr>
  <tr>
    <td colspan="3">&nbsp;</td>
  </tr>

<?php 
    }
} else {
    ?>
开发者ID:heshuai64,项目名称:gamestore,代码行数:30,代码来源:new.php


注:本文中的osC_Product::getPriceFormated方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。