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; }
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/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; }
static function jDate($date = '', $name = "date", $id = NULL, $resetBt = TRUE, $yearRange = '') { if ($yearRange) { $yearRange = 'yearRange: "' . $yearRange . '",'; } if ($date == "0000-00-00 00:00:00") { $date = 0; } if (empty($id)) { $id = $name; } static $jDate; $dateFormat = JText::_('COM_VIRTUEMART_DATE_FORMAT_INPUT_J16'); //="m/d/y" $search = array('m', 'd'); $replace = array('mm', 'dd'); $jsDateFormat = str_replace($search, $replace, $dateFormat); if ($date) { if (JVM_VERSION === 1) { $search = array('m', 'd', 'y'); $replace = array('%m', '%d', '%y'); $dateFormat = str_replace($search, $replace, $dateFormat); } $formatedDate = JHTML::_('date', $date, $dateFormat); } else { $formatedDate = JText::_('COM_VIRTUEMART_NEVER'); } $display = '<input class="datepicker-db" id="' . $id . '" type="hidden" name="' . $name . '" value="' . $date . '" />'; $display .= '<input id="' . $id . '_text" class="datepicker" type="text" value="' . $formatedDate . '" />'; if ($resetBt) { $display .= '<span class="vmicon vmicon-16-logout icon-nofloat js-date-reset"></span>'; } // If exist exit if ($jDate) { return $display; } $front = 'components/com_virtuemart/assets/'; $document = JFactory::getDocument(); $document->addScriptDeclaration(' jQuery(document).ready( function($) { $(".datepicker").live( "focus", function() { $( this ).datepicker({ changeMonth: true, changeYear: true, ' . $yearRange . ' dateFormat:"' . $jsDateFormat . '", altField: $(this).prev(), altFormat: "yy-mm-dd" }); }); $(".js-date-reset").click(function() { $(this).prev("input").val("' . JText::_('COM_VIRTUEMART_NEVER') . '").prev("input").val("0"); }); }); '); vmJsApi::js('jquery.ui.core', FALSE, '', TRUE); vmJsApi::js('jquery.ui.datepicker', FALSE, '', TRUE); vmJsApi::css('jquery.ui.all', $front . 'css/ui'); $lg = JFactory::getLanguage(); $lang = $lg->getTag(); $existingLang = array("af", "ar", "ar-DZ", "az", "bg", "bs", "ca", "cs", "da", "de", "el", "en-AU", "en-GB", "en-NZ", "eo", "es", "et", "eu", "fa", "fi", "fo", "fr", "fr-CH", "gl", "he", "hr", "hu", "hy", "id", "is", "it", "ja", "ko", "kz", "lt", "lv", "ml", "ms", "nl", "no", "pl", "pt", "pt-BR", "rm", "ro", "ru", "sk", "sl", "sq", "sr", "sr-SR", "sv", "ta", "th", "tj", "tr", "uk", "vi", "zh-CN", "zh-HK", "zh-TW"); if (!in_array($lang, $existingLang)) { $lang = substr($lang, 0, 2); } elseif (!in_array($lang, $existingLang)) { $lang = "en-GB"; } vmJsApi::js('jquery.ui.datepicker-' . $lang, $front . 'js/i18n'); $jDate = TRUE; return $display; }
/** * Start the administrator area table * * The entire administrator area with contained in a table which include the admin ribbon menu * in the left column and the content in the right column. This function sets up the table and * displays the admin menu in the left column. */ static function startAdminArea($vmView, $selectText = 'COM_VIRTUEMART_DRDOWN_AVA2ALL') { if (vRequest::getCmd('format') == 'pdf') { return; } if (vRequest::getCmd('manage', false)) { self::$backEnd = false; } if (self::$vmAdminAreaStarted) { return; } self::$vmAdminAreaStarted = true; $admin = 'administrator/components/com_virtuemart/assets/css'; //loading defaut admin CSS vmJsApi::css('admin_ui', $admin); vmJsApi::css('admin.styles', $admin); vmJsApi::css('toolbar_images', $admin); vmJsApi::css('menu_images', $admin); vmJsApi::css('vtip'); $view = vRequest::getCmd('view', 'virtuemart'); $modalJs = ''; if ($view != 'virtuemart') { vmJsApi::css('chosen'); vmJsApi::css('jquery.fancybox-1.3.4'); vmJsApi::css('ui/jquery.ui.all'); $modalJs = "\$('.modal').fancybox();"; } if ($view != 'virtuemart') { vmJsApi::addJScript('fancybox/jquery.mousewheel-3.0.4.pack', false, false); vmJsApi::addJScript('fancybox/jquery.easing-1.3.pack', false, false); vmJsApi::addJScript('fancybox/jquery.fancybox-1.3.4.pack', false, false); VmJsApi::chosenDropDowns(); } vmJsApi::addJScript('/administrator/components/com_virtuemart/assets/js/jquery.coookie.js'); vmJsApi::addJScript('/administrator/components/com_virtuemart/assets/js/vm2admin.js'); //vmJsApi::addJScript ('vm.accordeon',"",true); $vm2string = "editImage: 'edit image',select_all_text: '" . vmText::_('COM_VIRTUEMART_DRDOWN_SELALL') . "',select_some_options_text: '" . vmText::_($selectText) . "'"; vmJsApi::addJScript('vm.remindTab', "\r\r\n\t\tvar tip_image='" . JURI::root(true) . "/components/com_virtuemart/assets/js/images/vtip_arrow.png';\r\r\n\t\tvar vm2string ={" . $vm2string . "} ;\r\r\n\t\tjQuery( function(\$) {\r\r\n\r\r\n\t\t\tjQuery('dl#system-message').hide().slideDown(400);\r\r\n\t\t\tjQuery('.virtuemart-admin-area .toggler').vm2admin('toggle');\r\r\n\t\t\tjQuery('#admin-ui-menu').vm2admin('accordeon');\r\r\n\t\t\tif ( \$('#admin-ui-tabs').length ) {\r\r\n\t\t\t\t\$('#admin-ui-tabs').vm2admin('tabs',virtuemartcookie);\r\r\n\t\t\t}\r\r\n\t\t\t\$('#content-box [title]').vm2admin('tips',tip_image);\r\r\n\t\t\t" . $modalJs . "\r\r\n\t\t\t\$('.reset-value').click( function(e){\r\r\n\t\t\t\te.preventDefault();\r\r\n\t\t\t\tnone = '';\r\r\n\t\t\t\tjQuery(this).parent().find('.ui-autocomplete-input').val(none);\r\r\n\t\t\t});\r\r\n\t\t});\t"); ?> <!--[if lt IE 9]> <script src="//ie7-js.googlecode.com/svn/version/2.1(beta4)/IE9.js"></script> <![endif]--> <?php if (!self::$backEnd) { //JToolBarHelper $bar = JToolbar::getInstance('toolbar'); ?> <div class="toolbar-box" style="height: 84px;position: relative;"><?php echo $bar->render(); ?> </div> <?php } ?> <?php $hideMenu = JFactory::getApplication()->input->cookie->getString('vmmenu', 'show') === 'hide' ? ' menu-collapsed' : ''; ?> <div class="virtuemart-admin-area<?php echo $hideMenu; ?> "> <div class="toggler vmicon-show<?php echo $hideMenu; ?> "></div> <div class="menu-wrapper<?php echo $hideMenu; ?> " id="menu-wrapper"> <?php if (!empty($vmView->langList)) { ?> <div class="vm-lang-list-container"> <?php echo $vmView->langList; ?> </div> <?php } else { ?> <a href="index.php?option=com_virtuemart&view=virtuemart" ><img src="<?php echo JURI::root(true) . '/administrator/components/com_virtuemart/assets/images/vm_menulogo.png'; ?> "></a> <?php } AdminUIHelper::showAdminMenu($vmView); ?> <div class="vm-installed-version"> VirtueMart <?php echo VmConfig::getInstalledVersion(); ?> </div> </div> <div id="admin-content" class="admin-content"> <?php }
static function store($config, $item) { // Load the language file of com_virtuemart. JFactory::getLanguage()->load('com_virtuemart'); // Load path constant if (!defined('VMPATH_ADMIN')) { define('VMPATH_ADMIN', JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_virtuemart'); } // Load VM configuration if necessary if (!class_exists('VmConfig')) { require JPATH_ROOT . DS . 'administrator' . DS . 'components' . DS . 'com_virtuemart' . DS . 'helpers' . DS . 'config.php'; VmConfig::loadConfig(); } // load necessary classes if (!class_exists('calculationHelper')) { require JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_virtuemart' . DS . 'helpers' . DS . 'calculationh.php'; } if (!class_exists('CurrencyDisplay')) { require JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_virtuemart' . DS . 'helpers' . DS . 'currencydisplay.php'; } if (!class_exists('VirtueMartModelVendor')) { require JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_virtuemart' . DS . 'models' . DS . 'vendor.php'; } if (!class_exists('VmImage')) { require JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_virtuemart' . DS . 'helpers' . DS . 'image.php'; } if (!class_exists('shopFunctionsF')) { require JPATH_SITE . DS . 'components' . DS . 'com_virtuemart' . DS . 'helpers' . DS . 'shopfunctionsf.php'; } if (!class_exists('calculationHelper')) { require JPATH_COMPONENT_SITE . DS . 'helpers' . DS . 'cart.php'; } if (!class_exists('VirtueMartModelProduct')) { JLoader::import('product', JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_virtuemart' . DS . 'models'); } // load the base $productModel = new VirtueMartModelProduct(); $product = $productModel->getProduct($item['id'], 100, true, true, true); $currency = CurrencyDisplay::getInstance(); $price = '<strong>' . $currency->createPriceDiv($config['vm_show_price_type'], '', $product->prices, true) . '</strong>'; if ($config['vm_add_to_cart'] == 1 && JRequest::getCmd('option') != 'com_virtuemart') { vmJsApi::jPrice(); vmJsApi::addJScript('facebox'); vmJsApi::css('facebox'); vmJsApi::writeJS(); } $news_price = '<div>'; // if ($config['vm_show_price_type'] != 'none') { if ($config['vm_display_type'] == 'text_price') { $news_price .= '<span>' . JText::_('MOD_NEWS_PRO_GK5_PRODUCT_PRICE') . ' ' . $price . '</span>'; } else { $news_price .= '<span>' . $price . '</span>'; } } // 'Add to cart' button if ($config['vm_add_to_cart'] == 1) { if (isset($product->customfields) && count($product->customfields)) { foreach ($product->customfields as $field) { if (isset($field->is_cart_attribute) && $field->is_cart_attribute == 1 || isset($field->layout_pos) && $field->layout_pos == 'addtocart') { $product->orderable = 0; break; } } } $code = '<div class="addtocart-area">'; if ($product->orderable != 0) { $code .= '<form method="post" class="product" action="index.php">'; } else { $code .= '<form method="post" class="product-variant" action="' . static::itemLink($item, $config) . '">'; } $code .= '<div class="addtocart-bar">'; $code .= '<span class="quantity-box" style="display: none"><input type="text" class="quantity-input" name="quantity[]" value="1" /></span>'; $addtoCartButton = ''; if ($product->addToCartButton) { $addtoCartButton = $product->addToCartButton; } else { $addtoCartButton = shopFunctionsF::getAddToCartButton($product->orderable); } $code .= str_replace('addtocart-button-disabled"', 'addtocart-button" type="submit"', $addtoCartButton); if ($product->orderable != 0) { $code .= '</div> <input type="hidden" class="pname" value="' . $product->product_name . '"/> <input type="hidden" name="option" value="com_virtuemart" /> <input type="hidden" name="view" value="cart" /> <noscript><input type="hidden" name="task" value="add" /></noscript> <input type="hidden" name="virtuemart_product_id[]" value="' . $product->virtuemart_product_id . '" /> <input type="hidden" name="virtuemart_category_id[]" value="' . $product->virtuemart_category_id . '" /> </form>'; } else { $code .= '</div></form>'; } $code .= '</div>'; $news_price .= $code; } // display discount if ($config['vm_show_discount_amount'] == 1) { $disc_amount = $currency->priceDisplay($product->prices['discountAmount'], $currency->getId()); $news_price .= '<small class="nspDiscount">' . JText::_('MOD_NEWS_PRO_GK5_PRODUCT_DISCOUNT_AMOUNT') . $disc_amount . '</small>'; } // display tax if ($config['vm_show_tax'] == 1) { $taxAmount = $currency->priceDisplay($product->prices['taxAmount'], $currency->getId()); $news_price .= '<small class="nspTax">' . JText::_('MOD_NEWS_PRO_GK5_PRODUCT_TAX_AMOUNT') . $taxAmount . '</small>'; } // results return $news_price != '<div>' ? $news_price . '</div>' : ''; }
/** * Start the administrator area table * * The entire administrator area with contained in a table which include the admin ribbon menu * in the left column and the content in the right column. This function sets up the table and * displays the admin menu in the left column. */ static function startAdminArea($vmView, $selectText = 'com_tsmart_DRDOWN_AVA2ALL') { JHtml::_('jquery.framework'); $doc = JFactory::getDocument(); //JHtml::_('behavior.formvalidator'); JHtml::_('formbehavior.chosen'); JHTML::_('behavior.core'); JHtml::_('jquery.ui'); $doc = JFactory::getDocument(); $doc->addScript(JUri::root() . '/media/system/js/jquery.serializeObject.js'); $doc->addScript(JUri::root() . '/media/jquery-ui-1.11.1/ui/datepicker.js'); $doc->addScript(JUri::root() . '/media/jquery-ui-1.11.1/ui/effect.js'); $doc->addScript(JUri::root() . '/media/jquery-ui-1.11.1/ui/draggable.js'); $doc->addScript(JUri::root() . '/media/jquery-ui-1.11.1/ui/dialog.js'); $doc->addScript(JUri::root() . '/media/jquery-ui-1.11.1/ui/autocomplete.js'); $doc->addStyleSheet(JUri::root() . '/media/jquery-ui-1.11.1/themes/base/core.css'); $doc->addStyleSheet(JUri::root() . '/media/jquery-ui-1.11.1/themes/base/theme.css'); $doc->addStyleSheet(JUri::root() . '/media/jquery-ui-1.11.1/themes/base/dialog.css'); $doc->addStyleSheet(JUri::root() . '/media/jquery-ui-1.11.1/themes/base/datepicker.css'); $doc->addStyleSheet(JUri::root() . '/media/jquery-ui-1.11.1/themes/base/datepicker.css'); $doc->addStyleSheet(JUri::root() . '/media/system/js/datepicker/css/base.css'); $doc->addStyleSheet(JUri::root() . '/media/system/js/datepicker/css/clean.css'); if (vRequest::getCmd('format') == 'pdf') { return; } if (vRequest::getCmd('manage', false)) { self::$backEnd = false; } if (self::$vmAdminAreaStarted) { return; } self::$vmAdminAreaStarted = true; $doc->addLessStyleSheet(JUri::root() . '/administrator/components/com_tsmart/assets/less/admin_ui.less'); $doc->addStyleSheet(JUri::root() . '/administrator/components/com_tsmart/assets/css/icons.css'); $doc->addScript(JUri::root() . '/media/system/js/purl-master/purl-master/purl.js'); $doc->addScript(JUri::root() . '/media/system/js/URI.js-gh-pages/src/URI.js'); $doc->addScript(JUri::root() . '/administrator/components/com_tsmart/assets/js/asianventure.js'); $doc->addLessStyleSheet(JUri::root() . '/administrator/components/com_tsmart/assets/less/asianventure.less'); $admin = 'administrator/components/com_tsmart/assets/css'; $modalJs = ''; //loading defaut admin CSS vmJsApi::css('admin_ui', $admin); vmJsApi::css('admin.styles', $admin); vmJsApi::css('toolbar_images', $admin); vmJsApi::css('menu_images', $admin); vmJsApi::css('vtip'); $view = vRequest::getCmd('view', 'tsmart'); if ($view != 'tsmart') { vmJsApi::css('chosen'); vmJsApi::css('jquery.fancybox-1.3.4'); //vmJsApi::css('ui/jquery.ui.all'); } if ($view != 'tsmart') { vmJsApi::addJScript('fancybox/jquery.mousewheel-3.0.4.pack', false, false); vmJsApi::addJScript('fancybox/jquery.easing-1.3.pack', false, false); vmJsApi::addJScript('fancybox/jquery.fancybox-1.3.4.pack', false, false); VmJsApi::chosenDropDowns(); } $app = JFactory::getApplication(); $input = $app->input; $cid = $input->get('cid', array(), 'array'); $key = $input->get('key', array(), 'array'); $list_key = array(); foreach ($key as $a_key => $item) { $list_key = "{$a_key}={$item}"; } $str_key = ''; if ($list_key != '') { $str_key = '&' . $list_key; } $key_string = ''; $show_edit_in_line = $input->get('show_edit_in_line', 0, 'int'); $hide_toolbar = $input->get('hide_toolbar', 0, 'int'); if ($show_edit_in_line) { $doc->addLessStyleSheet(JUri::root() . '/administrator/components/com_tsmart/assets/less/asianventure-edit-inline.less'); } $tsmart_product_id = $app->input->get('tsmart_product_id', array(), 'array'); $tsmart_product_id = $tsmart_product_id[0]; $uri = JUri::getInstance(); $url = $uri->toString(array('query')); $js_content = ''; ob_start(); ?> <script type="text/javascript"> jQuery(document).ready(function ($) { $('.admin.com_tsmart').asianventure({ show_iframe:<?php echo json_encode(tsmConfig::$show_iframe); ?> , add_new_popup:<?php echo $vmView->add_new_popup == 1 ? 1 : 0; ?> , cid:<?php echo json_encode($cid); ?> , key_string: "<?php echo $str_key; ?> ", url: '<?php echo 'index.php' . $url; ?> ', view: '<?php echo $vmView->getName(); ?> ', }); }); </script> <?php $js_content = ob_get_clean(); require_once JPATH_ROOT . '/administrator/components/com_tsmart/helpers/utility.php'; $js_content = TSMUtility::remove_string_javascript($js_content); $doc->addScriptDeclaration($js_content); vmJsApi::addJScript('/administrator/components/com_tsmart/assets/js/jquery.coookie.js'); vmJsApi::addJScript('/administrator/components/com_tsmart/assets/js/vm2admin.js'); $vm2string = "editImage: 'edit image',select_all_text: '" . tsmText::_('com_tsmart_DRDOWN_SELALL') . "',select_some_options_text: '" . tsmText::_($selectText) . "'"; vmJsApi::addJScript('vm.remindTab', "\n\t\tvar tip_image='" . JURI::root(true) . "/components/com_tsmart/assets/js/images/vtip_arrow.png';\n\t\tvar vm2string ={" . $vm2string . "} ;\n\t\tjQuery( function(\$) {\n\n\t\t\tjQuery('dl#system-message').hide().slideDown(400);\n\t\t\tjQuery('.tsmart-admin-area .toggler').vm2admin('toggle');\n\t\t\tjQuery('#admin-ui-menu').vm2admin('accordeon');\n\t\t\tif ( jQuery('#admin-ui-tabs').length ) {\n\t\t\t\tjQuery('#admin-ui-tabs').vm2admin('tabs',tsmartcookie);\n\t\t\t}\n\t\t\tjQuery('#content-box [title]').vm2admin('tips',tip_image);\n\t\t\tjQuery('.reset-value').click( function(e){\n\t\t\t\te.preventDefault();\n\t\t\t\tnone = '';\n\t\t\t\tjQuery(this).parent().find('.ui-autocomplete-input').val(none);\n\t\t\t});\n\t\t});\t"); ?> <!--[if lt IE 9]> <script src="//ie7-js.googlecode.com/svn/version/2.1(beta4)/IE9.js"></script> <style type="text/css"> .tsmart-admin-area { display: block; } .tsmart-admin-area #menu-wrapper { float: left; } .tsmart-admin-area #admin-content { margin-left: 221px; } < / script > <![endif]--> <?php if (!self::$backEnd) { //JToolBarHelper $bar = JToolbar::getInstance('toolbar'); ?> <div class="toolbar-box" style="height: 84px;position: relative;"><?php echo $bar->render(); ?> </div> <?php } ?> <?php $hideMenu = JFactory::getApplication()->input->cookie->getString('vmmenu', 'show') === 'hide' ? ' menu-collapsed' : ''; ?> <div class="tsmart-admin-area<?php echo $hideMenu; ?> <?php echo $show_edit_in_line ? 'edit-in-line' : ''; ?> "> <div class="div-loading"></div> <?php if ($vmView->add_new_popup == 1) { ?> <div id="vm-edit-form-<?php echo $vmView->getName(); ?> " class="vm-edit-form"> <iframe id="vm-iframe-<?php echo $vmView->getName(); ?> " scrolling="no" src=""></iframe> </div> <?php } ?> <style type="text/css"> .div-loading { display: none; background: url("<?php echo JUri::root(); ?> /global_css_images_js/images/loading.gif") center center no-repeat; position: fixed; z-index: 1000; top: 0; left: 0; height: 100%; width: 100% } </style> <div id="admin-content" class="admin-content container-fluid"> <?php if (!$hide_toolbar) { ?> <div class="row-fluid toolbar-top"> </div> <div class="toolbar-top2"> <div class="content-toolbar-top2"> <div class="row-fluid"> <div class="span6"> <img src="<?php echo JUri::root(); ?> /images/Untitled-10.png"> </div> <div class="span4 offset2"> <h2>ADMIN DASKBOARD</h2> </div> </div> </div> </div> <div class="toolbar-top3"> <div class="content-toolbar-top3"> <div class="row-fluid"> <div class="span5"> <a href="index.html" class="navbar-brand"> <i class="im-windows8 text-logo-element animated bounceIn"></i><span class="text-logo">Asianventure</span> </a> <a title="" class="pull-right tool"> <i class="ec-help"></i> </a> <a title="" class="pull-right tool"> <i class="ec-pencil"></i> </a> <a title="" class="pull-right tool"> <i class="br-grid"></i> </a> <a title="" class="pull-right tool"> <i class="ec-refresh"></i> </a> </div> <div class="span7"> <a title="" class="pull-right tool"> <i class="ec-help"></i> </a> <a title="" class="pull-right tool"> <i class="ec-pencil"></i> </a> <a title="" class="pull-right tool"> <i class="br-grid"></i> </a> <a title="" class="pull-right tool"> <i class="ec-refresh"></i> </a> </div> </div> </div> </div> <div class="toolbar-top5"> <div class="content-toolbar-top5"> <div class="row-fluid"> <div class="span3"> <h1><span title="" class="icon-palette"></span><span style="margin-left: 20px;color: #990100">Tour portal</span> </h1> </div> </div> </div> </div> <?php } ?> <?php $app = JFactory::getApplication(); $view = $app->input->get('view', 'tsmart', 'string'); ?> <?php if ($view == 'tsmart') { echo self::show_tab_home_page($tsmart_product_id); ?> <div class="vm_toolbar"></div> <script> jQuery(document).ready(function ($) { $.fn.vertical_accordian_drop_down_menu_bar('#vertical_accordian_drop_down_menu_bar'); }); </script> <?php } ?> <?php if ($view != 'tsmart') { ?> <?php if (!$hide_toolbar) { ?> <?php if (in_array($view, array('country', 'state', 'cityarea', 'currency', 'language', 'airport'))) { echo self::show_tab_geo($view, $tsmart_product_id); ?> <div class="vm-title tab-geo"> <div class="content-vm-title"> <div class="row-fluid"> <div class="span2 "> <h3 class="title_page pull-left"><?php echo JText::_($vmView->getName()); ?> </h3> </div> </div> </div> </div> <div class="vm_toolbar"></div> <?php } else { echo self::show_tab_default($tsmart_product_id); ?> <div class="vm-title "> <div class="content-vm-title"> <div class="row-fluid"> <div class="span2"> <h3 class="title_page pull-left"><?php echo JText::_($vmView->getName()); ?> </h3> </div> </div> </div> </div> <div class="vm_toolbar"></div> <?php } ?> <?php } ?> <?php } ?> <?php }
* @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>
?> <?php static $jsAWLoaded = false; $doc = JFactory::getDocument(); vmJsApi::jPrice(); jimport('joomla.environment.browser'); $browser = JBrowser::getInstance(); $isMobile = $browser->isMobile(); if ($isMobile) { $doc->setMetaData('viewport', "width=device-width, initial-scale=1, maximum-scale=1"); } if (!$jsAWLoaded) { vmJsApi::addJScript('/plugins/vmpayment/amazon/assets/js/amazon.js'); if ($viewData['include_amazon_css']) { vmJsApi::css('amazon', 'plugins/vmpayment/amazon/assets/css/'); } //vmJsApi::js('plugins/vmpayment/amazon/amazon/assets/js/site', ''); $js = "\njQuery(document).ready( function(\$) {\n\tamazonPayment.initPayment('" . $viewData['sellerId'] . "','" . $viewData['amazonOrderReferenceId'] . "', '" . $viewData['addressbook_designWidth'] . "', '" . $viewData['addressbook_designHeight'] . "', '" . $isMobile . "', '" . $viewData['virtuemart_paymentmethod_id'] . "', '" . $viewData['readOnlyWidgets'] . "');\n});\n"; vmJsApi::addJScript('vm.initAmazonPayment', $js); if ($viewData['renderAddressBook']) { $js = "\njQuery(document).ready( function(\$) {\n\tamazonPayment.showAmazonAddress();\n});\n"; vmJsApi::addJScript('vm.showAmazonAddress', $js); } if ($viewData['renderWalletBook']) { $js = "\njQuery(document).ready( function(\$) {\n\tamazonPayment.showAmazonWallet();\n});\n"; vmJsApi::addJScript('vm.showAmazonWallet', $js); } $js = "\njQuery(document).ready( function(\$) {\n\$('#leaveAmazonCheckout').click(function(){\n\tamazonPayment.leaveAmazonCheckout();\n\t});\n});\n"; vmJsApi::addJScript('vm.leaveAmazonCheckout', $js); if ($viewData['captureNow']) {
function datePicker($jsDateFormat, $name, $id, $date = '', $placeholder = '') { $display = '<input class="datepicker-db" id="' . $id . '" type="hidden" name="' . $name . '" value="' . $date . '" />'; $formatedDate = $date; //JFactory::getDate($date); $display .= '<input id="' . $id . '_text" class="datepicker" type="text" value="' . $formatedDate . '" placeholder="' . $placeholder . '" />'; // If exist exit $front = 'components/com_virtuemart/assets/'; $document = JFactory::getDocument(); $document->addScriptDeclaration(' //<![CDATA[ jQuery(document).ready( function($) { $("#' . $id . '_text").live( "focus", function() { $( this ).datepicker({ changeMonth: true, changeYear: true, dateFormat:"' . $jsDateFormat . '", altField: $(this).prev(), altFormat: "yy-mm-dd" }); }); $(".js-date-reset").click(function() { $(this).prev("input").val("' . $placeholder . '").prev("input").val("0"); }); }); //]]> '); vmJsApi::js('jquery.ui.core', FALSE, '', TRUE); vmJsApi::js('jquery.ui.datepicker', FALSE, '', TRUE); vmJsApi::css('jquery.ui.all', $front . 'css/ui'); $lg = JFactory::getLanguage(); $lang = $lg->getTag(); $existingLang = array("af", "ar", "ar-DZ", "az", "bg", "bs", "ca", "cs", "da", "de", "el", "en-AU", "en-GB", "en-NZ", "eo", "es", "et", "eu", "fa", "fi", "fo", "fr", "fr-CH", "gl", "he", "hr", "hu", "hy", "id", "is", "it", "ja", "ko", "kz", "lt", "lv", "ml", "ms", "nl", "no", "pl", "pt", "pt-BR", "rm", "ro", "ru", "sk", "sl", "sq", "sr", "sr-SR", "sv", "ta", "th", "tj", "tr", "uk", "vi", "zh-CN", "zh-HK", "zh-TW"); if (!in_array($lang, $existingLang)) { $lang = substr($lang, 0, 2); } elseif (!in_array($lang, $existingLang)) { $lang = "en-GB"; } vmJsApi::js('jquery.ui.datepicker-' . $lang, $front . 'js/i18n'); return $display; }
ext = href.substring(href.length-4), isImg ; ext = ext.toLowerCase(); isImg = (ext ==".png" || ext ==".jpg" || ext =="jpeg" || ext ==".gif"); if (isImg) { main.find("img").attr("src",this.href ).attr("alt",this.title ); main.find("a").attr("href",this.href ).attr("alt",this.title ); $(this).parent().addClass("active").siblings().removeClass("active"); return false; } }); '; if ($isSlide) { vmJsApi::js('jquery.lightSlider.min'); vmJsApi::css('lightSlider'); $imageJS .= ' var $slideBar = $(".additional-images .row-fluid"); var lightSlider = $slideBar.lightSlider({ minSlide:' . $imgagesPerRow . ', maxSlide:' . $imgagesPerRow . ', slideMove:' . $imgagesPerRow . ', pager:false, gallery:true, prevHtml:\'<span class="icon-previous"></span>\', nextHtml:\'<span class="icon-next"></span>\', onAfterSlide: function() { $slideBar.children(".active").children().trigger("click"); // console.log($slideBar.children(".active"),this); }
* @package VirtueMart * @subpackage payment * @copyright Copyright (C) 2004-Copyright (C) 2004-2014 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"; vmJsApi::css($css); /* $js = ' jQuery(document).ready(function( $ ) { $("#checkoutForm").hide(); }); '; */ if ($viewData ['hide_BTST']) { $js .= ' jQuery(document).ready(function( $ ) { $(".billto-shipto").hide(); $("#com-form-login").hide(); }); ';
/** * ADD some CSS if needed * Prevent duplicate load of CSS stylesheet * @author Max Milbers */ static function cssSite() { if (!tsmConfig::get('css', TRUE)) { return FALSE; } static $cssSite; if ($cssSite) { return; } // Get the Page direction for right to left support $document = JFactory::getDocument(); $direction = $document->getDirection(); $cssFile = 'vmsite-' . $direction; if (!class_exists('VmTemplate')) { require VMPATH_SITE . DS . 'helpers' . DS . 'vmtemplate.php'; } $vmStyle = VmTemplate::loadVmTemplateStyle(); $template = $vmStyle['template']; if ($template) { //Fallback for old templates $path = 'templates' . DS . $template . DS . 'css' . DS . $cssFile . '.css'; if (file_exists($path)) { // If exist exit vmJsApi::css($cssFile); } else { $cssFile = 'vm-' . $direction . '-common'; vmJsApi::css($cssFile); $cssFile = 'vm-' . $direction . '-site'; vmJsApi::css($cssFile); $cssFile = 'vm-' . $direction . '-reviews'; vmJsApi::css($cssFile); } $cssSite = TRUE; } return TRUE; }
} VmConfig::loadConfig(); if (method_exists('vmJsApi', 'js')) { $app = JFactory::getApplication(); $jq = $app->get('jquery'); if (empty($jq) && !OPCJ3) { vmJsApi::js('jquery', '//ajax.googleapis.com/ajax/libs/jquery/1.6.4', '', TRUE); vmJsApi::js('jquery-ui', '//ajax.googleapis.com/ajax/libs/jqueryui/1.8.16', '', TRUE); } if (OPCJ3) { JHtml::_('jquery.framework'); JHtml::_('jquery.ui'); JHtml::_('formbehavior.chosen', 'select'); } else { vmJsApi::js('chosen.jquery.min'); vmJsApi::css('chosen'); } $document->addScriptDeclaration(' //<![CDATA[ var vm2string ={' . $vm2string . '} ; jQuery( function($) { $(".vm-chzn-select").chosen({enable_select_all: true,select_all_text : vm2string.select_all_text,select_some_options_text:vm2string.select_some_options_text}); }); //]]> '); } else { vmJsApi::jQuery(); } $base = JURI::base(); $jbase = str_replace('/administrator', '', $base); if (substr($jbase, -1) !== '/') {
* @subpackage * @author Max Milbers, Valerie Isaksen * @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. * @version $Id: default_images.php 6188 2012-06-29 09:38:30Z Milbo $ */ // Check to ensure this file is included in Joomla! defined('_JEXEC') or die('Restricted access'); vmJsApi::js( 'fancybox/jquery.fancybox-1.3.4.pack'); vmJsApi::css('jquery.fancybox-1.3.4'); $document = JFactory::getDocument (); $imageJS = ' jQuery(document).ready(function() { jQuery("a[rel=vm-additional-images]").fancybox({ "titlePosition" : "inside", "transitionIn" : "elastic", "transitionOut" : "elastic" }); jQuery(".additional-images .product-image").click(function() { jQuery(".main-image img").attr("src",this.src ); jQuery(".main-image img").attr("alt",this.alt ); jQuery(".main-image a").attr("href",this.src ); jQuery(".main-image a").attr("title",this.alt ); }); });
static function jDate($date = '', $name = "date", $id = NULL, $resetBt = TRUE, $yearRange = '') { if ($yearRange) { $yearRange = 'yearRange: "' . $yearRange . '",'; } $test = (int) str_replace(array('-', ' ', ':'), '', $date); if (empty($test)) { $date = 0; } if (empty($id)) { $id = str_replace(array('[]', '[', ']'), '.', $name); $id = str_replace('..', '.', $id); } static $jDate; if (!class_exists('VmHtml')) { require VMPATH_ADMIN . DS . 'helpers' . DS . 'html.php'; } $id = VmHtml::ensureUniqueId($id); $dateFormat = vmText::_('COM_VIRTUEMART_DATE_FORMAT_INPUT_J16'); //="m/d/y" $search = array('m', 'd', 'Y'); $replace = array('mm', 'dd', 'yy'); $jsDateFormat = str_replace($search, $replace, $dateFormat); if ($date) { $formatedDate = JHtml::_('date', $date, $dateFormat); } else { $formatedDate = vmText::_('COM_VIRTUEMART_NEVER'); } $display = '<input class="datepicker-db" id="' . $id . '" type="hidden" name="' . $name . '" value="' . $date . '" />'; $display .= '<input id="' . $id . '_text" class="datepicker" type="text" value="' . $formatedDate . '" />'; if ($resetBt) { $display .= '<span class="vmicon vmicon-16-logout icon-nofloat js-date-reset"></span>'; } // If exist exit if ($jDate) { return $display; } self::addJScript('datepicker', ' jQuery(document).ready( function($) { jQuery(document).on( "focus",".datepicker", function() { jQuery( this ).datepicker({ changeMonth: true, changeYear: true, ' . $yearRange . ' dateFormat:"' . $jsDateFormat . '", altField: $(this).prev(), altFormat: "yy-mm-dd" }); }); jQuery(document).on( "click",".js-date-reset", function() { jQuery(this).prev("input").val("' . vmText::_('COM_VIRTUEMART_NEVER') . '").prev("input").val("0"); }); }); '); vmJsApi::css('ui/jquery.ui.all'); $lg = JFactory::getLanguage(); $lang = $lg->getTag(); $vlePath = vmJsApi::setPath('i18n/jquery.ui.datepicker-' . $lang, FALSE, '', $minified = NULL, 'js', true); if (!file_exists($vlePath) or is_dir($vlePath)) { $lang = 'en-GB'; } vmJsApi::addJScript('i18n/jquery.ui.datepicker-' . $lang); $jDate = TRUE; return $display; }
public static function getUserInfoST(&$ref, &$OPCloader) { include JPATH_ROOT . DS . 'components' . DS . 'com_onepage' . DS . 'config' . DS . 'onepage.cfg.php'; if (empty($ref->cart)) { $ref->cart = VirtueMartCart::getCart(); } //$ref->cart->ST = 0; if (method_exists($ref->cart, 'prepareAddressDataInCart')) { $ref->cart->prepareAddressDataInCart('ST', 1); } if (method_exists($ref->cart, 'prepareAddressFieldsInCart')) { $ref->cart->prepareAddressFieldsInCart(); } if (!empty($ref->cart->ST)) { $STaddress = $ref->cart->STaddress['fields']; foreach ($STaddress as $k => $val) { $kk = str_replace('shipto_', '', $STaddress[$k]['name']); if (empty($STaddress[$k]['value']) && !empty($ref->cart->ST) && !empty($ref->cart->ST[$kk])) { $STaddress[$k]['value'] = $ref->cart->ST[$kk]; } $STaddress[$k]['value'] = trim($STaddress[$k]['value']); if ($val['name'] == 'agreed') { unset($STaddress[$k]); } } $STnamed = $STaddress; $STnamed = $OPCloader->setCountryAndState($STnamed); } else { $STaddress = array(); } //$bt_user_info = $ref->cart->BTaddress->user_infoid; /* if (!class_exists('VirtuemartModelUser')) require(JPATH_VM_ADMINISTRATOR . DS . 'models' . DS . 'user.php'); */ require_once JPATH_ROOT . DS . 'components' . DS . 'com_onepage' . DS . 'helpers' . DS . 'mini.php'; $umodel = OPCmini::getModel('user'); //new VirtuemartModelUser(); $virtuemart_userinfo_id = 0; $currentUser = JFactory::getUser(); $uid = $currentUser->get('id'); $userDetails = $umodel->getUser(); $virtuemart_userinfo_id = $umodel->getBTuserinfo_id(); $userFields = $umodel->getUserInfoInUserFields('default', 'BT', $virtuemart_userinfo_id); /* if (empty($userFields[$virtuemart_userinfo_id])) $virtuemart_userinfo_id = $umodel->getBTuserinfo_id(); else $virtuemart_userinfo_id = $userFields[$virtuemart_userinfo_id]; */ //$id = $umodel->getId(); if (empty($virtuemart_userinfo_id)) { return false; } $STaddressList = $umodel->getUserAddressList($uid, 'ST'); $STaddressListOrig = $STaddressList; $addressCount = count($STaddressListOrig); if ($addressCount > 10) { $addressCountAjax = true; } else { $addressCountAjax = false; } // getUserAddressList uses references/pointers for it's objects, therefore we need to create a copy manually: /* if (false) { $STaddressListOrig = array(); if (!empty($STaddressList)) foreach ($STaddressList as $k => $v) { foreach ($v as $n=>$r) { $STaddressListOrig[$k]->$n = $r; } } } */ if (isset($ref->cart->STaddress['fields'])) { $BTaddress = $ref->cart->STaddress['fields']; } else { $BTaddress = $ref->cart->BTaddress['fields']; } if (!empty($ref->cart->savedST)) { foreach ($STaddressList as $key2 => $adr2) { foreach ($ref->cart->savedST as $key => $val) { foreach ($adr2 as $keya => $vala) { if ($keya == $key) { if ($val == $vala) { if (!isset($bm[$key2])) { $bm[$key2] = 0; } $bm[$key2]++; } } } } } $largest = 0; $largest_key = 0; if (!empty($bm)) { foreach ($bm as $key => $bc) { if ($bc >= $largest) { $largest = $bc; $largest_key = $key; } } } if (!empty($largest)) { $selected_id = $STaddressList[$largest_key]->virtuemart_userinfo_id; } } $x = VmVersion::$RELEASE; $useSSL = VmConfig::get('useSSL', 0); foreach ($STaddressList as $ke => $address) { $STaddressList[$ke] = $OPCloader->setCountryAndState($STaddressList[$ke]); if (empty($address->address_type_name)) { $address->address_type_name = OPCLang::_('COM_VIRTUEMART_USER_FORM_ADDRESS_LABEL'); //$address->address_type_name = OPCLang::_('JACTION_EDIT'); } $link = self::getEditLink($uid, $address->virtuemart_userinfo_id); $STaddressList[$ke]->edit_link = $link; } $new_address_link = '#" onclick="return Onepage.op_showEditST();'; //version_compare( //vm204: index.php?option=com_virtuemart&view=user&task=editaddresscart&new=1&addrtype=ST&cid[]=51 // don't use ST if (empty($only_one_shipping_address)) { $arr = array('virtuemart_userinfo_id' => $virtuemart_userinfo_id, 'STaddressList' => $STaddressList); $html3 = $OPCloader->fetch($OPCloader, 'list_select_address.tpl', $arr); $bm = array(); if (empty($html3)) { //theme file not found, please create or copy /overrides/list_select_address.tpl.php to your theme directory if (!$addressCountAjax) { $html3 = '<select class="opc_st_select" name="ship_to_info_id" id="id' . $virtuemart_userinfo_id . '" onchange="return Onepage.changeST(this);" >'; } else { if (defined('OPC_DETECTED_DEVICE') && OPC_DETECTED_DEVICE != 'DESKTOP') { $nochosen = true; } else { $nochosen = false; } if ($nochosen) { $html3 = '<select class="opc_st_select" name="ship_to_info_id" id="id' . $virtuemart_userinfo_id . '" onchange="return Onepage.changeSTajax(this);" >'; } else { $html3 = '<select class="opc-chzn-select opc_st_select" name="ship_to_info_id" id="id' . $virtuemart_userinfo_id . '" onchange="return Onepage.changeSTajax(this);" >'; } } $html3 .= '<option value="' . $virtuemart_userinfo_id . '">' . OPCLang::_('COM_VIRTUEMART_USER_FORM_ST_SAME_AS_BT') . '</option>'; foreach ($STaddressList as $stlist) { $html3 .= '<option value="' . $stlist->virtuemart_userinfo_id . '">'; if (!empty($stlist->address_type_name)) { $html3 .= $stlist->address_type_name; } if (isset($stlist->address_1)) { $html3 .= ',' . $stlist->address_1; } if (isset($stlist->city)) { $html3 .= ',' . $stlist->city; } $html3 .= '</option>'; } $html3 .= '<option value="new">' . OPCLang::_('COM_VIRTUEMART_USER_FORM_ADD_SHIPTO_LBL') . '</option>'; $html3 .= '</select>'; } if (!empty($selected_id)) { $html3 = str_replace('value="' . $selected_id . '"', 'value="' . $selected_id . '" selected="selected" ', $html3); } $html3 .= '<input type="hidden" name="sa" id="sachone" value="" />'; } else { // load single_shipping_address.tpl.php if (!empty($STaddressList)) { $adr1 = reset($STaddressListOrig); foreach ($adr1 as $k => $v) { $ada[$k] = $v; $ada['shipto_' . $k] = $v; } $ref->cart->ST = $ada; } else { $ref->cart->ST = 0; } if (!empty($ref->cart->ST['virtuemart_country_id'])) { $dc = $ref->cart->ST['virtuemart_country_id']; } else { $dc = OPCloader::getDefaultCountry($ref->cart, true); } $htmlsingle = $OPCloader->getSTfields($ref, true, false, $dc); if (!empty($adr1)) { $htmlsingle .= '<input type="hidden" name="shipto_logged" value="' . $adr1->virtuemart_userinfo_id . '" />'; } else { $htmlsingle .= '<input type="hidden" name="shipto_logged" value="new" />'; } // a default BT address $htmlbt = '<input type="hidden" name="ship_to_info_id_bt" id="ship_to_info_id_bt" value="' . $virtuemart_userinfo_id . '" class="stradio"/>'; $htmlsingle .= $htmlbt; $ref->cart->ST = 0; return $htmlsingle; // end of load single shipping address for a logged in user } $i = 2; $BTaddressNamed = $BTaddress; $BTaddressNamed = $OPCloader->setCountryAndState($BTaddressNamed); if (!empty($STaddressList) && empty($htmlsingle)) { if (!$addressCountAjax) { foreach ($STaddressListOrig as $ind => $adr1) { $html2 = self::renderNamed($BTaddressNamed, $adr1, $ref->cart, $OPCloader, $virtuemart_userinfo_id); } } else { // we have a problem, the too many addresses will cause a memory leak, therefore we load them over ajax } } // add a new address: if (empty($htmlsingle)) { $ref->cart->ST = 0; $dc = OPCloader::getDefaultCountry($ref->cart, true); $html22 = $OPCloader->getSTfields($ref, true, true, $dc); $html22 .= '<input type="hidden" name="shipto_logged" value="new" />'; //$html2 .= '<div id="hidden_st_" style="display: none;">'.$html22.'</div>'; $html22 = str_replace('id="', 'id="REPLACEnewREPLACE', $html22); $html22 = str_replace('name="', 'name="REPLACEnewREPLACE', $html22); $html22 = '<div id="hidden_st_new" style="display: none;">' . $html22 . '<div id="opc_st_new"> </div><input type="hidden" name="opc_st_changed_new" id="opc_st_changed_new" value="1" /></div>'; if (!isset(OPCloader::$extrahtml)) { OPCloader::$extrahtml = ''; } OPCloader::$extrahtml .= $html22; $html22 = ''; if (!isset($html2)) { $html2 = ''; } } else { $html2 = ''; } $ref->cart->ST = 0; $STnamed = $STaddress; $STnamed = $OPCloader->setCountryAndState($STnamed); $vars = array('STaddress' => $STnamed, 'bt_user_info_id' => $virtuemart_userinfo_id, 'BTaddress' => $BTaddress, 'STaddressList' => $STaddressList, 'uid' => $uid, 'cart' => $ref->cart, 'new_address_link' => $new_address_link); // a default BT address $htmlbt = '<input type="hidden" name="ship_to_info_id_bt" id="ship_to_info_id_bt" value="' . $virtuemart_userinfo_id . '" class="stradio"/>'; $html2 .= '<div id="hidden_st_' . $virtuemart_userinfo_id . '" style="display: none;">' . $htmlbt . '</div>'; //$ref->cart->STaddress = $STaddress; //$ref->cart->BTaddress = $BTaddress; if (empty($html3) && empty($htmlsingle)) { $html = $OPCloader->fetch($OPCloader, 'list_shipto_addresses.tpl', $vars); } else { $html = ''; } //if (!empty($html) && (!empty($html2))) if (!empty($html2)) { $html = $html3 . '<div id="edit_address_list_st_section">' . $html . '</div>' . $html2; } foreach ($STaddressList as $ST) { $html = str_replace('for="' . $ST->virtuemart_userinfo_id . '"', ' for="id' . $ST->virtuemart_userinfo_id . '" ', $html); $html = str_replace('id="' . $ST->virtuemart_userinfo_id . '"', ' id="id' . $ST->virtuemart_userinfo_id . '" onclick="javascript:Onepage.op_runSS(this);" ', $html); } $html = str_replace('for="' . $virtuemart_userinfo_id . '"', ' for="id' . $virtuemart_userinfo_id . '" ', $html); $html = str_replace('id="' . $virtuemart_userinfo_id . '"', ' id="id' . $virtuemart_userinfo_id . '" onclick="javascript:Onepage.op_runSS(this);" ', $html); if (!empty($selected_id)) { $jsst = ' //<![CDATA[ if (typeof jQuery != \'undefined\') jQuery(document).ready(function($) { var elst = document.getElementById(\'id' . $virtuemart_userinfo_id . '\'); if (elst != null) { '; if ($addressCountAjax) { $jsst .= ' Onepage.changeSTajax(elst); '; } else { $jsst .= ' Onepage.changeST(elst); '; } $jsst .= ' } }); //]]> '; $doc = JFactory::getDocument(); $doc->addScriptDeclaration($jsst); } if (defined('OPC_DETECTED_DEVICE') && OPC_DETECTED_DEVICE != 'DESKTOP') { $nochosen = true; } else { $nochosen = false; } if (!$nochosen) { if ($addressCountAjax) { if (OPCJ3) { JHtml::_('jquery.framework'); JHtml::_('jquery.ui'); JHtml::_('formbehavior.chosen', 'select'); } else { vmJsApi::js('chosen.jquery.min'); vmJsApi::css('chosen'); } $document = JFactory::getDocument(); $document->addScriptDeclaration(' //<![CDATA[ if (typeof jQuery != \'undefined\') jQuery( function() { var d = jQuery(".opc-chzn-select"); if (typeof d.chosen != \'undefined\') d.chosen({ enable_select_all: false, }); }); //]]> '); } } return $html; }
* @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"]); ?>
* 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://tsmart.net */ defined('_JEXEC') or die; $ccData = $viewData['ccData']; JHTML::_('behavior.tooltip'); JHTML::script('vmcreditcard.js', 'components/com_virtuemart/assets/js/', false); tsmConfig::loadJLang('com_virtuemart', true); vmJsApi::jCreditCard(); vmJsApi::jQuery(); vmJsApi::chosenDropDowns(); vmJsApi::addJScript('/plugins/vmpayment/realex_hpp_api/realex_hpp_api/assets/js/site.js'); vmJsApi::css('realex', 'plugins/vmpayment/realex_hpp_api/realex_hpp_api/assets/css/'); vmJsApi::addJScript('vmRealexSumit', "\n\n\tjQuery(document).ready(function(\$) {\n\tjQuery(this).vm2front('stopVmLoading');\n\tjQuery('#checkoutRealexFormSubmitButton').bind('click dblclick', function(e){\n\tjQuery(this).vm2front('startVmLoading');\n\te.preventDefault();\n jQuery(this).attr('disabled', 'true');\n jQuery(this).removeClass( 'vm-button-correct' );\n jQuery(this).addClass( 'vm-button' );\n jQuery('#checkoutRealexFormSubmit').submit();\n\n});\n\n\t});\n\n"); $attribute = ''; if ($viewData['dccinfo']) { $attribute = ' readonly '; } ?> <div class="realex remote_cc_form" id="remote_cc_form"> <h3 class="order_amount"><?php echo $viewData['order_amount']; ?> </h3> <div class="cc_form_payment_name"> <?php
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">
/** * * * @author Valérie Isaksen */ function plgVmConfirmedOrder($cart, $order) { if (!($method = $this->getVmPluginMethod($order['details']['BT']->virtuemart_paymentmethod_id))) { return null; // Another method was selected, do nothing } if (!$this->selectedThisElement($method->payment_element)) { return false; } $this->order_id = $order['details']['BT']->order_number; $url = JURI::root(); vmJsApi::js('facebox'); vmJsApi::css('facebox'); // carrega os js e css $doc =& JFactory::getDocument(); $url_lib = $url . DS . 'plugins' . DS . 'vmpayment' . DS . 'moip' . DS; $url_js = $url_lib . 'assets' . DS . 'js' . DS; $this->url_imagens = $url_lib . 'imagens' . DS; $url_css = $url_lib . 'assets' . DS . 'css' . DS; // redirecionar dentro do componente para validar $url_redireciona_moip = JROUTE::_(JURI::root() . 'index.php?option=com_virtuemart&view=pluginresponse&task=pluginnotification&tmpl=component&pm=' . $order['details']['BT']->virtuemart_paymentmethod_id); $url_pedidos = JROUTE::_(JURI::root() . 'index.php?option=com_virtuemart&view=orders'); $url_recibo_moip = JROUTE::_(JURI::root() . 'index.php?option=com_virtuemart&view=pluginresponse&task=pluginresponsereceived&on=' . $this->order_id . '&pm=' . $order['details']['BT']->virtuemart_paymentmethod_id); // carrega ou não o squeezebox $load_squeezebox = $method->load_squeezebox; $sq_js = '<script type="text/javascript" language="javascript" src="' . $url_js . 'SqueezeBox.js"></script>'; $sq_css = '<link href="' . $url_css . 'SqueezeBox.css" rel="stylesheet" type="text/css"/>'; $doc->addCustomTag(' <script language="javascript"> jQuery.noConflict(); var redireciona_moip = "' . $url_redireciona_moip . '"; var url_pedidos = "' . $url_pedidos . '"; var url_recibo_moip = "' . $url_recibo_moip . '"; </script> <script type="text/javascript" language="javascript" src="' . $url_js . 'jquery.mask.js"></script> <script type="text/javascript" charset="utf-8" language="javascript" src="' . $url_js . 'moip.js"></script> <script type="text/javascript" language="javascript" src="' . $url_js . 'jquery.card.js"></script> <script type="text/javascript" language="javascript" src="' . $url_js . 'validar_cartao.js"></script> ' . ($load_squeezebox != 0 ? $sq_js : '') . ' <link href="' . $url_css . 'css_pagamento.css" rel="stylesheet" type="text/css"/> <link href="' . $url_css . 'card.css" rel="stylesheet" type="text/css"/> ' . ($load_squeezebox != 0 ? $sq_css : '') . ' '); $lang = JFactory::getLanguage(); $filename = 'com_virtuemart'; $lang->load($filename, JPATH_ADMINISTRATOR); $vendorId = 0; $this->logInfo('plgVmConfirmedOrder order number: ' . $order['details']['BT']->order_number, 'message'); $html = ""; if (!class_exists('VirtueMartModelOrders')) { require JPATH_VM_ADMINISTRATOR . DS . 'models' . DS . 'orders.php'; } $this->getPaymentCurrency($method); $q = 'SELECT `currency_code_3` FROM `#__virtuemart_currencies` WHERE `virtuemart_currency_id`="' . $method->payment_currency . '" '; $db =& JFactory::getDBO(); $db->setQuery($q); $currency_code_3 = $db->loadResult(); $paymentCurrency = CurrencyDisplay::getInstance($method->payment_currency); $totalInPaymentCurrency = round($paymentCurrency->convertCurrencyTo($method->payment_currency, $order['details']['BT']->order_total, false), 2); $cd = CurrencyDisplay::getInstance($cart->pricesCurrency); // pega o nome do método de pagamento $dbValues['payment_name'] = $this->renderPluginName($method); $html = '<table>' . "\n"; $html .= $this->getHtmlRowBE('MOIP_PAYMENT_NAME', $dbValues['payment_name']); if (!empty($payment_info)) { $lang =& JFactory::getLanguage(); if ($lang->hasKey($method->payment_info)) { $payment_info = JText::_($method->payment_info); } else { $payment_info = $method->payment_info; } $html .= $this->getHtmlRowBE('MOIP_INFO', $payment_info); } if (!class_exists('VirtueMartModelCurrency')) { require JPATH_VM_ADMINISTRATOR . DS . 'models' . DS . 'currency.php'; } $currency = CurrencyDisplay::getInstance('', $order['details']['BT']->virtuemart_vendor_id); $html .= $this->getHtmlRowBE('MOIP_ORDER_NUMBER', $order['details']['BT']->order_number); $html .= $this->getHtmlRowBE('MOIP_AMOUNT', $currency->priceDisplay($order['details']['BT']->order_total)); $html .= ' <input type="hidden" name="order_id" id="order_id" value="' . $order['details']['BT']->order_number . '"/> </table>' . "\n"; $this->chave_moip = $this->getChaveMoip($method); $this->token_moip = $this->getAfiliacaoMoip($method); if ($method->modo_teste) { // url do ambiente de desenvolvimento $this->setaUrlRequest('https://desenvolvedor.moip.com.br/sandbox/ws/alpha/EnviarInstrucao/Unica'); $this->setaUrlJs('https://desenvolvedor.moip.com.br/sandbox/transparente/MoipWidget-v2.js'); } else { // url do ambiente de produção $this->setaUrlRequest('https://www.moip.com.br/ws/alpha/EnviarInstrucao/Unica'); $this->setaUrlJs('https://www.moip.com.br/transparente/MoipWidget-v2.js'); } $arr_pagamento = $this->solicitaToken($method, $order); $this->_virtuemart_paymentmethod_id = $order['details']['BT']->virtuemart_paymentmethod_id; $dbValues['order_number'] = $order['details']['BT']->order_number; $dbValues['virtuemart_paymentmethod_id'] = $this->_virtuemart_paymentmethod_id; $dbValues['cost_per_transaction'] = $method->cost_per_transaction; $dbValues['cost_percent_total'] = $method->cost_percent_total; $dbValues['payment_currency'] = $currency_code_3; $dbValues['payment_order_total'] = $totalInPaymentCurrency; $dbValues['tax_id'] = $method->tax_id; $dbValues['token_api'] = (string) $arr_pagamento['token']; $this->storePSPluginInternalData($dbValues); // grava os dados do pagamento //$this->gravaDados($method,0,$arr_pagamento['status']); if ($arr_pagamento['status'] == "Sucesso") { $this->token_api = $arr_pagamento['token']; $this->erro_api = $arr_pagamento['erro']; // monta o formulário na ultima página $html .= $this->Moip_mostraParcelamento($method, $order); JFactory::getApplication()->enqueueMessage(utf8_encode(JText::_('VMPAYMENT_MOIP_ORDER_OK'))); // envia emails e redireciona $novo_status = $method->transacao_nao_finalizada; return $this->processConfirmedOrderPaymentResponse(1, $cart, $order, $html, $dbValues['payment_name'], $novo_status); } else { $this->token_api = null; $this->erro_api = $arr_pagamento['erro']; JFactory::getApplication()->enqueueMessage(utf8_encode($this->erro_api), 'error'); return false; } }