本文整理汇总了PHP中shopFunctionsF类的典型用法代码示例。如果您正苦于以下问题:PHP shopFunctionsF类的具体用法?PHP shopFunctionsF怎么用?PHP shopFunctionsF使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了shopFunctionsF类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: mailRecommend
/**
* Send the Recommend to a friend email.
*
* @author Kohl Patrick,
*/
public function mailRecommend () {
JRequest::checkToken () or jexit ('Invalid Token');
// Display it all
$view = $this->getView ('recommend', 'html');
if(!VmConfig::get('show_emailfriend',false)){
$view->display ();
}
if (!class_exists ('shopFunctionsF')) {
require(JPATH_VM_SITE . DS . 'helpers' . DS . 'shopfunctionsf.php');
}
if(!class_exists('ShopFunctions')) require(JPATH_VM_ADMINISTRATOR.DS.'helpers'.DS.'shopfunctions.php');
$mainframe = JFactory::getApplication ();
$vars = array();
$virtuemart_product_idArray = JRequest::getInt ('virtuemart_product_id', 0);
if (is_array ($virtuemart_product_idArray)) {
$virtuemart_product_id = (int)$virtuemart_product_idArray[0];
} else {
$virtuemart_product_id = (int)$virtuemart_product_idArray;
}
$productModel = VmModel::getModel ('product');
$vars['product'] = $productModel->getProduct ($virtuemart_product_id);
$user = JFactory::getUser ();
$vars['user'] = array('name' => $user->name, 'email' => $user->email);
$vars['vendorEmail'] = $user->email;
$vendorModel = VmModel::getModel ('vendor');
$vendor = $vendorModel->getVendor ($vars['product']->virtuemart_vendor_id);
$vendorModel->addImages ($vars['vendor']);
$vendor->vendorFields = $vendorModel->getVendorAddressFields();
$vars['vendor'] = $vendor;
$vars['vendorAddress']= shopFunctions::renderVendorAddress($vars['product']->virtuemart_vendor_id);
$vars['vendorEmail']= $user->email;
$vars['vendor']->vendor_name =$user->name;
$toMail = JRequest::getVar ('email'); //is sanitized then
$toMail = str_replace (array('\'', '"', ',', '%', '*', '/', '\\', '?', '^', '`', '{', '}', '|', '~'), array(''), $toMail);
if (shopFunctionsF::renderMail ('recommend', $toMail, $vars, 'productdetails', TRUE)) {
$string = 'COM_VIRTUEMART_MAIL_SEND_SUCCESSFULLY';
} else {
$string = 'COM_VIRTUEMART_MAIL_NOT_SEND_SUCCESSFULLY';
}
$mainframe->enqueueMessage (JText::_ ($string));
// vmdebug('my email vars ',$vars,$TOMail);
$view->setLayout ('mail_confirmed');
$view->display ();
}
示例2: notifyList
/**
* Notify customers product is back in stock
* @author RolandD
* @author Christopher Rouseel
* @todo Add Itemid &Itemid='.$sess->getShopItemid()
* @todo Do something if the mail cannot be send
* @todo Update mail from
* @todo Get the from name/email from the vendor
*/
public function notifyList($virtuemart_product_id)
{
if (!$virtuemart_product_id) {
return false;
}
//sanitize id
$virtuemart_product_id = (int) $virtuemart_product_id;
if (!class_exists('shopFunctionsF')) {
require JPATH_VM_SITE . DS . 'helpers' . DS . 'shopfunctionsf.php';
}
$vars = array();
$db = JFactory::getDBO();
$q = "SELECT * FROM #__virtuemart_waitingusers ";
$q .= "WHERE notified = '0' AND virtuemart_product_id = " . $virtuemart_product_id;
$db->setQuery($q);
$waiting_users = $db->loadObjectList();
/* Load the product details */
$q = "SELECT product_name FROM `#__virtuemart_products_" . VMLANG . "` WHERE virtuemart_product_id = " . $virtuemart_product_id;
$db->setQuery($q);
$vars['productName'] = $db->loadResult();
/*TODO old URL here Now get the url information */
$vars['url'] = JURI::root() . 'index.php?option=com_virtuemart&view=productdetails&virtuemart_product_id=' . $virtuemart_product_id;
foreach ($waiting_users as $key => $waiting_user) {
$vars['user'] = $waiting_user;
if (shopFunctionsF::renderMail('productdetails', $waiting_user->notify_email, $vars)) {
$db->setQuery('UPDATE #__virtuemart_waitingusers SET notified=1 WHERE virtuemart_waitinguser_id=' . $waiting_user->virtuemart_waitinguser_id);
$db->query();
}
}
return true;
}
示例3: display
/**
* Displays the view, collects needed data for the different layouts
*
* Okey I try now a completly new idea.
* We make a function for every tab and the display is getting the right tabs by an own function
* putting that in an array and after that we call the preparedataforlayoutBlub
*
* @author Max Milbers
*/
function display($tpl = null)
{
$document = JFactory::getDocument();
$mainframe = JFactory::getApplication();
$pathway = $mainframe->getPathway();
$layoutName = $this->getLayout();
$model = VmModel::getModel();
$virtuemart_vendor_id = JRequest::getInt('virtuemart_vendor_id');
// if ($layoutName=='default') {
if (empty($virtuemart_vendor_id)) {
$document->setTitle(JText::_('COM_VIRTUEMART_VENDOR_LIST'));
$pathway->addItem(JText::_('COM_VIRTUEMART_VENDOR_LIST'));
$vendors = $model->getVendors();
$model->addImages($vendors);
$this->assignRef('vendors', $vendors);
} else {
$vendor = $model->getVendor($virtuemart_vendor_id);
$model->addImages($vendor);
if (VmConfig::get('enable_content_plugin', 0)) {
if (!class_exists('shopFunctionsF')) {
require JPATH_VM_SITE . DS . 'helpers' . DS . 'shopfunctionsf.php';
}
shopFunctionsF::triggerContentPlugin($vendor, 'vendor', 'vendor_store_desc');
shopFunctionsF::triggerContentPlugin($vendor, 'vendor', 'vendor_terms_of_service');
}
$this->assignRef('vendor', $vendor);
if (!class_exists('VirtueMartModelVendor')) {
require JPATH_VM_ADMINISTRATOR . DS . 'models' . DS . 'vendor.php';
}
$userId = VirtueMartModelVendor::getUserIdByVendorId($virtuemart_vendor_id);
//$usermodel = VmModel::getModel('user');
//$virtuemart_userinfo_id = $usermodel->getBTuserinfo_id($userId);
//$usermodel->getVendor($virtuemart_vendor_id);
//$userFields = $usermodel->getUserInfoInUserFields($layoutName, 'BT', $virtuemart_userinfo_id,true,true);
//$this->assignRef('userFields', $userFields);
if ($layoutName == 'tos') {
$document->setTitle(JText::_('COM_VIRTUEMART_VENDOR_TOS'));
$pathway->addItem(JText::_('COM_VIRTUEMART_VENDOR_TOS'));
} elseif ($layoutName == 'contact') {
$user = JFactory::getUser();
$document->setTitle(JText::_('COM_VIRTUEMART_VENDOR_CONTACT'));
$pathway->addItem(JText::_('COM_VIRTUEMART_VENDOR_CONTACT'));
$this->assignRef('user', $user);
} else {
$document->setTitle(JText::_('COM_VIRTUEMART_VENDOR_DETAILS'));
$pathway->addItem(JText::_('COM_VIRTUEMART_VENDOR_DETAILS'));
$this->setLayout('details');
}
$linkdetails = '<a href="' . JRoute::_('index.php?option=com_virtuemart&view=vendor&layout=details&virtuemart_vendor_id=' . $virtuemart_vendor_id, FALSE) . '">' . JText::_('COM_VIRTUEMART_VENDOR_DETAILS') . '</a>';
$linkcontact = '<a href="' . JRoute::_('index.php?option=com_virtuemart&view=vendor&layout=contact&virtuemart_vendor_id=' . $virtuemart_vendor_id, FALSE) . '">' . JText::_('COM_VIRTUEMART_VENDOR_CONTACT') . '</a>';
$linktos = '<a href="' . JRoute::_('index.php?option=com_virtuemart&view=vendor&layout=tos&virtuemart_vendor_id=' . $virtuemart_vendor_id, FALSE) . '">' . JText::_('COM_VIRTUEMART_VENDOR_TOS') . '</a>';
//$this->assignRef('lineSeparator', $lineSeparator);
$this->assignRef('linkdetails', $linkdetails);
$this->assignRef('linkcontact', $linkcontact);
$this->assignRef('linktos', $linktos);
}
parent::display($tpl);
}
示例4: mailAskquestion
/**
* Send the ask question email.
* @author Kohl Patrick, Christopher Roussel
*/
public function mailAskquestion()
{
vRequest::vmCheckToken();
if (!class_exists('shopFunctionsF')) {
require VMPATH_SITE . DS . 'helpers' . DS . 'shopfunctionsf.php';
}
$model = tmsModel::getModel('vendor');
$mainframe = JFactory::getApplication();
$vars = array();
$min = tsmConfig::get('asks_minimum_comment_length', 50) + 1;
$max = tsmConfig::get('asks_maximum_comment_length', 2000) - 1;
$commentSize = vRequest::getString('comment');
if (function_exists('mb_strlen')) {
$commentSize = mb_strlen($commentSize);
} else {
$commentSize = strlen($commentSize);
}
$validMail = filter_var(vRequest::getVar('email'), FILTER_VALIDATE_EMAIL);
$virtuemart_vendor_id = vRequest::getInt('virtuemart_vendor_id', 1);
if (!class_exists('VirtueMartModelVendor')) {
require VMPATH_ADMIN . DS . 'models' . DS . 'vendor.php';
}
$userId = VirtueMartModelVendor::getUserIdByVendorId($virtuemart_vendor_id);
//$vendorUser = JFactory::getUser($userId);
if ($commentSize < $min || $commentSize > $max || !$validMail) {
$this->setRedirect(JRoute::_('index.php?option=com_virtuemart&view=vendor&task=contact&virtuemart_vendor_id=' . $virtuemart_vendor_id, FALSE), tsmText::_('COM_VIRTUEMART_COMMENT_NOT_VALID_JS'));
return;
}
$user = JFactory::getUser();
$fromMail = vRequest::getVar('email');
//is sanitized then
$fromName = vRequest::getVar('name', '');
//is sanitized then
$fromMail = str_replace(array('\'', '"', ',', '%', '*', '/', '\\', '?', '^', '`', '{', '}', '|', '~'), array(''), $fromMail);
$fromName = str_replace(array('\'', '"', ',', '%', '*', '/', '\\', '?', '^', '`', '{', '}', '|', '~'), array(''), $fromName);
if (!empty($user->id)) {
if (empty($fromMail)) {
$fromMail = $user->email;
}
if (empty($fromName)) {
$fromName = $user->name;
}
}
$vars['user'] = array('name' => $fromName, 'email' => $fromMail);
$VendorEmail = $model->getVendorEmail($virtuemart_vendor_id);
$vars['vendor'] = array('vendor_store_name' => $fromName);
if (shopFunctionsF::renderMail('vendor', $VendorEmail, $vars, 'vendor')) {
$string = 'COM_VIRTUEMART_MAIL_SEND_SUCCESSFULLY';
} else {
$string = 'COM_VIRTUEMART_MAIL_NOT_SEND_SUCCESSFULLY';
}
$mainframe->enqueueMessage(tsmText::_($string));
// Display it all
$view = $this->getView('vendor', 'html');
$view->setLayout('mail_confirmed');
$view->display();
}
示例5: display
/**
* Function Description
*
* @author RolandD
* @author George
* @access public
*/
public function display($cachable = false, $urlparams = false)
{
if (JRequest::getvar('search')) {
$view = $this->getView('category', 'html');
$view->display();
} else {
// Display it all
$safeurlparams = array('virtuemart_category_id' => 'INT', 'virtuemart_manufacturer_id' => 'INT', 'virtuemart_currency_id' => 'INT', 'return' => 'BASE64', 'lang' => 'CMD', 'orderby' => 'CMD', 'limitstart' => 'CMD', 'order' => 'CMD', 'limit' => 'CMD');
parent::display(true, $safeurlparams);
}
if ($categoryId = JRequest::getInt('virtuemart_category_id', 0)) {
shopFunctionsF::setLastVisitedCategoryId($categoryId);
}
}
示例6: display
function display($tpl = null)
{
$document = JFactory::getDocument();
$mainframe = JFactory::getApplication();
$pathway = $mainframe->getPathway();
if (!class_exists('VmImage')) {
require VMPATH_ADMIN . DS . 'helpers' . DS . 'image.php';
}
$virtuemart_manufacturer_id = vRequest::getInt('virtuemart_manufacturer_id', 0);
$mf_category_id = vRequest::getInt('mf_category_id', 0);
// get necessary models
$model = VmModel::getModel('manufacturer');
if ($virtuemart_manufacturer_id != 0) {
$manufacturer = $model->getManufacturer();
$model->addImages($manufacturer, 1);
$manufacturerImage = $manufacturer->images[0]->displayMediaThumb('class="manufacturer-image"', false);
if (VmConfig::get('enable_content_plugin', 0)) {
if (!class_exists('shopFunctionsF')) {
require VMPATH_SITE . DS . 'helpers' . DS . 'shopfunctionsf.php';
}
shopFunctionsF::triggerContentPlugin($manufacturer, 'manufacturer', 'mf_desc');
}
$document->setTitle(vmText::_('COM_VIRTUEMART_MANUFACTURER_DETAILS') . ' ' . strip_tags($manufacturer->mf_name));
//added so that the canonical points to page with visible products thx to P2Peter
// remove joomla canonical before adding it
foreach ($document->_links as $k => $array) {
if ($array['relation'] == 'canonical') {
unset($document->_links[$k]);
break;
}
}
$document->addHeadLink(JRoute::_('index.php?option=com_virtuemart&view=category&virtuemart_manufacturer_id=' . $virtuemart_manufacturer_id, FALSE), 'canonical', 'rel', '');
$this->assignRef('manufacturerImage', $manufacturerImage);
$this->assignRef('manufacturer', $manufacturer);
$pathway->addItem(strip_tags($manufacturer->mf_name));
$this->setLayout('details');
} else {
$document->setTitle(vmText::_('COM_VIRTUEMART_MANUFACTURER_PAGE'));
$manufacturers = $model->getManufacturers(true, true, true);
$model->addImages($manufacturers, 1);
$this->assignRef('manufacturers', $manufacturers);
$this->setLayout('default');
}
parent::display($tpl);
}
示例7: display
public function display($tpl = null)
{
$document = JFactory::getDocument();
$layoutName = $this->getLayout();
if (!$layoutName) {
$layoutName = JRequest::getWord('layout', 'default');
}
$this->assignRef('layoutName', $layoutName);
$format = JRequest::getWord('format');
if (!class_exists('VirtueMartCart')) {
require JPATH_VM_SITE . DS . 'helpers' . DS . 'cart.php';
}
$cart = VirtueMartCart::getCart();
$this->assignRef('cart', $cart);
$this->prepareContinueLink();
shopFunctionsF::setVmTemplate($this, 0, 0, $layoutName);
parent::display($tpl);
}
示例8: prepareContinueLink
public function prepareContinueLink()
{
$virtuemart_category_id = shopFunctionsF::getLastVisitedCategoryId();
$categoryStr = '';
if ($virtuemart_category_id) {
$categoryStr = '&virtuemart_category_id=' . $virtuemart_category_id;
}
$ItemidStr = '';
$Itemid = shopFunctionsF::getLastVisitedItemId();
if (!empty($Itemid)) {
$ItemidStr = '&Itemid=' . $Itemid;
}
$this->continue_link = JRoute::_('index.php?option=com_virtuemart&view=category' . $categoryStr . $ItemidStr, FALSE);
//$this->continue_link_html = '<a class="continue_link" href="' . $continue_link . '" ><span>' . JText::_('COM_VIRTUEMART_CONTINUE_SHOPPING') . '</span></a>';
$this->continue_link_html = '<a class="continue continue_link" href="' . $this->continue_link . '">' . JText::_('COM_VIRTUEMART_CONTINUE_SHOPPING') . '</a>';
$this->cart_link = JRoute::_('index.php?option=com_virtuemart&view=cart' . $ItemidStr, FALSE);
return;
}
示例9: prepareContinueLink
private function prepareContinueLink()
{
// Get a continue link
$menuid = JRequest::getVar('Itemid', '');
if (!empty($menuid)) {
$menuid = '&Itemid=' . $menuid;
}
$virtuemart_category_id = shopFunctionsF::getLastVisitedCategoryId();
$categoryLink = '';
if ($virtuemart_category_id) {
$categoryLink = '&virtuemart_category_id=' . $virtuemart_category_id;
}
$continue_link = JRoute::_('index.php?option=com_virtuemart&view=category' . $categoryLink . $menuid, FALSE);
$continue_link_html = '<a class="continue_link" href="' . $continue_link . '" ><span>' . JText::_('COM_VIRTUEMART_CONTINUE_SHOPPING') . '</span></a>';
$this->assignRef('continue_link_html', $continue_link_html);
$this->assignRef('continue_link', $continue_link);
$cart_link = JRoute::_('index.php?option=com_virtuemart&view=cart' . $menuid, FALSE);
$this->assignRef('cart_link', $cart_link);
}
示例10: display
/**
* Function Description
*
* @author RolandD
* @author George
* @access public
*/
public function display($cachable = false, $urlparams = false)
{
if (JRequest::getvar('search')) {
$view = $this->getView('category', 'html');
$view->display();
} else {
// Display it all
$document = JFactory::getDocument();
$viewType = $document->getType();
$viewName = JRequest::getCmd('view', $this->default_view);
$viewLayout = JRequest::getCmd('layout', 'default');
$view = $this->getView($viewName, $viewType, '', array('base_path' => $this->basePath, 'layout' => $viewLayout));
$view->assignRef('document', $document);
$view->display();
}
if ($categoryId = JRequest::getInt('virtuemart_category_id', 0)) {
shopFunctionsF::setLastVisitedCategoryId($categoryId);
}
return $this;
}
示例11: InvoiceNumberReserved
static function InvoiceNumberReserved($invoice_number)
{
if (!class_exists('ShopFunctionsF')) {
require JPATH_VM_SITE . DS . 'helpers' . DS . 'shopfunctionsf.php';
}
return shopFunctionsF::InvoiceNumberReserved($invoice_number);
}
示例12:
echo shopFunctionsF::getInvoiceDownloadButton($row);
?>
</td>
<td align="left">
<?php
echo vmJsApi::date($row->created_on, 'LC4', true);
?>
</td>
<!--td align="left">
<?php
//echo vmJsApi::date($row->modified_on,'LC3',true);
?>
</td -->
<td align="left">
<?php
echo shopFunctionsF::getOrderStatusName($row->order_status);
?>
</td>
<td align="left">
<?php
echo $this->currency->priceDisplay($row->order_total, $row->currency);
?>
</td>
</tr>
<?php
$k = 1 - $k;
}
?>
</table>
</div>
<?php
示例13: notifyList
/**
* Notify customers product is back in stock
*
* @author RolandD
* @author Christopher Rouseel
* @todo Add Itemid
* @todo Do something if the mail cannot be send
* @todo Update mail from
* @todo Get the from name/email from the vendor
*/
public function notifyList($virtuemart_product_id, $subject = '', $mailbody = '', $max_number = 0)
{
if (!$virtuemart_product_id) {
return FALSE;
}
//sanitize id
$virtuemart_product_id = (int) $virtuemart_product_id;
$max_number = (int) $max_number;
if (!class_exists('shopFunctionsF')) {
require JPATH_VM_SITE . DS . 'helpers' . DS . 'shopfunctionsf.php';
}
$vars = array();
$waitinglistModel = VmModel::getModel('waitinglist');
$waiting_users = $waitinglistModel->getWaitingusers($virtuemart_product_id);
/* Load the product details */
$db = JFactory::getDbo();
$q = "SELECT l.product_name,product_in_stock FROM `#__virtuemart_products_" . VMLANG . "` l\r\n\t\t\t\tJOIN `#__virtuemart_products` p ON p.virtuemart_product_id=l.virtuemart_product_id\r\n\t\t\t WHERE p.virtuemart_product_id = " . $virtuemart_product_id;
$db->setQuery($q);
$item = $db->loadObject();
$vars['productName'] = $item->product_name;
/*
if ($item->product_in_stock <= 0) {
return FALSE;
}
*/
$url = JURI::root() . 'index.php?option=com_virtuemart&view=productdetails&virtuemart_product_id=' . $virtuemart_product_id;
$vars['link'] = '<a href="' . $url . '">' . $item->product_name . '</a>';
if (empty($subject)) {
$subject = JText::sprintf('COM_VIRTUEMART_PRODUCT_WAITING_LIST_EMAIL_SUBJECT', $item->product_name);
}
$vars['subject'] = $subject;
$vars['mailbody'] = $mailbody;
$virtuemart_vendor_id = 1;
$vendorModel = VmModel::getModel('vendor');
$vendor = $vendorModel->getVendor($virtuemart_vendor_id);
$vendorModel->addImages($vendor);
$vars['vendor'] = $vendor;
$vars['vendorAddress'] = shopFunctions::renderVendorAddress($virtuemart_vendor_id);
$vendorEmail = $vendorModel->getVendorEmail($virtuemart_vendor_id);
$vars['vendorEmail'] = $vendorEmail;
$i = 0;
foreach ($waiting_users as $waiting_user) {
$vars['user'] = $waiting_user->name;
if (shopFunctionsF::renderMail('productdetails', $waiting_user->notify_email, $vars, 'productdetails')) {
$db->setQuery('UPDATE #__virtuemart_waitingusers SET notified=1 WHERE virtuemart_waitinguser_id=' . $waiting_user->virtuemart_waitinguser_id);
$db->query();
$i++;
}
if (!empty($max_number) && $i >= $max_number) {
break;
}
}
return TRUE;
}
示例14: display
public function display($tpl = NULL)
{
$show_prices = VmConfig::get('show_prices', 1);
if ($show_prices == '1') {
if (!class_exists('calculationHelper')) {
require JPATH_VM_ADMINISTRATOR . DS . 'helpers' . DS . 'calculationh.php';
}
}
$doc = JFactory::getDocument();
if (!class_exists('VmImage')) {
require JPATH_VM_ADMINISTRATOR . DS . 'helpers' . DS . 'image.php';
}
$productModel = VmModel::getModel('product');
$categoryId = JRequest::getInt('virtuemart_category_id', false);
$feed_show_prices = VmConfig::get('feed_cat_show_prices', 0);
$feed_show_images = VmConfig::get('feed_cat_show_images', 0);
$feed_show_description = VmConfig::get('feed_cat_show_description', 0);
$feed_description_type = VmConfig::get('feed_cat_description_type', 'product_s_desc');
$feed_max_text_length = VmConfig::get('feed_cat_max_text_length', 0);
// Load the products in the given category
$products = $productModel->getProductsInCategory($categoryId);
if ($feed_show_images == 1) {
$productModel->addImages($products, 1);
}
if ($products && $feed_show_prices == 1) {
$currency = CurrencyDisplay::getInstance();
}
foreach ($products as $product) {
$title = $this->escape($product->product_name);
$title = html_entity_decode($title, ENT_COMPAT, 'UTF-8');
$description = "";
if ($feed_show_images == 1) {
$effect = " ";
$return = true;
$withDescr = false;
$absUrl = true;
$description = $product->images[0]->displayMediaThumb('style="margin-right: 10px; margin-bottom: 10px; float: left;"', false, $effect, $return, $withDescr, $absUrl);
}
if ($feed_show_description == 1) {
if ($feed_description_type == 'product_s_desc') {
$description .= $product->product_s_desc;
} else {
if ($feed_max_text_length > 0) {
$description .= shopFunctionsF::limitStringByWord($product->product_desc, $feed_max_text_length);
} else {
$description .= $product->product_desc;
}
}
}
if ($feed_show_prices == 1 and $show_prices == 1) {
$description .= $currency->createPriceDiv('variantModification', 'COM_VIRTUEMART_PRODUCT_VARIANT_MOD', $product->prices);
if (round($product->prices['basePriceWithTax'], $currency->_priceConfig['salesPrice'][1]) != $product->prices['salesPrice']) {
$description .= '<span class="price-crossed" >' . $currency->createPriceDiv('basePriceWithTax', 'COM_VIRTUEMART_PRODUCT_BASEPRICE_WITHTAX', $product->prices) . "</span>";
}
if (round($product->prices['salesPriceWithDiscount'], $currency->_priceConfig['salesPrice'][1]) != $product->prices['salesPrice']) {
$description .= $currency->createPriceDiv('salesPriceWithDiscount', 'COM_VIRTUEMART_PRODUCT_SALESPRICE_WITH_DISCOUNT', $product->prices);
}
$description .= $currency->createPriceDiv('salesPrice', 'COM_VIRTUEMART_PRODUCT_SALESPRICE', $product->prices);
$description .= $currency->createPriceDiv('priceWithoutTax', 'COM_VIRTUEMART_PRODUCT_SALESPRICE_WITHOUT_TAX', $product->prices);
$description .= $currency->createPriceDiv('discountAmount', 'COM_VIRTUEMART_PRODUCT_DISCOUNT_AMOUNT', $product->prices);
$description .= $currency->createPriceDiv('taxAmount', 'COM_VIRTUEMART_PRODUCT_TAX_AMOUNT', $product->prices);
$unitPriceDescription = JText::sprintf('COM_VIRTUEMART_PRODUCT_UNITPRICE', $product->product_unit);
$description .= $currency->createPriceDiv('unitPrice', $unitPriceDescription, $product->prices);
}
if ($feed_description_type == 'product_s_desc' or $feed_max_text_length > 0) {
$description .= '<p class="feed-readmore"><a target="_blank" href ="' . rtrim(JURI::base(), "/") . str_replace(' ', '%20', $product->link) . '">' . JText::_('COM_VIRTUEMART_FEED_READMORE') . '</a></p>';
}
$item = new JFeedItem();
$item->title = $title;
$item->link = $product->link;
$item->date = $product->created_on;
$item->description = '<div class="feed-description">' . $description . '</div>';
$item->category = $categoryId;
$doc->addItem($item);
}
}
示例15: display
//.........这里部分代码省略.........
VmConfig::loadJLang('com_virtuemart_shoppers', true);
$this->renderCompleteAddressList();
if (!class_exists('VirtueMartModelUserfields')) {
require VMPATH_ADMIN . DS . 'models' . DS . 'userfields.php';
}
$userFieldsModel = VmModel::getModel('userfields');
$userFieldsCart = $userFieldsModel->getUserFields('cart', array('captcha' => true, 'delimiters' => true), array('delimiter_userinfo', 'user_is_vendor', 'username', 'password', 'password2', 'agreed', 'address_type'));
$this->userFieldsCart = $userFieldsModel->getUserFieldsFilled($userFieldsCart, $this->cart->cartfields);
if (!class_exists('CurrencyDisplay')) {
require VMPATH_ADMIN . DS . 'helpers' . DS . 'currencydisplay.php';
}
$currencyDisplay = CurrencyDisplay::getInstance($this->cart->pricesCurrency);
$this->assignRef('currencyDisplay', $currencyDisplay);
$customfieldsModel = VmModel::getModel('Customfields');
$this->assignRef('customfieldsModel', $customfieldsModel);
$this->lSelectCoupon();
$totalInPaymentCurrency = $this->getTotalInPaymentCurrency();
$checkoutAdvertise = $this->getCheckoutAdvertise();
if ($this->cart->getDataValidated()) {
if ($this->cart->_inConfirm) {
$pathway->addItem(vmText::_('COM_VIRTUEMART_CANCEL_CONFIRM_MNU'));
$document->setTitle(vmText::_('COM_VIRTUEMART_CANCEL_CONFIRM_MNU'));
$text = vmText::_('COM_VIRTUEMART_CANCEL_CONFIRM');
$this->checkout_task = 'cancel';
} else {
$pathway->addItem(vmText::_('COM_VIRTUEMART_ORDER_CONFIRM_MNU'));
$document->setTitle(vmText::_('COM_VIRTUEMART_ORDER_CONFIRM_MNU'));
$text = vmText::_('COM_VIRTUEMART_ORDER_CONFIRM_MNU');
$this->checkout_task = 'confirm';
}
} else {
$pathway->addItem(vmText::_('COM_VIRTUEMART_CART_OVERVIEW'));
$document->setTitle(vmText::_('COM_VIRTUEMART_CART_OVERVIEW'));
$text = vmText::_('COM_VIRTUEMART_CHECKOUT_TITLE');
$this->checkout_task = 'checkout';
}
$this->checkout_link_html = '<button type="submit" id="checkoutFormSubmit" name="' . $this->checkout_task . '" value="1" class="vm-button-correct" ><span>' . $text . '</span> </button>';
if (VmConfig::get('oncheckout_opc', 1)) {
if (!class_exists('vmPSPlugin')) {
require JPATH_VM_PLUGINS . DS . 'vmpsplugin.php';
}
JPluginHelper::importPlugin('vmshipment');
JPluginHelper::importPlugin('vmpayment');
$this->lSelectShipment();
$this->lSelectPayment();
} else {
$this->checkPaymentMethodsConfigured();
$this->checkShipmentMethodsConfigured();
}
if ($this->cart->virtuemart_shipmentmethod_id) {
$shippingText = vmText::_('COM_VIRTUEMART_CART_CHANGE_SHIPPING');
} else {
$shippingText = vmText::_('COM_VIRTUEMART_CART_EDIT_SHIPPING');
}
$this->assignRef('select_shipment_text', $shippingText);
if ($this->cart->virtuemart_paymentmethod_id) {
$paymentText = vmText::_('COM_VIRTUEMART_CART_CHANGE_PAYMENT');
} else {
$paymentText = vmText::_('COM_VIRTUEMART_CART_EDIT_PAYMENT');
}
$this->assignRef('select_payment_text', $paymentText);
$this->cart->prepareAddressFieldsInCart();
$layoutName = $this->cart->layout;
//set order language
$lang = JFactory::getLanguage();
$order_language = $lang->getTag();
$this->assignRef('order_language', $order_language);
}
}
}
$this->useSSL = VmConfig::get('useSSL', 0);
$this->useXHTML = false;
$this->assignRef('totalInPaymentCurrency', $totalInPaymentCurrency);
$this->assignRef('checkoutAdvertise', $checkoutAdvertise);
shopFunctionsF::setVmTemplate($this, 0, 0, $layoutName);
//We never want that the cart is indexed
$document->setMetaData('robots', 'NOINDEX, NOFOLLOW, NOARCHIVE, NOSNIPPET');
if ($this->cart->_inConfirm) {
vmInfo('COM_VIRTUEMART_IN_CONFIRM');
}
if ($this->cart->layoutPath) {
$this->addTemplatePath($this->cart->layoutPath);
}
$current = JFactory::getUser();
$this->allowChangeShopper = false;
if (VmConfig::get('oncheckout_change_shopper')) {
if ($current->authorise('core.admin', 'com_virtuemart') or $current->authorise('vm.user', 'com_virtuemart')) {
$this->allowChangeShopper = true;
} else {
$adminID = JFactory::getSession()->get('vmAdminID', false);
if ($adminID) {
$adminIdUser = JFactory::getUser($adminID);
if ($adminIdUser->authorise('core.admin', 'com_virtuemart') or $adminIdUser->authorise('vm.user', 'com_virtuemart')) {
$this->allowChangeShopper = true;
}
}
}
}
parent::display($tpl);
}