if (!class_exists('VirtueMartCart')) { require VMPATH_SITE . DS . 'helpers' . DS . 'cart.php'; } $this->cart = VirtueMartCart::getCart(); $url = 0; if ($this->cart->_fromCart or $this->cart->getInCheckOut()) { $rview = 'cart'; } else { $rview = 'user'; } $task = ''; if ($this->cart->getInCheckOut()) { //$task = '&task=checkout'; } $url = JRoute::_('index.php?option=com_virtuemart&view=' . $rview . $task, $this->useXHTML, $this->useSSL); echo shopFunctionsF::getLoginForm(TRUE, FALSE, $url); $this->vmValidator(); ?> <form method="post" id="userForm" name="userForm" class="form-validate" action="<?php echo JRoute::_('index.php?option=com_virtuemart&view=user', $this->useXHTML, $this->useSSL); ?> " > <fieldset> <h2><?php if ($this->address_type == 'BT') { echo vmText::_('COM_VIRTUEMART_USER_FORM_EDIT_BILLTO_LBL'); } else { echo vmText::_('COM_VIRTUEMART_USER_FORM_ADD_SHIPTO_LBL'); } ?>
/** * Collect all data to show on the template * * @author Max Milbers */ function display($tpl = NULL) { $app = JFactory::getApplication(); if (!VmConfig::get('ask_question', false) and !VmConfig::get('askprice', false)) { $app->redirect(JRoute::_('index.php?option=com_virtuemart', 'Disabled function')); } $this->login = ''; if (!VmConfig::get('recommend_unauth', false)) { $user = JFactory::getUser(); if ($user->guest) { $this->login = shopFunctionsF::getLoginForm(false); //$app->redirect(JRoute::_('index.php?option=com_virtuemart','JGLOBAL_YOU_MUST_LOGIN_FIRST')); } } $show_prices = VmConfig::get('show_prices', 1); if ($show_prices == '1') { if (!class_exists('calculationHelper')) { require JPATH_VM_ADMINISTRATOR . DS . 'helpers' . DS . 'calculationh.php'; } } $this->assignRef('show_prices', $show_prices); $document = JFactory::getDocument(); $mainframe = JFactory::getApplication(); $pathway = $mainframe->getPathway(); $task = vRequest::getCmd('task'); if (!class_exists('VmImage')) { require JPATH_VM_ADMINISTRATOR . DS . 'helpers' . DS . 'image.php'; } // Load the product $product_model = VmModel::getModel('product'); $category_model = VmModel::getModel('Category'); $virtuemart_product_idArray = vRequest::getInt('virtuemart_product_id', 0); if (is_array($virtuemart_product_idArray)) { $virtuemart_product_id = $virtuemart_product_idArray[0]; } else { $virtuemart_product_id = $virtuemart_product_idArray; } if (empty($virtuemart_product_id)) { self::showLastCategory($tpl); return; } if (!class_exists('VirtueMartModelVendor')) { require JPATH_VM_ADMINISTRATOR . DS . 'models' . DS . 'vendor.php'; } $product = $product_model->getProduct($virtuemart_product_id); // Set Canonic link $format = vRequest::getCmd('format', 'html'); if ($format == 'html') { $document->addHeadLink($product->canonical, 'canonical', 'rel', ''); } // Set the titles $document->setTitle(vmText::sprintf('COM_VIRTUEMART_PRODUCT_DETAILS_TITLE', $product->product_name . ' - ' . vmText::_('COM_VIRTUEMART_PRODUCT_ASK_QUESTION'))); $this->assignRef('product', $product); if (empty($product)) { self::showLastCategory($tpl); return; } $product_model->addImages($product, 1); /* Get the category ID */ $virtuemart_category_id = vRequest::getInt('virtuemart_category_id'); if ($virtuemart_category_id == 0 && !empty($product)) { if (array_key_exists('0', $product->categories)) { $virtuemart_category_id = $product->categories[0]; } } shopFunctionsF::setLastVisitedCategoryId($virtuemart_category_id); if ($category_model) { $category = $category_model->getCategory($virtuemart_category_id); $this->assignRef('category', $category); $pathway->addItem($category->category_name, JRoute::_('index.php?option=com_virtuemart&view=category&virtuemart_category_id=' . $virtuemart_category_id, FALSE)); } //$pathway->addItem(vmText::_('COM_VIRTUEMART_PRODUCT_DETAILS'), $uri->toString(array('path', 'query', 'fragment'))); $pathway->addItem($product->product_name, JRoute::_('index.php?option=com_virtuemart&view=productdetails&virtuemart_category_id=' . $virtuemart_category_id . '&virtuemart_product_id=' . $product->virtuemart_product_id, FALSE)); // for askquestion $pathway->addItem(vmText::_('COM_VIRTUEMART_PRODUCT_ASK_QUESTION')); $this->user = JFactory::getUser(); if ($product->metadesc) { $document->setDescription($product->metadesc); } if ($product->metakey) { $document->setMetaData('keywords', $product->metakey); } //We never want that ask a question is indexed $document->setMetaData('robots', 'NOINDEX, NOFOLLOW, NOARCHIVE, NOSNIPPET'); if ($mainframe->getCfg('MetaTitle') == '1') { $document->setMetaData('title', $product->product_s_desc); //Maybe better product_name } if ($mainframe->getCfg('MetaAuthor') == '1') { $document->setMetaData('author', $product->metaauthor); } parent::display($tpl); }
* other free or open source software licenses. * @version $Id: list.php 8832 2015-04-15 16:05:49Z Milbo $ */ // Check to ensure this file is included in Joomla! defined('_JEXEC') or die('Restricted access'); ?> <div class="vm-wrap"> <div class="vm-orderlist-view vm-orders-list"> <h1><?php echo vmText::_('COM_VIRTUEMART_ORDERS_VIEW_DEFAULT_TITLE'); ?> </h1> <?php if (count($this->orderlist) == 0) { //echo vmText::_('COM_VIRTUEMART_ACC_NO_ORDER'); echo shopFunctionsF::getLoginForm(false, true); } else { ?> <div id="editcell"> <table class="adminlist" width="80%"> <thead> <tr> <th> <?php echo vmText::_('COM_VIRTUEMART_ORDER_LIST_ORDER_NUMBER'); ?> </th> <th> <?php echo vmText::_('COM_VIRTUEMART_ORDER_LIST_CDATE'); ?>
<?php defined('_JEXEC') or die(''); /** * * Template for the shopping cart * * @package VirtueMart * @subpackage Cart * @author Max Milbers * * @link http://www.virtuemart.net * @copyright Copyright (c) 2004 - 2010 VirtueMart Team. All rights reserved. * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php * VirtueMart is free software. This version may have been modified pursuant * to the GNU General Public License, and as distributed it includes or * is derivative of works licensed under the GNU General Public License or * other free or open source software licenses. */ echo '<div class="vm-orderdone-view">'; if ($this->display_title) { echo "<h3>" . vmText::_('COM_VIRTUEMART_CART_ORDERDONE_THANK_YOU') . "</h3>"; } echo $this->html; echo '</div>'; $cuser = JFactory::getUser(); if (!$cuser->guest) { echo shopFunctionsF::getLoginForm(); }
echo '<div class="checkoutStep" id="checkoutStep4">' . vmText::_('COM_VIRTUEMART_USER_FORM_CART_STEP4') . '</div>'; } ?> <div class="floatright"> <?php // Continue Shopping Button if (!empty($this->continue_link_html)) { echo $this->continue_link_html; } ?> </div> <div class="clear"></div> </div> <?php echo shopFunctionsF::getLoginForm($this->cart, FALSE); // This displays the form to change the current shopper $adminID = JFactory::getSession()->get('vmAdminID'); if ((JFactory::getUser()->authorise('core.admin', 'com_virtuemart') || JFactory::getUser($adminID)->authorise('core.admin', 'com_virtuemart')) && VmConfig::get('oncheckout_change_shopper', 0)) { echo $this->loadTemplate('shopperform'); } $taskRoute = ''; ?> <form method="post" id="checkoutForm" name="checkoutForm" action="<?php echo JRoute::_('index.php?option=com_virtuemart&view=cart' . $taskRoute, $this->useXHTML, $this->useSSL); ?> "> <?php if (VmConfig::get('multixcart') == 'byselection') { echo shopFunctions::renderVendorFullVendorList($this->cart->vendorId); }
vmdebug('checkout_task', $this->checkout_task); echo '<div class="checkoutStep" id="checkoutStep4">' . JText::_('COM_VIRTUEMART_USER_FORM_CART_STEP4') . '</div>'; } ?> <div class="width50 floatleft right"> <?php // Continue Shopping Button if ($this->continue_link_html != '') { echo $this->continue_link_html; } ?> </div> <div class="clear"></div> </div> <?php echo shopFunctionsF::getLoginForm($this->cart, false); //echo $this->loadTemplate('login'); // // //// Continue and Checkout Button /* The problem here is that we use a form for the quantity boxes and so we cant let the form start here, * because we would have then a form in a form. * * But we cant make an extra form here, because then pressing the above checkout button would not send the * user notices for exampel. The solution is to write a javascript which checks and unchecks both tos checkboxes simultan * The upper checkout button should than just fire the form below. * <div class="checkout-button-top"> <?php // Terms Of Service Checkbox if(!class_exists('VmHtml'))require(JPATH_VM_ADMINISTRATOR.DS.'helpers'.DS.'html.php'); echo VmHtml::checkbox('tosAccepted',$this->cart->tosAccepted,1,0,'class="terms-of-service"');
/** * Collect all data to show on the template * * @author Max Milbers */ function display($tpl = null) { $app = JFactory::getApplication(); if (!VmConfig::get('show_emailfriend', false)) { $app->redirect(JRoute::_('index.php?option=com_virtuemart')); } $this->login = ''; if (!VmConfig::get('recommend_unauth', false)) { $user = JFactory::getUser(); if ($user->guest) { $this->login = shopFunctionsF::getLoginForm(false); //$app->redirect(JRoute::_('index.php?option=com_virtuemart','JGLOBAL_YOU_MUST_LOGIN_FIRST')); } } // Load the product $productModel = VmModel::getModel('product'); $virtuemart_product_id = vRequest::getInt('virtuemart_product_id', 0); $this->product = $productModel->getProduct($virtuemart_product_id); $layout = $this->getLayout(); if ($layout != 'form' and $layout != 'mail_confirmed') { $this->renderMailLayout('', ''); return true; } $show_prices = VmConfig::get('show_prices', 1); if ($show_prices == '1') { if (!class_exists('calculationHelper')) { require VMPATH_ADMIN . DS . 'helpers' . DS . 'calculationh.php'; } } $this->assignRef('show_prices', $show_prices); $document = JFactory::getDocument(); $document->setMetaData('robots', 'NOINDEX, NOFOLLOW, NOARCHIVE, NOSNIPPET'); /* add javascript for price and cart */ //vmJsApi::jPrice(); $mainframe = JFactory::getApplication(); $pathway = $mainframe->getPathway(); $task = vRequest::getCmd('task'); if (!class_exists('VmImage')) { require VMPATH_ADMIN . DS . 'helpers' . DS . 'image.php'; } if (empty($virtuemart_product_id)) { self::showLastCategory($tpl); return; } //$product = $productModel->getProduct($virtuemart_product_id); /* Set Canonic link */ $format = vRequest::getCmd('format', 'html'); if ($format == 'html') { $document->addHeadLink($this->product->link, 'canonical', 'rel', ''); } /* Set the titles */ $document->setTitle(vmText::sprintf('COM_VIRTUEMART_PRODUCT_DETAILS_TITLE', $this->product->product_name . ' - ' . vmText::_('COM_VIRTUEMART_PRODUCT_RECOMMEND'))); if (empty($this->product)) { self::showLastCategory($tpl); return; } $productModel->addImages($this->product, 1); /* Load the category */ $category_model = VmModel::getModel('category'); /* Get the category ID */ $virtuemart_category_id = vRequest::getInt('virtuemart_category_id'); if ($virtuemart_category_id == 0 && !empty($this->product)) { if (array_key_exists('0', $this->product->categories)) { $virtuemart_category_id = $this->product->categories[0]; } } if (!class_exists('shopFunctionsF')) { require VMPATH_SITE . DS . 'helpers' . DS . 'shopfunctionsf.php'; } shopFunctionsF::setLastVisitedCategoryId($virtuemart_category_id); if ($category_model) { $category = $category_model->getCategory($virtuemart_category_id); $this->assignRef('category', $category); $pathway->addItem($category->category_name, JRoute::_('index.php?option=com_virtuemart&view=category&virtuemart_category_id=' . $virtuemart_category_id, FALSE)); } //$pathway->addItem(vmText::_('COM_VIRTUEMART_PRODUCT_DETAILS'), $uri->toString(array('path', 'query', 'fragment'))); $pathway->addItem($this->product->product_name, JRoute::_('index.php?option=com_virtuemart&view=productdetails&virtuemart_category_id=' . $virtuemart_category_id . '&virtuemart_product_id=' . $this->product->virtuemart_product_id, FALSE)); // for askquestion $pathway->addItem(vmText::_('COM_VIRTUEMART_PRODUCT_ASK_QUESTION')); /* Check for editing access */ /** @todo build edit page */ /* Load the user details */ $this->assignRef('user', JFactory::getUser()); if ($this->product->metadesc) { $document->setDescription($this->product->metadesc); } if ($this->product->metakey) { $document->setMetaData('keywords', $this->product->metakey); } if ($mainframe->getCfg('MetaTitle') == '1') { $document->setMetaData('title', $this->product->product_s_desc); //Maybe better product_name } if ($mainframe->getCfg('MetaAuthor') == '1') { $document->setMetaData('author', $this->product->metaauthor); } parent::display($tpl); }
JHTML::_('behavior.formvalidation'); JHTML::stylesheet('vmpanels.css', JURI::root() . 'components/com_virtuemart/assets/css/'); if ($this->fTask === 'savecartuser') { $rtask = 'registercartuser'; $url = 0; } else { $rtask = 'registercheckoutuser'; $url = JRoute::_('index.php?option=com_virtuemart&view=cart&task=checkout', $this->useXHTML, $this->useSSL); } ?> <h1><?php echo $this->page_title; ?> </h1> <?php echo shopFunctionsF::getLoginForm(true, false, $url); ?> <script language="javascript"> function myValidator(f, t) { f.task.value=t; //this is a method to set the task of the form on the fTask. if (document.formvalidator.isValid(f)) { f.submit(); return true; } else { var msg = '<?php echo addslashes(JText::_('COM_VIRTUEMART_USER_FORM_MISSING_REQUIRED_JS')); ?> '; alert (msg+' '); }
<style type="text/css"> .invalid { border-color: #f00; background-color: #ffd; color: #000; } label.invalid { background-color: #fff; color: #f00; } </style> <?php $this->vmValidator(); ?> <h1><?php echo $this->page_title ?></h1> <?php echo shopFunctionsF::getLoginForm(false); ?> <?php if($this->userDetails->virtuemart_user_id==0) { echo '<h2>'.vmText::_('COM_VIRTUEMART_YOUR_ACCOUNT_REG').'</h2>'; }?> <form method="post" id="adminForm" name="userForm" action="<?php echo JRoute::_('index.php?option=com_virtuemart&view=user',$this->useXHTML,$this->useSSL) ?>" class="form-validate"> <?php if($this->userDetails->user_is_vendor){ ?> <div class="buttonBar-right"> <button class="button" type="submit" onclick="javascript:return myValidator(userForm, true);" ><?php echo $this->button_lbl ?></button> <button class="button" type="reset" onclick="window.location.href='<?php echo JRoute::_('index.php?option=com_virtuemart&view=user&task=cancel', FALSE); ?>'" ><?php echo vmText::_('COM_VIRTUEMART_CANCEL'); ?></button></div> <?php } ?> <?php // Loading Templates in Tabs if($this->userDetails->virtuemart_user_id!=0) { $tabarray = array();
JHTML::_('behavior.formvalidation'); JHTML::stylesheet('vmpanels.css', JURI::root() . 'components/com_virtuemart/assets/css/'); if ($this->fTask === 'savecartuser') { $rtask = 'registercartuser'; $url = 0; } else { $rtask = 'registercheckoutuser'; $url = JRoute::_('index.php?option=com_virtuemart&view=cart&task=checkout', $this->useXHTML, $this->useSSL); } ?> <h1><?php echo $this->page_title; ?> </h1> <?php echo str_replace(array('<h3>', '</h3>'), array('<h4>', '</h4>'), shopFunctionsF::getLoginForm(TRUE, FALSE, $url)); ?> <script language="javascript"> function myValidator(f, t) { f.task.value = t; //this is a method to set the task of the form on the fTask. if (document.formvalidator.isValid(f)) { f.submit(); return true; } else { var msg = '<?php echo addslashes(JText::_('COM_VIRTUEMART_USER_FORM_MISSING_REQUIRED_JS')); ?> '; alert(msg + ' '); } return false;