本文整理汇总了PHP中ps_product::get_flypage方法的典型用法代码示例。如果您正苦于以下问题:PHP ps_product::get_flypage方法的具体用法?PHP ps_product::get_flypage怎么用?PHP ps_product::get_flypage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ps_product
的用法示例。
在下文中一共展示了ps_product::get_flypage方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getProductBySku
function getProductBySku($sku)
{
global $database, $logger;
$logger->debug(get_class($this) . "::getProductBySku({$sku})");
$prod = new Product();
$ps_prod = new ps_product();
$ps_cat = new ps_product_category();
$query = "select product_id from #__vm_product where product_sku=" . $sku;
$database->loadQuery($query);
$id = $db->loadResult();
$prod->setOid($id);
$prod->setName($ps_prod->get_field('product_name'));
$prod->setFlypage($ps_prod->get_flypage($id));
$prod->setCategoryId($ps_cat->get_cid($id));
return $prod;
}
示例2: getItems
function getItems(&$params) {
global $CURRENCY_DISPLAY, $sess, $mm_action_url, $VM_LANG;
$db = new ps_DB;
if($rows = $this->getProductSKU( $this->NumberOfProducts, $this->SortMethod, $this->vmcategories, $this->featuredProducts, $this->specific_product_ids, $this->source, $this->catfilter ))
{
$ps_product = new ps_product;
$ps_product_category = new ps_product_category;
$pro_skus = implode("','", $rows);
$limit = $this->NumberOfProducts;
if($limit>0) {
$limit = "LIMIT $limit";
} else {
$limit = "";
}
$q = "SELECT product_id, product_name, product_parent_id, product_thumb_image, product_desc, product_full_image FROM #__{vm}_product AS p WHERE product_sku in ('$pro_skus')";
switch( $this->SortMethod ) {
case 'random':
$q .= "\n ORDER BY RAND() $limit";
break;
case 'newest':
$q .= "\n ORDER BY p.cdate DESC $limit";
break;
case 'oldest':
$q .= "\n ORDER BY p.cdate ASC $limit";
break;
default:
$q .= "\n ORDER BY p.cdate DESC $limit";
break;
}
$db->setQuery( $q );
$items = $db->loadObjectList();
//var_dump($items);die;
foreach($items as &$item) {
$product_id = $item->product_id;
$cid = $ps_product_category->get_cid( $product_id );
$product_name = $item->product_name;
$item->title = $product_name;
if ($item->product_parent_id) {
$url = "?page=shop.product_details&category_id=$cid&flypage=".$ps_product->get_flypage($item->product_parent_id);
$url .= "&product_id=" . $item->product_parent_id;
} else {
$url = "?page=shop.product_details&category_id=$cid&flypage=".$ps_product->get_flypage($item->product_id);
$url .= "&product_id=" . $item->product_id;
}
$product_link = $sess->url($mm_action_url. "index.php" . $url);
$item->link = $product_link;
$product_thumb_image = $item->product_full_image;
//$img = $this->image_url( $product_thumb_image, "alt=\"".$product_name."\"");
$item->image = IMAGEPATH.'product/'.$product_thumb_image;
$item->fulltext = $item->product_desc;
$item->introtext = $item->product_desc;
$price_base = $this->get_price($ps_product, $item->product_id);
$price_ps = $ps_product->get_price($item->product_id, true);
if (_SHOW_PRICES == '1' && $this->show_price) {
// Show price, but without "including X% tax"
$item->price = $CURRENCY_DISPLAY->getFullValue($price_base[1]);
}
if (USE_AS_CATALOGUE != 1 && $this->show_addtocart
&& isset($price_ps) && $price_ps['product_price'] // Product must have a price to add it to cart
/*&& !$ps_product->product_has_attributes($item->product_id, true) // Parent Products and Products with attributes can't be added to cart this way*/
) {
$url = "?page=shop.cart&func=cartAdd&product_id=" . $item->product_id;
$addtocart_link = $sess->url($mm_action_url. "index.php" . $url);
$item->addtocart_link = $addtocart_link;
}
}
return $this->update($params, $items);
} else return array();
}
示例3: vmGet
$order_total = 0;
$coupon_discount = vmGet($_SESSION, 'coupon_discount', 0);
$coupon_discount_before = $coupon_discount_after = $payment_discount_before = $payment_discount_after = $tax = $shipping = false;
$product_rows = array();
for ($i = 0; $i < $cart["idx"]; $i++) {
// Added for the zone shipping module
$vars["zone_qty"] += $cart[$i]["quantity"];
if ($i % 2) {
$product_rows[$i]['row_color'] = "sectiontableentry2";
} else {
$product_rows[$i]['row_color'] = "sectiontableentry1";
}
// Get product parent id if exists
$product_parent_id = $ps_product->get_field($cart[$i]["product_id"], "product_parent_id");
// Get flypage for this product
$flypage = $ps_product->get_flypage($cart[$i]["product_id"]);
// Build URL based on whether item or product
if ($product_parent_id) {
$url = $sess->url(URL . basename($_SERVER['PHP_SELF']) . "?page=shop.product_details&flypage={$flypage}&product_id={$product_parent_id}");
} else {
$url = $sess->url(URL . basename($_SERVER['PHP_SELF']) . "?page=shop.product_details&flypage={$flypage}&product_id=" . $_SESSION['cart'][$i]["product_id"]);
}
$product_rows[$i]['product_name'] = "<a href=\"{$url}\"><strong>" . shopMakeHtmlSafe($ps_product->get_field($_SESSION['cart'][$i]["product_id"], "product_name")) . "</strong></a><br />" . $ps_product->getDescriptionWithTax($_SESSION['cart'][$i]["description"], $_SESSION['cart'][$i]["product_id"]);
// Display attribute values if this an item
$product_rows[$i]['product_attributes'] = "";
if ($product_parent_id) {
$db_detail = $ps_product->attribute_sql($cart[$i]["product_id"], $product_parent_id);
while ($db_detail->next_record()) {
$product_rows[$i]['product_attributes'] .= "<br />" . $db_detail->f("attribute_name") . " ";
$product_rows[$i]['product_attributes'] .= "(" . $db_detail->f("attribute_value") . ")";
}
示例4: vmGet
//.........这里部分代码省略.........
$q .= "attribute_name='" . $db_sku->f("attribute_name") . "'";
$db_item->setQuery($q);
$db_item->query();
while ($db_item->next_record()) {
if ($ci == 0) {
$attrib_heading[] = $db_item->f("attribute_name");
$tpl->set('headings', $attrib_heading);
}
$attrib_value[] = $db_item->f("attribute_value");
}
}
if ($main_master == $parent_id) {
$master_child_count++;
}
$tpl->set('desc_width', $dw);
$tpl->set('attrib_width', $aw);
// End show Header Row
if ($ci % 2) {
$bgcolor = "vmRowOne";
} else {
$bgcolor = "vmRowTwo";
}
$products[$ci]['bgcolor'] = $bgcolor;
$products[$ci]['product_id'] = $db->f("product_id");
$products[$ci]["category_id"] = $category_id;
$products[$ci]["Itemid"] = $Itemid;
// If this is a child of a parent set the correct product_id for page return
if (@$child_id && $pp) {
$products[$ci]['parent_id'] = $db->f("product_id");
} else {
$master_id = $parent_id;
$products[$ci]['parent_id'] = $parent_id;
}
$flypage = $ps_product->get_flypage($products[$ci]['parent_id']);
$products[$ci]["flypage"] = $flypage;
// Images
// If it is item get parent:
$product_parent_id = $db->f("product_parent_id");
if ($product_parent_id != 0) {
$dbp = new PS_db();
$dbp->query("SELECT product_full_image,product_thumb_image,product_name,product_s_desc FROM #__{vm}_product WHERE product_id='{$product_parent_id}'");
$dbp->next_record();
}
$product_full_image = $parent_id != 0 && !$db->f("product_full_image") ? $dbp->f("product_full_image") : $db->f("product_full_image");
// Change
$product_thumb_image = $parent_id != 0 && !$db->f("product_thumb_image") ? $dbp->f("product_thumb_image") : $db->f("product_thumb_image");
// Change
$productData = $db->get_row();
$productArray = get_object_vars($productData);
$productArray["product_id"] = $db->f("product_id");
$productArray["product_full_image"] = $product_full_image;
// to display the full image on flypage
$productArray["product_thumb_image"] = $product_thumb_image;
$tpl->set('productArray', $productArray);
foreach ($productArray as $property => $value) {
$tpl->set($property, $value);
}
// Assemble the thumbnail image as a link to the full image
// This function is defined in the theme (theme.php)
$product_image = $tpl->vmBuildFullImageLink($productArray);
$products[$ci]['product_image'] = $product_image;
//Product Description
$link = "";
if ($child_link == "Y" && !@$child_id) {
$link = "<input type=\"hidden\" id=\"index_id" . $db->f("product_id") . "\" value=\"" . $db->f("product_id") . "\" />\n";
// If content plugins are enabled, reload the whole page; otherwise, use ajax
示例5: while
?>
<table border="0" cellpadding="0" cellspacing="0" width="100%" class="bestseller-container">
<?php
while ($db->next_record()) {
if ($i == 0) {
$sectioncolor = "sectiontableentry2";
$i += 1;
}
else {
$sectioncolor = "sectiontableentry1";
$i -= 1;
}
if( !$db->f('category_flypage') ) {
$flypage = ps_product::get_flypage( $db->f('product_id'));
}
else {
$flypage = $db->f('category_flypage');
}
$tt_item++;
$pid = $db->f("product_parent_id") ? $db->f("product_parent_id") : $db->f("product_id");
?>
<tr class="<?php echo $sectioncolor ?>">
<td width="12%"><?php printf( $tt_item); ?>.</td>
<td width="85%">
<a class="bestseller" href="<?php $sess->purl(URL . "index.php?page=shop.product_details&flypage=$flypage&product_id=" . $pid . "&category_id=" . $db->f("category_id")) ?>">
<?php $db->p("product_name"); ?>
</a>
</td>
示例6: vmGet
function notify_list($product_id)
{
global $sess, $mosConfig_fromname, $VM_LANG;
$option = vmGet($_REQUEST, 'option');
$product_id = intval($product_id);
if ($product_id == 0) {
return False;
}
$dbv = new ps_DB();
$qt = "SELECT contact_email from #__{vm}_vendor ";
$qt .= "WHERE vendor_id='1'";
$dbv->query($qt);
$dbv->next_record();
$from_email = $dbv->f("contact_email");
$db = new ps_DB();
$q = 'SELECT notify_email FROM #__{vm}_waiting_list WHERE ';
$q .= 'notified="0" AND product_id=' . $product_id;
$db->query($q);
require_once CLASSPATH . 'ps_product.php';
$ps_product = new ps_product();
while ($db->next_record()) {
// get the product name for the e-mail
$product_name = $ps_product->get_field($product_id, "product_name");
// lets make the e-mail up from the info we have
$notice_subject = sprintf($VM_LANG->_('PRODUCT_WAITING_LIST_EMAIL_SUBJECT'), $product_name);
$flypage = $ps_product->get_flypage($product_id);
// now get the url information
$url = URL . "index.php?page=shop.product_details&flypage={$flypage}&product_id={$product_id}&option={$option}&Itemid=" . $sess->getShopItemid();
$notice_body = sprintf($VM_LANG->_('PRODUCT_WAITING_LIST_EMAIL_TEXT'), $product_name, $url);
// send the e-mail
$shopper_email = $db->f("notify_email");
vmMail($from_email, $mosConfig_fromname, $shopper_email, $notice_subject, $notice_body, "");
$this->update($shopper_email, $product_id);
}
return True;
}
示例7: vmGet
for ($i = 0; $i < $cart["idx"]; $i++) {
// Added for the zone shipping module
$vars["zone_qty"] += $cart[$i]["quantity"];
if ($i % 2) {
$product_rows[$i]['row_color'] = "sectiontableentry2";
} else {
$product_rows[$i]['row_color'] = "sectiontableentry1";
}
// Get product parent id if exists
$product_parent_id = $ps_product->get_field($cart[$i]["product_id"], "product_parent_id");
// Get flypage for this product
$flypage_id = $product_parent_id;
if ($flypage_id == 0) {
$flypage_id = $cart[$i]["product_id"];
}
$flypage = $ps_product->get_flypage($flypage_id);
$category_id = vmGet($cart[$i], 'category_id', 0);
// Build URL based on whether item or product
if ($product_parent_id) {
$url = $sess->url(URL . basename($_SERVER['PHP_SELF']) . "?page=shop.product_details&flypage={$flypage}&product_id={$product_parent_id}&category_id={$category_id}");
} else {
$url = $sess->url(URL . basename($_SERVER['PHP_SELF']) . "?page=shop.product_details&flypage={$flypage}&product_id=" . $_SESSION['cart'][$i]["product_id"] . "&category_id={$category_id}");
}
$product_rows[$i]['product_name'] = "<a href=\"{$url}\"><strong>" . shopMakeHtmlSafe($ps_product->get_field($_SESSION['cart'][$i]["product_id"], "product_name")) . "</strong></a><br />" . $ps_product->getDescriptionWithTax($_SESSION['cart'][$i]["description"], $_SESSION['cart'][$i]["product_id"]);
// Display attribute values if this an item
$product_rows[$i]['product_attributes'] = "";
if ($product_parent_id) {
$db_detail = $ps_product->attribute_sql($cart[$i]["product_id"], $product_parent_id);
while ($db_detail->next_record()) {
$product_rows[$i]['product_attributes'] .= "<br />" . $db_detail->f("attribute_name") . " ";
$product_rows[$i]['product_attributes'] .= "(" . $db_detail->f("attribute_value") . ")";
示例8: add
/**
* adds an item to the shopping cart
* @author pablo
* @param array $d
*/
function add(&$d)
{
global $sess, $VM_LANG, $cart, $vmLogger, $func;
$d = $GLOBALS['vmInputFilter']->process($d);
include_class("product");
$db = new ps_DB();
$ci = 0;
$request_stock = "";
$total_quantity = 0;
$total_updated = 0;
$total_deleted = 0;
$_SESSION['last_page'] = "shop.product_details";
if (!empty($d['product_id']) && !isset($d["prod_id"])) {
if (empty($d['prod_id'])) {
$d['prod_id'] = array();
}
if (is_array($d['product_id'])) {
$d['prod_id'] = array_merge($d['prod_id'], $d['product_id']);
} else {
$d['prod_id'] = array_merge($d['prod_id'], array($d['product_id']));
}
}
//Check to see if a prod_id has been set
if (!isset($d["prod_id"])) {
return true;
}
$multiple_products = sizeof($d["prod_id"]);
//Iterate through the prod_id's and perform an add to cart for each one
for ($ikey = 0; $ikey < $multiple_products; $ikey++) {
// Create single array from multi array
$key_fields = array_keys($d);
foreach ($key_fields as $key) {
if (is_array($d[$key])) {
$e[$key] = @$d[$key][$ikey];
} else {
$e[$key] = $d[$key];
}
}
if ($multiple_products > 1) {
$func = "cartUpdate";
}
$e['product_id'] = $d['product_id'];
$e['Itemid'] = $d['Itemid'];
if (is_array($d["prod_id"])) {
$product_id = $d["prod_id"][$ikey];
} else {
$product_id = $e["prod_id"];
}
if (is_array($d["quantity"])) {
$quantity = @$d['quantity'][$ikey];
} else {
$quantity = @$e['quantity'];
}
// Check for negative quantity
if ($quantity < 0) {
vmRequest::setVar('product_id', $product_id);
$vmLogger->warning($VM_LANG->_('PHPSHOP_CART_ERROR_NO_NEGATIVE', false));
return False;
}
if (!is_numeric($quantity)) {
vmRequest::setVar('product_id', $product_id);
$vmLogger->warning($VM_LANG->_('PHPSHOP_CART_ERROR_NO_VALID_QUANTITY', false));
return False;
}
$quantity = intval($quantity);
// Check to see if checking stock quantity
if (CHECK_STOCK) {
$product_in_stock = ps_product::get_field($product_id, 'product_in_stock');
if (empty($product_in_stock)) {
$product_in_stock = 0;
}
if ($quantity > $product_in_stock) {
//Create an array for out of stock items and continue to next item
$request_stock[$ci]['product_id'] = $product_id;
$request_stock[$ci]['quantity'] = $quantity;
$ci++;
continue;
}
}
// Check if product exists and is published
if (!ps_product::product_exists($product_id)) {
$vmLogger->tip($VM_LANG->_('VM_CART_PRODUCT_NOTEXIST', false));
return false;
}
// Quick add of item
$q = "SELECT product_id FROM #__{vm}_product WHERE ";
$q .= "product_parent_id = " . (int) $product_id;
$db->query($q);
if ($db->num_rows()) {
vmRequest::setVar('product_id', $e["product_id"]);
$vmLogger->tip($VM_LANG->_('PHPSHOP_CART_SELECT_ITEM', false));
$_REQUEST['flypage'] = ps_product::get_flypage($e["product_id"]);
$GLOBALS['page'] = 'shop.product_details';
return true;
}
//.........这里部分代码省略.........
示例9: __getList
/**
* get list of product
*
*
* @access private
*/
public function __getList($params)
{
global $sess, $mm_action_url;
require_once CLASSPATH . 'ps_product.php';
$ps_product = new ps_product();
$ordering = $params->get('vm_ordering', 'cdate_asc');
$limit = $params->get('limit_items', 4);
$ordering = str_replace('_', ' ', $ordering);
$thumbWidth = (int) $params->get('thumbnail_width', 35);
$thumbHeight = (int) $params->get('thumbnail_height', 60);
$imageHeight = (int) $params->get('main_height', 300);
$imageWidth = (int) $params->get('main_width', 660);
$isThumb = $params->get('auto_renderthumb', 1);
$image_quanlity = $params->get('image_quanlity', 100);
$titleMaxChars = $params->get('title_max_chars', '100');
$isStripedTags = $params->get('auto_strip_tags', 0);
$descriptionMaxChars = $params->get('description_max_chars', 100);
$extraURL = $params->get('open_target') != 'modalbox' ? '' : '&tmpl=component';
if (trim($ordering[0]) == 'rand') {
$ordering = " RAND() ";
}
$condition = LofSliderGroupVirtuemart::buildConditionQuery($params);
// sql query
$query = ' SELECT p.*, p.product_id, p.product_publish, p.product_sku, p.product_name, p.product_url ' . ' , p.product_s_desc, product_thumb_image, product_full_image' . ' , c.category_id, c.category_flypage' . ' FROM #__{vm}_product AS p ' . ' JOIN #__{vm}_product_category_xref as pc ON p.product_id=pc.product_id ';
$query .= $condition;
$query .= ' JOIN #__{vm}_category as c ON pc.category_id=c.category_id ';
$query .= ' WHERE p.product_publish = \'Y\' AND c.category_publish = \'Y\' AND product_parent_id=0 ';
if (CHECK_STOCK && PSHOP_SHOW_OUT_OF_STOCK_PRODUCTS != '1') {
$query .= ' AND product_in_stock > 0 ';
}
$query .= ' ORDER BY ' . $ordering;
$query .= ' LIMIT ' . $limit;
require_once CLASSPATH . 'ps_product.php';
$ps_product = new ps_product();
$database = new ps_DB();
$database->query($query);
$rows = $database->record;
if (!empty($rows)) {
foreach ($rows as $key => $item) {
$tmpimage = $rows[$key]->product_full_image;
if (!(strtolower(substr($tmpimage, 0, 4)) == 'http')) {
$rows[$key]->product_image_url = IMAGEURL . 'product/' . $rows[$key]->product_full_image;
} else {
$rows[$key]->product_image_url = $rows[$key]->product_full_image;
}
$cid = $rows[$key]->category_id;
// $rows[$key]->description = '<div class="vm-product-snapshot">'.$ps_product->product_snapshot($rows[$key]->product_sku, true, true).'</div>';
$rows[$key]->description = $this->substring($rows[$key]->product_desc, $descriptionMaxChars, $isStripedTags);
$rows[$key]->introtext = $rows[$key]->product_desc;
$flypage = $rows[$key]->category_flypage ? $rows[$key]->category_flypage : $ps_product->get_flypage($rows[$key]->product_id);
$rows[$key]->link = '?page=shop.product_details&category_id=' . $cid . '&flypage=' . $flypage . '&product_id=' . $rows[$key]->product_id . $extraURL;
$rows[$key]->link = $sess->url($mm_action_url . "index.php" . $rows[$key]->link);
$rows[$key]->title = $this->substring($rows[$key]->product_name, $titleMaxChars);
$rows[$key]->mainImage = $rows[$key]->thumbnail = '';
if ($rows[$key]->product_image_url && ($image = self::renderThumb($rows[$key]->product_image_url, $imageWidth, $imageHeight, $rows[$key]->title, $isThumb, $image_quanlity))) {
$rows[$key]->mainImage = $image;
}
if ($rows[$key]->product_image_url && ($image = self::renderThumb($rows[$key]->product_image_url, $thumbWidth, $thumbHeight, $rows[$key]->title, $isThumb, $image_quanlity))) {
$rows[$key]->thumbnail = $image;
}
$url = "?page=shop.cart&func=cartAdd&product_id=" . $rows[$key]->product_id;
$rows[$key]->addtocart_link = $sess->url($mm_action_url . "index.php" . $url);
}
return $rows;
}
return array();
}