function onBeforeRender() { if ($this->app->isAdmin()) { return; } $app = JFactory::getApplication(); $option = $app->input->get('option'); $view = $app->input->get('view'); $tmpl = $app->input->get('tmpl'); $document = JFactory::getDocument(); if ($app->isSite() && $tmpl != 'component') { if (!defined('SMART_JQUERY') && (int) $this->params->get('include_jquery', '1')) { $document->addScript(JURI::root(true) . '/plugins/system/plg_sj_vm_quickview/assets/js/jquery-1.8.2.min.js'); $document->addScript(JURI::root(true) . '/plugins/system/plg_sj_vm_quickview/assets/js/jquery-noconflict.js'); define('SMART_JQUERY', 1); } if (!class_exists('VmConfig')) { require JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_virtuemart' . DS . 'helpers' . DS . 'config.php'; } VmConfig::loadConfig(); if (class_exists('vmJsApi')) { vmJsApi::jPrice(); } $document->addScript(JURI::root(true) . '/plugins/system/plg_sj_vm_quickview/assets/js/jquery.fancybox.js'); $document->addStyleSheet(JURI::root(true) . '/plugins/system/plg_sj_vm_quickview/assets/css/jquery.fancybox.css'); $document->addStyleSheet(JURI::root(true) . '/plugins/system/plg_sj_vm_quickview/assets/css/quickview.css'); } return true; }
/** * This shows the plugin for choosing in the payment list of the checkout process. * * @author Valerie Cartan Isaksen */ public function plgVmDisplayListFEPayment(VirtueMartCart $cart, $selected = 0, &$htmlIn) { if ($this->getPluginMethods($cart->vendorId) === 0) { if (empty($this->_name)) { $app = JFactory::getApplication(); $app->enqueueMessage(vmText::_('COM_VIRTUEMART_CART_NO_' . strtoupper($this->_psType))); return false; } else { return false; } } $html = array(); $method_name = $this->_psType . '_name'; VmConfig::loadJLang('com_virtuemart', true); vmJsApi::jCreditCard(); $htmla = ''; $html = array(); foreach ($this->methods as $_currentMethod) { $this->_currentMethod = $_currentMethod; if ($this->checkConditions($cart, $this->_currentMethod, $cart->cartPrices)) { $cartPrices = $cart->cartPrices; $methodSalesPrice = $this->setCartPrices($cart, $cartPrices, $this->_currentMethod); $this->_currentMethod->{$method_name} = $this->renderPluginName($this->_currentMethod); $sandbox = $this->_currentMethod->sandbox; $html = $this->getPluginHtml($this->_currentMethod, $selected, $methodSalesPrice); if ($selected == $this->_currentMethod->virtuemart_paymentmethod_id && $this->hasBillingAddress($cart)) { $html .= $this->displayForm($cart, $sandbox); } $htmla[] = $html; } } $htmlIn[] = $htmla; return true; }
function display($tpl = null) { $document = JFactory::getDocument(); $document->setMimeEncoding('application/json'); if ($virtuemart_media_id = vRequest::getInt('virtuemart_media_id')) { //JResponse::setHeader( 'Content-Disposition', 'attachment; filename="media'.$virtuemart_media_id.'.json"' ); $model = VmModel::getModel('Media'); $image = $model->createMediaByIds($virtuemart_media_id); if (isset($image[0]) and is_object($image[0])) { $image[0]->file_url_thumb_dyn = $image[0]->getFileUrlThumb(); // echo '<pre>'.print_r($image,1).'</pre>'; $this->json = $image[0]; //echo json_encode($this->json); if (isset($this->json->file_url)) { $this->json->file_root = JURI::root(true) . '/'; $this->json->msg = 'OK'; echo vmJsApi::safe_json_encode($this->json); } else { $this->json->msg = '<b>' . vmText::_('COM_VIRTUEMART_NO_IMAGE_SET') . '</b>'; echo @json_encode($this->json); } } } else { if (!class_exists('VmMediaHandler')) { require VMPATH_ADMIN . DS . 'helpers' . DS . 'mediahandler.php'; } $start = vRequest::getInt('start', 0); $type = vRequest::getCmd('mediatype', 0); $list = VmMediaHandler::displayImages($type, $start); echo vmJsApi::safe_json_encode($list); } jExit(); }
public function withKeepAlive() { if (!class_exists('VirtueMartCart')) { require VMPATH_SITE . DS . 'helpers' . DS . 'cart.php'; } $cart = VirtueMartCart::getCart(); if (!empty($cart->cartProductsData)) { vmJsApi::keepAlive(1, 4); } }
function display($tpl = null) { $db = JFactory::getDBO(); if ($virtuemart_media_id = vRequest::getInt('virtuemart_media_id')) { //$db = JFactory::getDBO(); $query = 'SELECT `file_url`,`file_title` FROM `#__virtuemart_medias` where `virtuemart_media_id`=' . $virtuemart_media_id; $db->setQuery($query); $json = $db->loadObject(); if (isset($json->file_url)) { $json->file_url = JURI::root() . $json->file_url; $json->msg = 'OK'; echo vmJsApi::safe_json_encode($json); } else { $json->msg = '<b>' . vmText::_('COM_VIRTUEMART_NO_IMAGE_SET') . '</b>'; echo json_encode($json); } } elseif ($custom_jplugin_id = vRequest::getInt('custom_jplugin_id')) { $table = '#__extensions'; $ext_id = 'extension_id'; $q = 'SELECT `params`,`element` FROM `' . $table . '` WHERE `' . $ext_id . '` = "' . $custom_jplugin_id . '"'; $db->setQuery($q); $this->jCustom = $db->loadObject(); $customModel = VmModel::getModel('custom'); $this->custom = $customModel->getCustom(); // Get the payment XML. $formFile = vRequest::filterPath(VMPATH_ROOT . DS . 'plugins' . DS . 'vmcustom' . DS . $this->jCustom->element . DS . $this->jCustom->element . '.xml'); if (file_exists($formFile)) { VmConfig::loadJLang('plg_vmpsplugin', false); if (!class_exists('vmPlugin')) { require VMPATH_PLUGINLIBS . DS . 'vmplugin.php'; } $filename = 'plg_vmcustom_' . $this->jCustom->element; vmPlugin::loadJLang($filename, 'vmcustom', $this->jCustom->element); $this->custom = VmModel::getModel('custom')->getCustom(); $varsToPush = vmPlugin::getVarsToPushByXML($formFile, 'customForm'); $this->custom->form = JForm::getInstance($this->jCustom->element, $formFile, array(), false, '//vmconfig | //config[not(//vmconfig)]'); $this->custom->params = new stdClass(); foreach ($varsToPush as $k => $field) { if (strpos($k, '_') != 0) { $this->custom->params->{$k} = $field[0]; } } $this->custom->form->bind($this->custom->getProperties()); $form = $this->custom->form; include VMPATH_ADMIN . DS . 'fields' . DS . 'formrenderer.php'; echo '<input type="hidden" value="' . $this->jCustom->element . '" name="custom_value">'; } else { $this->custom->form = null; //VmConfig::$echoDebug = 1; vmdebug('File does not exist ' . $formFile); } } jExit(); }
protected function getInput() { vmJsApi::addJScript('/plugins/vmpayment/realex_hpp_api/realex_hpp_api/assets/js/admin.js'); vmJsApi::css('admin', 'plugins/vmpayment/realex_hpp_api/realex_hpp_api/assets/css/'); $url = "http://www.realexpayments.com/partner-referral?id=tsmart"; $logo = '<img src="http://www.realexpayments.com/images/logo_realex_large.png" width="150"/>'; $html = '<p><a target="_blank" href="' . $url . '" >' . $logo . '</a></p>'; $html .= '<p><a target="_blank" href="' . $url . '" class="signin-button-link">' . tsmText::_('VMPAYMENT_REALEX_HPP_API_REGISTER') . '</a>'; $html .= ' <a target="_blank" href="http://docs.tsmart.net/manual/shop-menu/payment-methods/realex-hpp-and-api.html" class="signin-button-link">' . tsmText::_('VMPAYMENT_REALEX_HPP_API_DOCUMENTATION') . '</a></p>'; return $html; }
public function display($tpl = null) { $result = $this->loadTemplate($tpl); if ($result instanceof Exception) { return $result; } echo $result; if ($this->writeJs and get_class($this) != 'VirtueMartViewProductdetails') { echo vmJsApi::writeJS(); } }
function getInput() { $js = ' //<![CDATA[ jQuery(document).ready(function( $ ) { jQuery("#paybox_getpaybox_link").click( function() { if ( $("#paybox_getpaybox_show_hide").is(":visible") ) { $("#paybox_getpaybox_show_hide").hide("slow"); $("#paybox_getpaybox_link").html("' . addslashes(vmText::_('VMPAYMENT_PAYBOX_ALREADY_ACCOUNT')) . '"); } else { $("#paybox_getpaybox_show_hide").show("slow"); $("#paybox_getpaybox_link").html("' . addslashes(vmText::_('VMPAYMENT_PAYBOX_GET_PAYBOX_HIDE')) . '"); } }); }); //]]> '; vmJsApi::addJScript("vm.getPaybox", $js); vmJsApi::addJScript('/plugins/vmpayment/paybox/paybox/assets/js/admin.js'); vmJsApi::css('admin', 'plugins/vmpayment/paybox/paybox/assets/css/'); $cid = vRequest::getvar('cid', NULL, 'array'); if (is_Array($cid)) { $virtuemart_paymentmethod_id = $cid[0]; } else { $virtuemart_paymentmethod_id = $cid; } $query = "SELECT * FROM `#__virtuemart_paymentmethods` WHERE virtuemart_paymentmethod_id = '" . $virtuemart_paymentmethod_id . "'"; $db = JFactory::getDBO(); $db->setQuery($query); $params = $db->loadObject(); $html = '<img src="http://virtuemart.boutique-paybox.com/PayboxLogo.jpg" width="200px"/><br />'; if ($params->created_on == $params->modified_on) { $id = "paybox_getpaybox_link"; $html .= '<a href="#" id="' . $id . '">' . vmText::_('VMPAYMENT_PAYBOX_GET_PAYBOX_HIDE') . '</a>'; $display = ''; $html .= '<div id="paybox_getpaybox_show_hide" align=""' . $display . ' >'; } else { $id = "paybox_getpaybox_link"; $html .= '<a href="#" id="' . $id . '">' . vmText::_('VMPAYMENT_PAYBOX_ALREADY_ACCOUNT') . '</a>'; $display = ' style="display: none;"'; $html .= '<div id="paybox_getpaybox_show_hide" align=""' . $display . ' >'; } $id = ""; $lang = $this->getLang(); if ($lang == 'fr') { $url = "http://virtuemart.boutique-paybox.com/PayboxPres.html"; } else { $url = "http://virtuemart.boutique-paybox.com/PayboxPres.html"; } $html .= '<iframe src="' . $url . '" scrolling="yes" style="x-overflow: none;" frameborder="0" height="1400px" width="800px"></iframe>'; $html .= "</div>"; return $html; }
protected function getInput() { JHtml::_('behavior.colorpicker'); vmJsApi::addJScript('/plugins/vmpayment/paypal/paypal/assets/js/admin.js'); vmJsApi::css('paypal', 'plugins/vmpayment/paypal/paypal/assets/css/'); $url = "https://www.paypal.com/us/webapps/mpp/referral/paypal-payments-standard?partner_id=83EP5DJG9FU6L"; $logo = '<img src="https://www.paypalobjects.com/en_US/i/logo/PayPal_mark_60x38.gif" />'; $html = '<p><a target="_blank" href="' . $url . '" >' . $logo . '</a></p>'; $html .= '<p><a target="_blank" href="' . $url . '" class="signin-button-link">' . vmText::_('VMPAYMENT_PAYPAL_REGISTER') . '</a>'; $html .= ' <a target="_blank" href="http://docs.virtuemart.net/manual/shop-menu/payment-methods/paypal.html" class="signin-button-link">' . vmText::_('VMPAYMENT_PAYPAL_DOCUMENTATION') . '</a></p>'; return $html; }
function getInput() { vmJsApi::addJScript('/plugins/vmpayment/klikandpay/klikandpay/assets/js/admin.js'); $lang = $this->getLang(); if ($lang == 'fr') { $url = "https://www.klikandpay.com/cgi-bin/connexion.pl?FROM=869B834067"; } else { $url = "https://www.klikandpay.com/cgi-bin/connexion.pl?FROM=869B834067&L=en"; } $logo = '<img src="https://www.klikandpay.com/images/logo_en.png" style="width: 150px;">'; $html = '<p><a target="_blank" href="' . $url . '" >' . $logo . '</a></p>'; $html .= '<p><a class="signin-button-link" href="' . $url . '" target="_blank">' . vmText::_('VMPAYMENT_KLIKANDPAY_GET') . '</a>'; $html .= ' <a target="_blank" href="https://www.youtube.com/watch?v=DVcUU3FiuMM" class="signin-button-link">' . vmText::_('VMPAYMENT_KLIKANDPAY_DOCUMENTATION') . '</a></p>'; return $html; }
function display($tpl = null) { $states = array(); $db = JFactory::getDBO(); //retrieving countries id $country_ids = vRequest::getString('tsmart_country_id'); $country_ids = explode(',', $country_ids); foreach ($country_ids as $country_id) { $q = 'SELECT `tsmart_state_id`, `state_name` FROM `#__tsmart_states` WHERE `tsmart_country_id`= "' . (int) $country_id . '" ORDER BY `#__tsmart_states`.`state_name`'; $db->setQuery($q); $states[$country_id] = $db->loadAssocList(); } echo vmJsApi::safe_json_encode($states); }
function getInput() { vmJsApi::addJScript('/plugins/vmpayment/klarnacheckout/klarnacheckout/assets/js/admin.js'); vmJsApi::css('klarnacheckout', 'plugins/vmpayment/klarnacheckout/klarnacheckout/assets/css/'); $jlang = JFactory::getLanguage(); $lang = $jlang->getTag(); $langArray = explode("-", $lang); $lang = strtolower($langArray[1]); $countriesData = KlarnaHandler::countriesData(); $signLang = "en"; foreach ($countriesData as $countryData) { if ($countryData['country_code'] == $lang) { $signLang = $lang; break; } } /* $logo = '<a href="https://merchants.klarna.com/signup?locale=' . $signLang . '&partner_id=7829355537eae268a17667c199e7c7662d3391f7" target="_blank"> <img src="' . JURI::root () . VMKLARNAPLUGINWEBROOT . '/klarna/assets/images/logo/get_klarna_now.png" /></a> '; */ $logo = '<img src="' . JURI::root() . VMKLARNAPLUGINWEBROOT . '/klarna/assets/images/logo/get_klarna_now.jpg" style="margin-bottom: 10px"/>'; $html = '<p><a href="#" id="klarna_getklarna_link" ">' . $logo . '</a></p>'; // https://merchants.klarna.com/signup?locale=en&partner_id=7829355537eae268a17667c199e7c7662d3391f7&utm_campaign=Platform&utm_medium=Partners&utm_source=Virtuemart $html .= '<div id="klarna_getklarna_show_hide" >'; $url = "https://merchants.klarna.com/signup/?locale=" . $signLang . "&partner_id=7829355537eae268a17667c199e7c7662d3391f7&utm_campaign=Platform&utm_medium=Partners&utm_source=Virtuemart"; $js = ' jQuery(document).ready(function( $ ) { $("#klarna_getklarna_show_hide").hide(); jQuery("#klarna_getklarna_link").click( function() { if ( $("#klarna_getklarna_show_hide").is(":visible") ) { $("#klarna_getklarna_show_hide").hide("slow"); $("#klarna_getklarna_link").html("' . addslashes($logo) . '"); } else { $("#klarna_getklarna_show_hide").show("slow"); $("#klarna_getklarna_link").html("' . addslashes(vmText::_('VMPAYMENT_KLARNA_GET_KLARNA_HIDE')) . '"); } }); }); '; vmJsApi::addJScript('vm.getKlarna', $js); $html .= '<iframe src="' . $url . '" scrolling="yes" style="x-overflow: none;" frameborder="0" height="600px" width="850px"></iframe>'; $html .= '</div>'; $html .= '<p><a target="_blank" href="http://cdn.klarna.com/1.0/shared/content/integration/guide/virtuemart.pdf" class="signin-button-link">' . vmText::_('VMPAYMENT_KLARNA_DOCUMENTATION') . '</a></p>'; return $html; }
function sendPostRequest () { $post_variables = $this->getPostVariables(); $jump_url = $this->getJumpUrl(); $html = ''; if ($this->_method->debug) { $html .= '<form action="' . $jump_url . '" method="post" name="vm_realex_form" target="realex">'; } else { if (vmconfig::get('css')) { $msg = vmText::_('VMPAYMENT_REALEX_HPP_API_REDIRECT_MESSAGE', true); } else { $msg=''; } vmJsApi::addJScript('vm.paymentFormAutoSubmit', ' jQuery(document).ready(function($){ jQuery("body").addClass("vmLoading"); var msg="'.$msg.'"; jQuery("body").append("<div class=\"vmLoadingDiv\"><div class=\"vmLoadingDivMsg\">"+msg+"</div></div>"); jQuery("#vmPaymentForm").submit(); }) '); $html .= '<form action="' . $jump_url . '" method="post" name="vm_realex_form" id="vmPaymentForm" accept-charset="UTF-8">'; } $html .= '<input type="hidden" name="charset" value="utf-8">'; foreach ($post_variables as $name => $value) { $html .= '<input type="hidden" name="' . $name . '" value="' . $value . '" />'; } if ($this->_method->debug) { $html .= '<div style="background-color:red;color:white;padding:10px;"> <input type="submit" value="The method is in debug mode. Click here to be redirected to Realex" /> </div>'; $this->debugLog($post_variables, 'sendPostRequest:', 'debug'); } $html .= '</form>'; return $html; }
protected function getInput() { $pluginpath = '/plugins/vmshopper/ordernumber/ordernumber/'; $doc = JFactory::getDocument()->addStyleSheet(JURI::root(true) . $pluginpath . 'assets/css/ordernumber.css'); $doc->addScript(JURI::root(true) . $pluginpath . 'assets/js/ordernumber.js'); vmJsApi::jQuery(); $this->makeJSTranslationsAvailable(); // Look up the current counters $db = JFactory::getDBO(); $db->setQuery('SELECT `number_format`, `count` FROM `#__virtuemart_shopper_plg_ordernumber` WHERE `number_type`=' . $db->quote($this->countertype) . ' ORDER BY `number_format`;'); $counters = $db->loadObjectList(); // Joomla 2.x uses <li> for the params and float:left on the controls, so we need to add that too $float = ""; if (version_compare(JVERSION, '3.0', 'lt')) { $float = "float: left; "; } $html = array(); $html[] = "<img src='" . JURI::root(true) . $pluginpath . "assets/images/loading.gif' class='vm-ordernumber-loading' style=\"display: none; position: absolute; top: 2px; left: 0px; z-index: 9999;\"/><table class=\"vmordernumber-countertable table-striped \" style=\"display: inline-table; {$float}\">"; $html[] = " <tr>"; $html[] = " <th class='counter_format'>" . JText::_('PLG_ORDERNUMBER_COUNTERLIST_HEADER_COUNTER') . "</th>"; $html[] = " <th class='counter_value'>" . JText::_('PLG_ORDERNUMBER_COUNTERLIST_HEADER_VALUE') . "</th>"; $html[] = " <th class='counter_buttons'></th>"; $html[] = " </tr>"; $html[] = " <colgroup><col class='counter_type'><col style=\"text-align: center\" ><col ></colgroup>"; foreach ($counters as $c) { $displayfmt = $c->number_format; if ($displayfmt == "") { $displayfmt = JText::_('PLG_ORDERNUMBER_COUNTERLIST_GLOBAL'); } $html[] = " <tr class='counter_row counter_type_{$this->countertype}'>"; $html[] = " <td class='counter_format'>" . (string) $displayfmt . "</td>"; $html[] = " <td class='counter_value'>" . (string) $c->count . "</td>"; $html[] = " <td class='counter_buttons'><div class='ordernumber-ajax-loading'><img src='" . JURI::root(true) . $pluginpath . "assets/images/icon-16-edit.png' class='vmordernumber-counter-editbtn vmordernumber-btn' onClick='ajaxEditCounter(this, {$this->countertype}, " . json_encode($c->number_format) . ", {$c->count})' /></div><div class='ordernumber-ajax-loading'><img src='" . JURI::root(true) . $pluginpath . "assets/images/icon-16-delete.png' class='vmordernumber-counter-deletebtn vmordernumber-btn' onClick='ajaxDeleteCounter(this, {$this->countertype}, " . json_encode($c->number_format) . ", {$c->count})' /></div></td>"; $html[] = " </tr>"; } $html[] = " <tr class='addcounter_row'>"; $html[] = " <td colspan=3 class='counter_add'><div class='vmordernumber-counter-addbtn vmordernumber-btn' onClick='ajaxAddCounter(this, {$this->countertype})'><div class='ordernumber-ajax-loading'><img src='" . JURI::root(true) . $pluginpath . "assets/images/icon-16-new.png' class='vmordernumber-counter-addbtn' /></div>" . JText::_('PLG_ORDERNUMBER_COUNTERLIST_ADD') . "</div></td>"; $html[] = " </tr>"; $html[] = "</table>"; return implode("\n", $html); }
function __construct(&$subject, $config) { //if (self::$_this) // return self::$_this; parent::__construct($subject, $config); $this->_loggable = TRUE; $this->tableFields = array_keys($this->getTableSQLFields()); $this->_tablepkey = 'id'; $this->_tableId = 'id'; $varsToPush = $this->getVarsToPush(); $this->setConfigParameterable($this->_configTableFieldName, $varsToPush); $this->setCryptedFields(array('accessKey', 'secretKey')); $amazon_library = JPATH_SITE . DS . 'plugins' . DS . 'vmpayment' . DS . 'amazon' . DS . 'library'; //set_include_path(get_include_path() . PATH_SEPARATOR . realpath(dirname(__FILE__) . "/../../.")); set_include_path($amazon_library); $this->loadAmazonClass('OffAmazonPaymentsService_Client'); if (!JFactory::getApplication()->isSite()) { vmJsApi::jQuery(); JFactory::getDocument()->addScript(JURI::root(true) . '/plugins/vmpayment/amazon/assets/js/admin.js'); JFactory::getDocument()->addStyleSheet(JURI::root(true) . '/plugins/vmpayment/amazon/assets/css/amazon-admin.css'); } }
/** * Method to render the plugin datas * this is an entry point to plugin to easy renders json or html * * * @access public */ function Plugin() { $user = JFactory::getUser(); if (!($user->authorise('core.admin', 'com_virtuemart') or $user->authorise('core.manage', 'com_virtuemart'))) { return false; } $type = vRequest::getCmd('type', 'vmcustom'); $typeWhiteList = array('vmshopper', 'vmcustom', 'vmcalculation', 'vmpayment', 'vmshipment', 'vmuserfield'); if (!in_array($type, $typeWhiteList)) { return false; } $name = vRequest::getString('name', ''); JPluginHelper::importPlugin($type, $name); $dispatcher = JDispatcher::getInstance(); // if you want only one render simple in the plugin use jExit(); // or $render is an array of code to echo as html or json Object! $render = null; $dispatcher->trigger('plgVmOnSelfCallBE', array($type, $name, &$render)); if ($render) { // Get the document object. $document = JFactory::getDocument(); if (vRequest::getCmd('cache', 'no')) { JResponse::setHeader('Cache-Control', 'no-cache, must-revalidate'); JResponse::setHeader('Expires', 'Mon, 6 Jul 2000 10:00:00 GMT'); } $format = vRequest::getCmd('format', 'json'); if ($format == 'json') { $document->setMimeEncoding('application/json'); // Change the suggested filename. JResponse::setHeader('Content-Disposition', 'attachment;filename="' . $type . '".json"'); echo vmJsApi::safe_json_encode($render); } else { echo $render; } } return true; }
public function display($tpl = null) { $view = vRequest::getCmd('view', vRequest::getCmd('controller', 'virtuemart')); if ($view == 'virtuemart' || $view == 'about' || $this->canDo->get('core.admin')) { //Super administrators always have access parent::display($tpl); if ($this->writeJs) { echo vmJsApi::writeJS(); } return; } //Super administrator always has access if ($this->canDo->get('core.admin')) { parent::display($tpl); if ($this->writeJs) { echo vmJsApi::writeJS(); } return; } if (!$this->canDo->get('vm.' . $view)) { JFactory::getApplication()->redirect('index.php?option=com_virtuemart', JText::_('JERROR_ALERTNOAUTHOR'), 'error'); } parent::display($tpl); }
private function showActionOrderBEPayment($virtuemart_order_id, $virtuemart_paymentmethod_id, $payments) { $orderModel = VmModel::getModel('orders'); $order = $orderModel->getOrder($virtuemart_order_id); $options = array(); if ($this->isDelayedSettlement()) { $options[] = JHTML::_('select.option', 'settlePayment', vmText::_('VMPAYMENT_REALEX_HPP_API_ORDER_BE_CAPTURE'), 'value', 'text'); } $options[] = JHTML::_('select.option', 'rebatePayment', vmText::_('VMPAYMENT_REALEX_HPP_API_ORDER_BE_REBATE'), 'value', 'text'); $actionList = JHTML::_('select.genericlist', $options, 'action', '', 'value', 'text', 'capturePayment', 'action', true); $html = '<table class="adminlist table" >' . "\n"; $html .= $this->getHtmlHeaderBE(); $html .= '<form action="index.php" method="post" name="updateOrderBEPayment" id="updateOrderBEPayment">'; $html .= '<tr ><td >'; $html .= $actionList; $html .= ' </td><td>'; $html .= '<input type="text" id="amount" name="amount" size="20" value="" class="required" maxlength="25" placeholder="' . vmText::sprintf('VMPAYMENT_REALEX_HPP_API_ORDER_BE_AMOUNT', shopFunctions::getCurrencyByID($payments[0]->payment_currency, 'currency_code_3')) . '"/>'; $html .= '<input type="hidden" name="type" value="vmpayment"/>'; $html .= '<input type="hidden" name="name" value="realex_hpp_api"/>'; $html .= '<input type="hidden" name="view" value="plugin"/>'; $html .= '<input type="hidden" name="option" value="com_virtuemart"/>'; $html .= '<input type="hidden" name="virtuemart_order_id" value="' . $virtuemart_order_id . '"/>'; $html .= '<input type="hidden" name="virtuemart_paymentmethod_id" value="' . $virtuemart_paymentmethod_id . '"/>'; $html .= '<a class="updateOrderBEPayment btn btn-small" href="#" >' . vmText::_('COM_VIRTUEMART_SAVE') . '</a>'; $html .= '</form>'; $html .= ' </td></tr>'; vmJsApi::addJScript('vmRealex.updateOrderBEPayment', "\n\t\tjQuery(document).ready( function(\$) {\n\t\t\tjQuery('.updateOrderBEPayment').click(function() {\n\t\t\t\tdocument.updateOrderBEPayment.submit();\n\t\t\t\treturn false;\n\n\t});\n});\n"); //$html .= '</table>' ; return $html; }
function addStandardEditViewCommandsNoValidate($id = 0, $object = null) { $view = vRequest::getCmd('view', vRequest::getCmd('controller', 'tsmart')); if (!class_exists('JToolBarHelper')) { require JPATH_ADMINISTRATOR . DS . 'includes' . DS . 'toolbar.php'; } JToolBarHelper::divider(); if (vmAccess::manager($view . '.edit')) { JToolBarHelper::save(); JToolBarHelper::apply(); } JToolBarHelper::cancel(); //self::showHelp(); //self::showACLPref($view); if ($view != 'shipmentmethod' and $view != 'paymentmethod' and $view != 'media') { $validate = true; } else { $validate = false; } $this->addJsJoomlaSubmitButtonNoValidate($validate); $editView = vRequest::getCmd('view', vRequest::getCmd('controller', '')); $params = JComponentHelper::getParams('com_languages'); $selectedLangue = $params->get('site', 'en-GB'); $this->lang = strtolower(strtr($selectedLangue, '-', '_')); // Get all the published languages defined in Language manager > Content $allLanguages = JLanguageHelper::getLanguages(); foreach ($allLanguages as $jlang) { $languagesByCode[$jlang->lang_code] = $jlang; } // only add if ID and view not null if ($editView and $id and count(tsmConfig::get('active_languages')) > 1) { if ($editView == 'user') { $editView = 'vendor'; } jimport('joomla.language.helper'); $this->lang = vRequest::getVar('vmlang', $this->lang); // list of languages installed in #__extensions (may be more than the ones in the Language manager > Content if the user did not added them) $languages = JLanguageHelper::createLanguageList($selectedLangue, constant('VMPATH_ROOT'), true); $activeVmLangs = tsmConfig::get('active_languages'); $flagCss = ""; foreach ($languages as $k => &$joomlaLang) { if (!in_array($joomlaLang['value'], $activeVmLangs)) { unset($languages[$k]); } else { $key = $joomlaLang['value']; if (!isset($languagesByCode[$key])) { $img = substr($key, 0, 2); //We try a fallback vmdebug('com_tsmart_MISSING_FLAG', $img, $joomlaLang['text']); } else { $img = $languagesByCode[$key]->image; } $image_flag = VMPATH_ROOT . "/media/mod_languages/images/" . $img . ".gif"; $image_flag_url = JURI::root() . "media/mod_languages/images/" . $img . ".gif"; if (!file_exists($image_flag)) { vmerror(tsmText::sprintf('com_tsmart_MISSING_FLAG', $image_flag, $joomlaLang['text'])); } else { $flagCss .= "td.flag-" . $key . ",.flag-" . $key . "{background: url( " . $image_flag_url . ") no-repeat 0 0; padding-left:20px !important;}\n"; } } } JFactory::getDocument()->addStyleDeclaration($flagCss); $this->langList = JHtml::_('select.genericlist', $languages, 'vmlang', 'class="inputbox" style="width:176px;"', 'value', 'text', $selectedLangue, 'vmlang'); if ($editView == 'product') { $productModel = tmsModel::getModel('product'); $childproducts = $productModel->getProductChilds($id) ? $productModel->getProductChilds($id) : ''; } $token = vRequest::getFormToken(); $j = ' jQuery(function($) { var oldflag = ""; $("select#vmlang").chosen().change(function() { langCode = $(this).find("option:selected").val(); flagClass = "flag-"+langCode; jQuery.ajax({ type: "GET", cache: false, dataType: "json", url: "index.php?option=com_tsmart&view=translate&task=paste&format=json&lg="+langCode+"&id=' . $id . '&editView=' . $editView . '&' . $token . '=1", }).done( function(data) { var items = []; var theForm = document.forms["adminForm"]; if(typeof theForm.vmlang==="undefined"){ var input = document.createElement("input"); input.type = "hidden"; input.name = "vmlang"; input.value = langCode; theForm.appendChild(input); } else { theForm.vmlang.value = langCode; } if (data.fields !== "error" ) { if (data.structure == "empty") alert(data.msg); $.each(data.fields , function(key, val) { cible = jQuery("#"+key); if (oldflag !== "") cible.parent().removeClass(oldflag) var tmce_ver = 0; if(typeof window.tinyMCE!=="undefined"){ var tmce_ver=window.tinyMCE.majorVersion; } if (tmce_ver>="4") { if (cible.parent().addClass(flagClass).children().hasClass("mce_editable") && data.structure !== "empty" ) { tinyMCE.get(key).execCommand("mceSetContent", false,val); cible.val(val); } else if (data.structure !== "empty") cible.val(val); } else { if (cible.parent().addClass(flagClass).children().hasClass("mce_editable") && data.structure !== "empty" ) { tinyMCE.execInstanceCommand(key,"mceSetContent",false,val); cible.val(val); } else if (data.structure !== "empty") cible.val(val); } }); } else alert(data.msg);'; if ($editView == 'product' && !empty($childproducts)) { foreach ($childproducts as $child) { $j .= 'jQuery.ajax({ type: "GET", cache: false, dataType: "json", url: "index.php?option=com_tsmart&view=translate&task=paste&format=json&lg="+langCode+"&id=' . $child->tsmart_product_id . '&editView=' . $editView . '&' . $token . '=1", }).done( // $.getJSON( "index.php?option=com_tsmart&view=translate&task=paste&format=json&lg="+langCode+"&id=' . $child->tsmart_product_id . '&editView=' . $editView . '&' . $token . '=1" , function(data) { cible = jQuery("#child' . $child->tsmart_product_id . 'product_name"); if (oldflag !== "") cible.parent().removeClass(oldflag) cible.parent().addClass(flagClass); cible.val(data.fields.product_name); jQuery("#child' . $child->tsmart_product_id . 'slug").val(data.fields["slug"]); } ) '; } } $j .= 'oldflag = flagClass ; } ) }); })'; vmJsApi::addJScript('vmlang', $j); } else { $jlang = JFactory::getLanguage(); $langs = $jlang->getKnownLanguages(); $defautName = $selectedLangue; $flagImg = $selectedLangue; if (isset($languagesByCode[$selectedLangue])) { $defautName = $langs[$selectedLangue]['name']; $flagImg = JHtml::_('image', 'mod_languages/' . $languagesByCode[$selectedLangue]->image . '.gif', $languagesByCode[$selectedLangue]->title_native, array('title' => $languagesByCode[$selectedLangue]->title_native), true); } else { vmWarn(tsmText::sprintf('com_tsmart_MISSING_FLAG', $selectedLangue, $selectedLangue)); } $this->langList = '<input name ="vmlang" type="hidden" value="' . $selectedLangue . '" >' . $flagImg . ' <b> ' . $defautName . '</b>'; } if (JFactory::getApplication()->isSite()) { $bar = JToolBar::getInstance('toolbar'); $bar->appendButton('Link', 'back', 'com_tsmart_LEAVE', 'index.php?option=com_tsmart&manage=0'); } }
* @version $Id: cart_advertisement.php 7862 2014-04-25 09:26:53Z alatak $ * @package VirtueMart * @subpackage payment * @copyright Copyright (C) 2004-Copyright (C) 2004-2016 Virtuemart Team. All rights reserved. - 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. * See /administrator/components/com_virtuemart/COPYRIGHT.php for copyright notices and details. * * http://virtuemart.net */ $css = ".totalInPaymentCurrency {display:none;}\n"; if ($viewData['payment_form_position'] == 'right' or $viewData['payment_form_position'] == 'specific') { vmJsApi::css('klarnacheckout', 'plugins/vmpayment/klarnacheckout/assets/css'); } ?> <?php $class = ''; if ($viewData['message']) { $class = 'disableSnippet'; } ?> <div id="kco-payment-method" > <div id="kco-shipment-method"><?php echo $viewData['message']; ?> </div>
if ($layout != 'default') { $this->setLayout($this->newlayout); echo $this->loadTemplate(); } // var_dump($this); } // addon for joomla modal Box // JHTML::_('behavior.modal'); // JHTML::_('behavior.tooltip'); if (VmConfig::get('usefancy', 0)) { vmJsApi::js('fancybox/jquery.fancybox-1.3.4.pack'); vmJsApi::css('jquery.fancybox-1.3.4'); $box = "\$.fancybox({\n\t\t\t\thref: '" . $this->askquestion_url . "',\n\t\t\t\ttype: 'iframe',\n\t\t\t\theight: '550'\n\t\t\t});"; } else { vmJsApi::js('facebox'); vmJsApi::css('facebox'); $box = "\$.facebox({\n\t\t\t\tiframe: '" . $this->askquestion_url . "',\n\t\t\t\trev: 'iframe|550|550'\n\t\t\t});"; } if (VmConfig::get('ask_question', 1) == 1) { $document = JFactory::getDocument(); $document->addScriptDeclaration("\n\t//<![CDATA[\n\t\tjQuery(function(\$) {\n\t\t\t\$('a.ask-a-question').click( function(){\n\t\t\t\t" . $box . "\n\t\t\t\treturn false ;\n\t\t\t});\n\t\t});\n\t//]]>\n\t"); } /* Let's see if we found the product */ if (empty($this->product)) { echo JText::_('COM_VIRTUEMART_PRODUCT_NOT_FOUND'); echo '<br /><br /> ' . $this->continue_link_html; return; } ?> <div class="productdetails-view productdetails">
public function updateCustomsOrderItems() { $q = 'SELECT `product_attribute` FROM `#__virtuemart_order_items` LIMIT '; $do = true; $db = JFactory::getDbo(); $start = 0; $hunk = 1000; while ($do) { $db->setQuery($q . $start . ',' . $hunk); $items = $db->loadColumn(); if (!$items) { vmdebug('updateCustomsOrderItems Reached end after ' . $start / $hunk . ' loops'); break; } //The stored result in vm2.0.14 looks like this {"48":{"textinput":{"comment":"test"}}} //{"96":"18"} download plugin // 46 is virtuemart_customfield_id //{"46":" <span class=\"costumTitle\">Cap Size<\/span><span class=\"costumValue\" >S<\/span>","110":{"istraxx_customsize":{"invala":"10","invalb":"10"}}} //and now {"32":[{"invala":"100"}]} foreach ($items as $field) { if (strpos($field, '{') !== FALSE) { $jsField = json_decode($field); $fieldProps = get_object_vars($jsField); vmdebug('updateCustomsOrderItems', $fieldProps); $nJsField = array(); foreach ($fieldProps as $k => $props) { if (is_object($props)) { $props = (array) $props; foreach ($props as $ke => $prop) { if (!is_numeric($ke)) { vmdebug('Found old param style', $ke, $prop); if (is_object($prop)) { $prop = (array) $prop; $nJsField[$k] = $prop; /*foreach($prop as $name => $propvalue){ $nJsField[$k][$name] = $propvalue; }*/ } } else { //$nJsField[$k][$name] = $prop; } } } else { if (is_numeric($k) and is_numeric($props)) { $nJsField[$props] = $k; } else { $nJsField[$k] = $props; } } } $nJsField = vmJsApi::safe_json_encode($nJsField); vmdebug('updateCustomsOrderItems json $field encoded', $field, $nJsField); } else { vmdebug('updateCustomsOrderItems $field', $field); } } if (count($items) < $hunk) { vmdebug('Reached end'); break; } $start += $hunk; } // Create the view object $view = $this->getView('orders', 'html'); $view->display(); }
/** * @param $snippet * @param $message * @return string */ function displayJSSnippet($hide_BTST) { // DESKTOP: Width of containing block shall be at least 750px // MOBILE: Width of containing block shall be 100% of browser window (No // padding or margin) vmJsApi::addJScript('/plugins/vmpayment/klarnacheckout/assets/js/klarnacheckout.js', false, false); vmJsApi::jPrice(); $updateCartScript = ' jQuery(document).ready(function($) { window._klarnaCheckout(function(api) { api.on({ "change": function(data) { console.log("window._klarnaCheckout calls klarnaCheckoutPayment.updateCart "); klarnaCheckoutPayment.updateCart(data,"' . $this->_currentMethod->virtuemart_paymentmethod_id . '"); } }); }); }); '; $updateSnippetScript = ' jQuery(document).ready(function($) { klarnaCheckoutPayment.updateSnippet(); }); '; $initPaymentScript = ' jQuery(document).ready(function($) { klarnaCheckoutPayment.initPayment(' . $hide_BTST . '); }); '; vmJsApi::jDynUpdate(); vmJsApi::addJScript('vm.kco_updatecart', $updateCartScript); vmJsApi::addJScript('vm.kco_initpayment', $initPaymentScript); //vmJsApi::addJScript('vm.kco_updatesnippet', $updateSnippetScript); $hide_BTST = false; return; }
* @author Valerie Isaksen * @version $Id$ * @package VirtueMart * @subpackage payment * Copyright (C) 2004-2015 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. * See /administrator/components/com_virtuemart/COPYRIGHT.php for copyright notices and details. * * http://virtuemart.net */ defined('_JEXEC') or die; vmJsApi::css('paybox', 'plugins/vmpayment/paybox/paybox/assets/css/'); ?> <div class="paybox response"> <?php if ($viewData['success']) { ?> <div class="status_confirmed"> <?php echo vmText::sprintf('VMPAYMENT_' . $this->_name . '_PAYMENT_STATUS_CONFIRMED', $viewData['amount'] . " " . $viewData['currency'], $viewData["order_number"]); ?>
public static function addCheckRequiredJs() { $j = 'jQuery(document).ready(function(){ jQuery(".required").change(function(){ var count = 0; var hit = 0; jQuery.each(jQuery(".required"), function (key, value){ count++; if(jQuery(this).attr("checked")){ hit++; } }); if(count==hit){ console.log("Now fire"); var form = jQuery("#checkoutFormSubmit"); //document.checkoutForm.task = "checkout"; document.checkoutForm.submit() } }); });'; vmJsApi::addJScript('autocheck', $j); }
echo $this->product->max_order_level; ?> " size="10" /> </td> </tr> <tr> <td > <div style="text-align:right;font-weight:bold;"> <?php echo JText::_('COM_VIRTUEMART_PRODUCT_FORM_AVAILABLE_DATE'); ?> </div> </td> <td colspan="3"> <?php echo vmJsApi::jDate($this->product->product_available_date, 'product_available_date'); ?> </td> </tr> <tr> <td valign="top" > <div style="text-align:right;font-weight:bold;"> <?php echo JText::_('COM_VIRTUEMART_AVAILABILITY'); ?> </div> </td> <td colspan="2"> <input type="text" class="input-mini" id="product_availability" name="product_availability" value="<?php echo $this->product->product_availability; ?>
function display($tpl = null) { if (!class_exists('VmImage')) { require VMPATH_ADMIN . DS . 'helpers' . DS . 'image.php'; } tsmConfig::loadJLang('com_tsmart_orders', TRUE); if (JFactory::getApplication()->isSite()) { $bar = JToolBar::getInstance('toolbar'); $bar->appendButton('Link', 'back', 'com_tsmart_LEAVE', 'index.php?option=com_tsmart&manage=0'); } $layout = $this->getLayout(); if ($this->manager('report')) { vmSetStartTime('report'); $model = tmsModel::getModel('tsmart'); $nbrCustomers = $model->getTotalCustomers(); $this->nbrCustomers = $nbrCustomers; $nbrActiveProducts = $model->getTotalActiveProducts(); $this->nbrActiveProducts = $nbrActiveProducts; $nbrInActiveProducts = $model->getTotalInActiveProducts(); $this->nbrInActiveProducts = $nbrInActiveProducts; $nbrFeaturedProducts = $model->getTotalFeaturedProducts(); $this->nbrFeaturedProducts = $nbrFeaturedProducts; $ordersByStatus = $model->getTotalOrdersByStatus(); $this->ordersByStatus = $ordersByStatus; $recentOrders = $model->getRecentOrders(); if (!class_exists('CurrencyDisplay')) { require VMPATH_ADMIN . DS . 'helpers' . DS . 'currencydisplay.php'; } /* Apply currency This must be done per order since it's vendor specific */ $_currencies = array(); // Save the currency data during this loop for performance reasons foreach ($recentOrders as $tsmart_order_id => $order) { //This is really interesting for multi-X, but I avoid to support it now already, lets stay it in the code if (!array_key_exists('v' . $order->tsmart_vendor_id, $_currencies)) { $_currencies['v' . $order->tsmart_vendor_id] = CurrencyDisplay::getInstance('', $order->tsmart_vendor_id); } $order->order_total = $_currencies['v' . $order->tsmart_vendor_id]->priceDisplay($order->order_total); } $this->recentOrders = $recentOrders; $recentCustomers = $model->getRecentCustomers(); $this->recentCustomers = $recentCustomers; $reportModel = tmsModel::getModel('report'); vRequest::setvar('task', ''); $myCurrencyDisplay = CurrencyDisplay::getInstance(); $revenueBasic = $reportModel->getRevenue(60, true); $this->report = $revenueBasic['report']; vmJsApi::addJScript("jsapi", "//google.com/jsapi", false, false, ''); vmJsApi::addJScript('vm.stats_chart', $revenueBasic['js'], false, true); vmTime('Created report', 'report'); } //if($layout=='default'){ $j = 'jQuery("#feed").ready(function(){ var datas = ""; vmSiteurl = "' . JURI::root() . '" jQuery.ajax({ type: "GET", async: true, cache: false, dataType: "json", url: vmSiteurl + "index.php?option=com_tsmart&view=tsmart&task=feed", data: datas, dataType: "html" }) .done(function( data ) { jQuery("#feed").append(data); }); })'; vmJsApi::addJScript('getFeed', $j, false, true); //} self::showACLPref($this); parent::display($tpl); }
/** * This shows the plugin for choosing in the payment list of the checkout process. * * @author Valerie Cartan Isaksen */ function plgVmDisplayListFEPayment(VirtueMartCart $cart, $selected = 0, &$htmlIn) { //JHTML::_ ('behavior.tooltip'); if ($this->getPluginMethods($cart->vendorId) === 0) { if (empty($this->_name)) { $app = JFactory::getApplication(); $app->enqueueMessage(vmText::_('COM_VIRTUEMART_CART_NO_' . strtoupper($this->_psType))); return FALSE; } else { return FALSE; } } $html = array(); $method_name = $this->_psType . '_name'; JHTML::script('vmcreditcard.js', 'components/com_virtuemart/assets/js/', FALSE); VmConfig::loadJLang('com_virtuemart', true); vmJsApi::jCreditCard(); $htmla = ''; $html = array(); foreach ($this->methods as $this->_currentMethod) { if ($this->checkConditions($cart, $this->_currentMethod, $cart->cartPrices)) { $methodSalesPrice = $this->setCartPrices($cart, $cart->cartPrices, $this->_currentMethod); $this->_currentMethod->{$method_name} = $this->renderPluginName($this->_currentMethod); $html = $this->getPluginHtml($this->_currentMethod, $selected, $methodSalesPrice); if ($selected == $this->_currentMethod->virtuemart_paymentmethod_id) { $this->_getAuthorizeNetFromSession(); } else { $this->_cc_type = ''; $this->_cc_number = ''; $this->_cc_cvv = ''; $this->_cc_expire_month = ''; $this->_cc_expire_year = ''; } if (empty($this->_currentMethod->creditcards)) { $this->_currentMethod->creditcards = self::getCreditCards(); } elseif (!is_array($this->_currentMethod->creditcards)) { $this->_currentMethod->creditcards = (array) $this->_currentMethod->creditcards; } $creditCards = $this->_currentMethod->creditcards; $creditCardList = ''; if ($creditCards) { $creditCardList = $this->_renderCreditCardList($creditCards, $this->_cc_type, $this->_currentMethod->virtuemart_paymentmethod_id, FALSE); } $sandbox_msg = ""; if ($this->_currentMethod->sandbox) { $sandbox_msg .= '<br />' . vmText::_('VMPAYMENT_AUTHORIZENET_SANDBOX_TEST_NUMBERS'); } $cvv_images = $this->_displayCVVImages($this->_currentMethod); $html .= '<br /><span class="vmpayment_cardinfo">' . vmText::_('VMPAYMENT_AUTHORIZENET_COMPLETE_FORM') . $sandbox_msg . ' <table border="0" cellspacing="0" cellpadding="2" width="100%"> <tr valign="top"> <td nowrap width="10%" align="right"> <label for="creditcardtype">' . vmText::_('VMPAYMENT_AUTHORIZENET_CCTYPE') . '</label> </td> <td>' . $creditCardList . '</td> </tr> <tr valign="top"> <td nowrap width="10%" align="right"> <label for="cc_type">' . vmText::_('VMPAYMENT_AUTHORIZENET_CCNUM') . '</label> </td> <td> <script type="text/javascript"> //<![CDATA[ function checkAuthorizeNet(id, el) { ccError=razCCerror(id); CheckCreditCardNumber(el.value, id); if (!ccError) { el.value=\'\';} } //]]> </script> <input type="text" class="inputbox" id="cc_number_' . $this->_currentMethod->virtuemart_paymentmethod_id . '" name="cc_number_' . $this->_currentMethod->virtuemart_paymentmethod_id . '" value="' . $this->_cc_number . '" autocomplete="off" onchange="javascript:checkAuthorizeNet(' . $this->_currentMethod->virtuemart_paymentmethod_id . ', this);" /> <div id="cc_cardnumber_errormsg_' . $this->_currentMethod->virtuemart_paymentmethod_id . '"></div> </td> </tr> <tr valign="top"> <td nowrap width="10%" align="right"> <label for="cc_cvv">' . vmText::_('VMPAYMENT_AUTHORIZENET_CVV2') . '</label> </td> <td> <input type="text" class="inputbox" id="cc_cvv_' . $this->_currentMethod->virtuemart_paymentmethod_id . '" name="cc_cvv_' . $this->_currentMethod->virtuemart_paymentmethod_id . '" maxlength="4" size="5" value="' . $this->_cc_cvv . '" autocomplete="off" /> <span class="hasTip" title="' . vmText::_('VMPAYMENT_AUTHORIZENET_WHATISCVV') . '::' . vmText::sprintf("VMPAYMENT_AUTHORIZENET_WHATISCVV_TOOLTIP", $cvv_images) . ' ">' . vmText::_('VMPAYMENT_AUTHORIZENET_WHATISCVV') . ' </span></td> </tr> <tr> <td nowrap width="10%" align="right">' . vmText::_('VMPAYMENT_AUTHORIZENET_EXDATE') . '</td> <td> '; $html .= shopfunctions::listMonths('cc_expire_month_' . $this->_currentMethod->virtuemart_paymentmethod_id, $this->_cc_expire_month); $html .= " / "; $html .= ' <script type="text/javascript"> //<![CDATA[ function changeDate(id, el) { var month = document.getElementById(\'cc_expire_month_\'+id); if(!CreditCardisExpiryDate(month.value,el.value, id)) {el.value=\'\'; month.value=\'\';} } //]]> </script>'; $html .= shopfunctions::listYears('cc_expire_year_' . $this->_currentMethod->virtuemart_paymentmethod_id, $this->_cc_expire_year, NULL, 2022, " onchange=\"javascript:changeDate(" . $this->_currentMethod->virtuemart_paymentmethod_id . ", this);\" "); $html .= '<div id="cc_expiredate_errormsg_' . $this->_currentMethod->virtuemart_paymentmethod_id . '"></div>'; $html .= '</td> </tr> </table></span>'; $htmla[] = $html; } } $htmlIn[] = $htmla; return TRUE; }
* @subpackage * @author Max Milbers, Valerie Isaksen * @link http://www.virtuemart.net * @copyright Copyright (c) 2004 - 2014 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. * @version $Id: default_showprices.php 8024 2014-06-12 15:08:59Z Milbo $ */ // Check to ensure this file is included in Joomla! defined('_JEXEC') or die('Restricted access'); static $ask_recommened_loaded = false; if ($ask_recommened_loaded) { return ''; } $product = $viewData['product']; // addon for joomla modal Box JHtml::_('behavior.modal'); if (VmConfig::get('usefancy', 1)) { vmJsApi::addJScript('fancybox/jquery.fancybox-1.3.4.pack', false); vmJsApi::css('jquery.fancybox-1.3.4'); $Modal = "\n\t\t\t\$('a.ask-a-question, a.printModal, a.recommened-to-friend, a.manuModal').click(function(event){\n event.preventDefault();\n\t\t \$.fancybox({\n\t\t href: \$(this).attr('href'),\n\t\t type: 'iframe',\n\t\t height: 550\n\t\t });\n\t\t });\n\t\t\t"; } else { vmJsApi::addJScript('facebox', false); vmJsApi::css('facebox'); $Modal = "\n \t\t\$('a.ask-a-question, a.printModal, a.recommened-to-friend, a.manuModal').click(function(event){\n\t\t event.preventDefault();\n\t\t \$.facebox({\n\t\t iframe: \$(this).attr('href'),\n\t\t rev: 'iframe|550|550'\n\t\t });\n\t\t });\n \t\t"; } vmJsApi::addJScript('popups', "\n//<![CDATA[\n\tjQuery(document).ready(function(\$) {\n\t\t" . $Modal . "\n\t});\n//]]>\n");
/** * Formating front display by roles * for product only ! */ public function displayProductCustomfieldFE(&$product, $customfield, $row = '') { $virtuemart_custom_id = isset($customfield->virtuemart_custom_id) ? $customfield->virtuemart_custom_id : 0; $value = $customfield->custom_value; $type = $customfield->field_type; $is_list = isset($customfield->is_list) ? $customfield->is_list : 0; $price = isset($customfield->custom_price) ? $customfield->custom_price : 0; $is_cart = isset($customfield->is_cart) ? $customfield->is_cart : 0; //vmdebug('displayProductCustomfieldFE and here is something wrong ',$customfield); JLoader::register('CurrencyDisplay', JPATH_VM_ADMINISTRATOR . '/helpers/currencydisplay.php'); $currency = CurrencyDisplay::getInstance(); if ($is_list > 0) { $values = explode(';', $value); if ($is_cart != 0) { $options = array(); foreach ($values as $key => $val) { $options[] = array('value' => $val, 'text' => $val); } // J3 use chosen vmJsApi::chosenDropDowns(); return JHTML::_('select.genericlist', $options, 'field[' . $row . '][custom_value]', NULL, 'value', 'text', FALSE, TRUE); } else { $html = ''; $html .= '<div id="custom_' . $virtuemart_custom_id . '_' . $value . '" >' . $value . '</div>'; return $html; } } else { if ($price > 0) { $price = $currency->priceDisplay((double) $price); } switch ($type) { case 'A': $options = array(); $session = JFactory::getSession(); $virtuemart_category_id = $session->get('vmlastvisitedcategoryid', 0, 'vm'); $productModel = VmModel::getModel('product'); //parseCustomParams VirtueMartModelCustomfields::bindParameterableByFieldType($customfield); //Todo preselection as dropdown of children //Note by Max Milbers: This is not necessary, in this case it is better to unpublish the parent and to give the child which should be preselected a category //Or it is withParent, in that case there exists the case, that a parent should be used as a kind of mini category and not be orderable. //There exists already other customs and in special plugins which wanna disable or change the add to cart button. //I suggest that we manipulate the button with a message "choose a variant first" //if(!isset($customfield->pre_selected)) $customfield->pre_selected = 0; $selected = JRequest::getVar('virtuemart_product_id', 0); if (is_array($selected)) { $selected = $selected[0]; } $selected = (int) $selected; $html = ''; $uncatChildren = $productModel->getUncategorizedChildren($customfield->withParent); if (empty($uncatChildren)) { return $html; break; } foreach ($uncatChildren as $k => $child) { $options[] = array('value' => JRoute::_('index.php?option=com_virtuemart&view=productdetails&virtuemart_category_id=' . $virtuemart_category_id . '&virtuemart_product_id=' . $child['virtuemart_product_id']), 'text' => $child['product_name']); } $html .= JHTML::_('select.genericlist', $options, 'field[' . $row . '][custom_value]', 'onchange="window.top.location.href=this.options[this.selectedIndex].value" size="1" class="inputbox"', "value", "text", JRoute::_('index.php?option=com_virtuemart&view=productdetails&virtuemart_category_id=' . $virtuemart_category_id . '&virtuemart_product_id=' . $selected, 'cf' . $row . '-' . $selected)); //vmdebug('$customfield',$customfield); if ($customfield->parentOrderable == 0 and $product->product_parent_id == 0) { $product->orderable = FALSE; } return $html; break; /* variants*/ /* variants*/ case 'V': if ($price == 0) { $price = JText::_('COM_VIRTUEMART_CART_PRICE_FREE'); } /* Loads the product price details */ return '<input type="text" value="' . JText::_($value) . '" name="field[' . $row . '][custom_value]" /> ' . JText::_('COM_VIRTUEMART_CART_PRICE') . $price . ' '; break; /*Date variant*/ /*Date variant*/ case 'D': return '<span class="product_custom_date">' . vmJsApi::date($value, 'LC1', TRUE) . '</span>'; //vmJsApi::jDate($field->custom_value, 'field['.$row.'][custom_value]','field_'.$row.'_customvalue').$priceInput; break; /* text area or editor No JText, only displayed in BE */ /* text area or editor No JText, only displayed in BE */ case 'X': case 'Y': return $value; break; /* string or integer */ /* string or integer */ case 'S': case 'I': return JText::_($value); break; /* bool */ /* bool */ case 'B': if ($value == 0) { return JText::_('COM_VIRTUEMART_NO'); } return JText::_('COM_VIRTUEMART_YES'); break; /* parent */ /* parent */ case 'P': return '<span class="product_custom_parent">' . JText::_($value) . '</span>'; break; /* product kit(bundle) */ /* product kit(bundle) */ case 'K': $pModel = VmModel::getModel('product'); $related = $pModel->getProduct((int) $value, TRUE, TRUE, TRUE, 1, FALSE); if (!$related) { vmError('related product is missing, maybe unpublished'); return false; } $param = json_decode($customfield->custom_param); if (empty($param->is_hidden)) { $thumb = ''; if (!empty($related->virtuemart_media_id[0])) { $thumb = $this->displayCustomMedia($related->virtuemart_media_id[0]) . ' '; } else { $thumb = $this->displayCustomMedia(0) . ' '; } return '<span class="span2">' . $thumb . '</span> <span class="span8">' . $related->product_name . '</span></span> <input type="hidden" name="virtuemart_product_id[]" value="' . $related->virtuemart_product_id . '"/> <input type="text" class="quantity-input span2" name="quantity[]" value="1"/> '; } else { return '<input type="hidden" name="virtuemart_product_id[]" value="' . $related->virtuemart_product_id . '"/> <input type="hidden" class="quantity-input" name="quantity[]" value="1"/>'; } break; /* related */ /* related */ case 'R': $pModel = VmModel::getModel('product'); $related = $pModel->getProduct((int) $value, TRUE, TRUE, TRUE, 1, FALSE); if (!$related) { vmError('related product is missing, maybe unpublished'); return false; } $thumb = ''; if (!empty($related->virtuemart_media_id[0])) { $thumb = $this->displayCustomMedia($related->virtuemart_media_id[0]) . ' '; } else { $thumb = $this->displayCustomMedia(0) . ' '; } return JHTML::link(JRoute::_('index.php?option=com_virtuemart&view=productdetails&virtuemart_product_id=' . $related->virtuemart_product_id . '&virtuemart_category_id=' . $related->virtuemart_category_id, FALSE), $thumb . $related->product_name, array('title' => $related->product_name)); break; /* image */ /* image */ case 'M': return $this->displayCustomMedia($value); break; /* categorie */ /* categorie */ case 'Z': $q = 'SELECT * FROM `#__virtuemart_categories_' . VMLANG . '` as l JOIN `#__virtuemart_categories` AS c using (`virtuemart_category_id`) WHERE `published`=1 AND l.`virtuemart_category_id`= "' . (int) $value . '" '; $this->_db->setQuery($q); if ($category = $this->_db->loadObject()) { $q = 'SELECT `virtuemart_media_id` FROM `#__virtuemart_category_medias`WHERE `virtuemart_category_id`= "' . $category->virtuemart_category_id . '" '; $this->_db->setQuery($q); $thumb = ''; if ($media_id = $this->_db->loadResult()) { $thumb = $this->displayCustomMedia($media_id, 'category'); } return JHTML::link(JRoute::_('index.php?option=com_virtuemart&view=category&virtuemart_category_id=' . $category->virtuemart_category_id, 'cf' . $row . '-' . (int) $value), $thumb . ' ' . $category->category_name, array('title' => $category->category_name)); } else { return ''; } /* Child Group list * this have no direct display , used for stockable product */ /* Child Group list * this have no direct display , used for stockable product */ case 'G': return ''; //'<input type="text" value="'.JText::_($value).'" name="field['.$row.'][custom_value]" /> '.JText::_('COM_VIRTUEMART_CART_PRICE').' : '.$price .' '; break; break; } } }