本文整理汇总了PHP中osC_Product::getDescription方法的典型用法代码示例。如果您正苦于以下问题:PHP osC_Product::getDescription方法的具体用法?PHP osC_Product::getDescription怎么用?PHP osC_Product::getDescription使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类osC_Product
的用法示例。
在下文中一共展示了osC_Product::getDescription方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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"> </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;
}
示例2: buildProductsRss
function buildProductsRss($group)
{
global $osC_Language, $osC_Image;
$group_title = $group . '_products';
$rss = array();
$rss['rss'] = array();
$rss['rss attr'] = array('xmlns:atom' => 'http://www.w3.org/2005/Atom', 'version' => '2.0');
//channel
$rss['rss']['channel'] = array('title' => '<![CDATA[' . $osC_Language->get($group_title) . ']]>', 'link' => '<![CDATA[' . osc_href_link(FILENAME_PRODUCTS, $group) . ']]>', 'description' => '<![CDATA[' . $osC_Language->get($group_title) . ']]>', 'pubDate' => date("D, d M Y H:i:s O"));
//items
if ($group == "new") {
$Qproducts = osC_Product::getListingNew();
} else {
if ($group == 'special') {
$Qproducts = osC_Specials::getListing();
} else {
if ($group == 'feature') {
$Qproducts = osC_Product::getListingFeature();
}
}
}
$items = array();
while ($Qproducts->next()) {
$osC_Product = new osC_Product($Qproducts->valueInt('products_id'));
$link = osc_href_link(FILENAME_PRODUCTS, $Qproducts->valueInt('products_id'), 'NONSSL', false, false, true);
$description = '
<![CDATA[
<table>
<tr>
<td align="center" valign="top">' . osc_link_object($link, osc_image($osC_Image->getImageUrl($osC_Product->getImage(), 'product_info'), $osC_Product->getTitle())) . '</td>
<td valign="top">' . $osC_Product->getDescription() . '</td>
</tr>
</table>
]]>';
$items[] = array('title' => '<![CDATA[' . $osC_Product->getTitle() . ' -- ' . $osC_Product->getPriceFormated() . ']]>', 'link' => '<![CDATA[' . $link . ']]>', 'description' => $description, 'pubDate' => date("D, d M Y H:i:s O"));
}
$rss['rss']['channel']['item'] = $items;
return $rss;
}
示例3: 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> </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>';
//.........这里部分代码省略.........
示例4:
?>
<div class="featured-banner"></div>
<?php
}
?>
<div class="left">
<?php
echo osc_link_object(osc_href_link(FILENAME_PRODUCTS, $product['products_id']), $product['products_image'], 'id="img_ac_newproductsmodule_' . $product['products_id'] . '"');
?>
<h3><?php
echo osc_link_object(osc_href_link(FILENAME_PRODUCTS, $product['products_id']), $product['products_name']);
?>
</h3>
<p class="description"><?php
echo strip_tags($osC_Product->getDescription());
?>
</p>
</div>
<div class="right">
<span class="price"><?php
echo $osC_Product->getPriceFormated(true);
?>
</span>
<span class="buttons hidden-phone">
<a id="ac_newproductsmodule_<?php
echo $product['products_id'];
?>
" class="btn btn-small btn-info ajaxAddToCart" href="<?php
echo osc_href_link(FILENAME_PRODUCTS, $product['products_id'] . '&action=cart_add');
?>
示例5: GoogleCart
function process_button()
{
global $osC_ShoppingCart, $osC_Tax, $osC_Language, $osC_Currencies, $osC_Session;
require_once 'includes/classes/product.php';
require_once 'ext/googlecheckout/googlecart.php';
require_once 'ext/googlecheckout/googleitem.php';
require_once 'ext/googlecheckout/googleshipping.php';
$cart = new GoogleCart(MODULE_PAYMENT_GCHECKOUT_MERCHANT_ID, MODULE_PAYMENT_GCHECKOUT_MERCHANT_KEY, MODULE_PAYMENT_GCHECKOUT_SERVER, MODULE_PAYMENT_GCHECKOUT_CURRENCY);
//transfer the whole cart
if (MODULE_PAYMENT_GCHECKOUT_TRANSFER_CART == '1') {
//products
$products = $osC_ShoppingCart->getProducts();
foreach ($products as $product) {
$name = $product['name'];
//gift certificate
if ($product['type'] == PRODUCT_TYPE_GIFT_CERTIFICATE) {
$name .= "\n" . ' - ' . $osC_Language->get('senders_name') . ': ' . $product['gc_data']['senders_name'];
if ($product['gc_data']['type'] == GIFT_CERTIFICATE_TYPE_EMAIL) {
$name .= "\n" . ' - ' . $osC_Language->get('senders_email') . ': ' . $product['gc_data']['senders_email'];
}
$name .= "\n" . ' - ' . $osC_Language->get('recipients_name') . ': ' . $product['gc_data']['recipients_name'];
if ($product['gc_data']['type'] == GIFT_CERTIFICATE_TYPE_EMAIL) {
$name .= "\n" . ' - ' . $osC_Language->get('recipients_email') . ': ' . $product['gc_data']['recipients_email'];
}
$name .= "\n" . ' - ' . $osC_Language->get('message') . ': ' . $product['gc_data']['message'];
}
//variants
$variants_array = array();
if ($osC_ShoppingCart->hasVariants($product['id'])) {
foreach ($osC_ShoppingCart->getVariants($product['id']) as $variants) {
$variants_array[$variants['groups_id']] = $variants['variants_values_id'];
$name .= "\n" . ' - ' . $variants['groups_name'] . ': ' . $variants['values_name'];
}
}
//get tax
$tax = $osC_Tax->getTaxRate($product['tax_class_id'], $osC_ShoppingCart->getTaxingAddress('country_id'), $osC_ShoppingCart->getTaxingAddress('zone_id'));
if (DISPLAY_PRICE_WITH_TAX == '1') {
$price = $osC_Currencies->addTaxRateToPrice($product['final_price'], $tax);
} else {
$price = $product['final_price'] + osc_round($product['final_price'] * ($tax / 100), $osC_Currencies->currencies[DEFAULT_CURRENCY]['decimal_places']);
}
$osC_Product = new osC_Product($product['id']);
$gitem = new GoogleItem($name, $osC_Product->getDescription(), intval($product['quantity']), $price);
$gitem->SetMerchantPrivateItemData(new MerchantPrivateItemData(array('item' => base64_encode(serialize($product)))));
$gitem->SetMerchantItemId($product['id']);
$cart->AddItem($gitem);
}
//add order totals modules into gcheckout cart as item such as: coupon, gift certificate, low order fee
//exclude modules: sub_total, tax, total and shipping module
$shipping_cost = 0;
foreach ($osC_ShoppingCart->getOrderTotals() as $total) {
if (!in_array($total['code'], $this->_ignore_order_totals) && strstr($total['code'], 'shipping') === FALSE) {
$gitem = new GoogleItem($total['title'], '', '1', $total['value'] + $total['tax']);
$gitem->SetMerchantPrivateItemData(new MerchantPrivateItemData(array('order_total' => base64_encode(serialize($total)))));
$cart->AddItem($gitem);
} else {
if (strstr($total['code'], 'shipping') !== FALSE) {
$shipping_cost = $total['value'] + $total['tax'];
}
}
}
//shipping method
$cart->AddShipping(new GooglePickUp($osC_ShoppingCart->getShippingMethod('title'), $shipping_cost));
} else {
$gitem = new GoogleItem(STORE_NAME, '', 1, $osC_ShoppingCart->getTotal());
$gitem->SetMerchantPrivateItemData(new MerchantPrivateItemData(array('item' => base64_encode(serialize(STORE_NAME)))));
$cart->AddItem($gitem);
}
//continue shopping url
$cart->SetContinueShoppingUrl(osc_href_link(FILENAME_CHECKOUT, 'process', 'NOSSL', null, null, true));
//edit cart url
$cart->SetEditCartUrl(osc_href_link(FILENAME_CHECKOUT, '', 'NOSSL', null, null, true));
// Request buyer's phone number
$cart->SetRequestBuyerPhone(false);
$private_data = $osC_Session->getID() . ';' . $osC_Session->getName();
$cart->SetMerchantPrivateData(new MerchantPrivateData(array('orders_id' => $this->_order_id, 'session-data' => $private_data)));
// Display Google Checkout button
return $cart->CheckoutButtonCode();
}
示例6: output_compare_products_table
function output_compare_products_table()
{
global $osC_Language, $osC_Image, $osC_Weight, $osC_Currencies, $toC_Compare_Products, $osC_Services;
$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($toC_Compare_Products->getProducts()));
if ($toC_Compare_Products->hasContents()) {
foreach ($toC_Compare_Products->getProducts() as $products_id_string) {
$cols[] = '<col width="' . $col_width . '%">';
$osC_Product = new osC_Product($products_id_string);
$products_id = osc_get_product_id($products_id_string);
$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_string)) {
$products_variant = $product_variants[$products_id_string];
$variants = osc_parse_variants_from_id_string($products_id_string);
} 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_string]['variants'] = array();
foreach ($products_variant['groups_name'] as $groups_name => $value_name) {
$products_variants[$products_id_string]['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_string = str_replace('#', '_', $products_id_string);
//used to fix bug [#209 - Compare / wishlist variant problem]
if (isset($osC_Services) && $osC_Services->isStarted('sefu') && count($variants) > 0) {
$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 . '&pid=' . $products_id_string . '&action=cart_add'), '<i class="icon-shopping-cart icon-white"></i> ' . $osC_Language->get('button_add_to_cart'), 'class="btn btn-mini"') . '</div>';
} else {
$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_string . '&action=cart_add'), '<i class="icon-shopping-cart icon-white"></i> ' . $osC_Language->get('button_add_to_cart'), 'class="btn btn-mini"') . '</div>';
}
}
$content .= '<table class="table table-hover table-striped">';
//add col groups
$content .= '<colgroup>';
foreach ($cols as $col) {
$content .= $col;
}
$content .= '</colgroup>';
//add product header
$content .= '<tbody>';
$content .= '<tr class="first">';
$content .= '<th> </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
//.........这里部分代码省略.........