本文整理汇总了PHP中vmJsApi::jDynUpdate方法的典型用法代码示例。如果您正苦于以下问题:PHP vmJsApi::jDynUpdate方法的具体用法?PHP vmJsApi::jDynUpdate怎么用?PHP vmJsApi::jDynUpdate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类vmJsApi
的用法示例。
在下文中一共展示了vmJsApi::jDynUpdate方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: displayJSSnippet
/**
* @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;
}
示例2: display
//.........这里部分代码省略.........
$this->currencyDisplay = CurrencyDisplay::getInstance($this->cart->pricesCurrency);
$customfieldsModel = VmModel::getModel('Customfields');
$this->assignRef('customfieldsModel', $customfieldsModel);
$this->lSelectCoupon();
$totalInPaymentCurrency = $this->getTotalInPaymentCurrency();
$this->checkoutAdvertise = $this->cart->getCheckoutAdvertise();
if ($this->cart->getDataValidated()) {
if ($this->cart->_inConfirm) {
$pathway->addItem(vmText::_('COM_VIRTUEMART_CANCEL_CONFIRM_MNU'));
$document->setTitle(vmText::_('COM_VIRTUEMART_CANCEL_CONFIRM_MNU'));
$text = vmText::_('COM_VIRTUEMART_CANCEL_CONFIRM');
$this->checkout_task = 'cancel';
} else {
$pathway->addItem(vmText::_('COM_VIRTUEMART_ORDER_CONFIRM_MNU'));
$document->setTitle(vmText::_('COM_VIRTUEMART_ORDER_CONFIRM_MNU'));
$text = vmText::_('COM_VIRTUEMART_ORDER_CONFIRM_MNU');
$this->checkout_task = 'confirm';
}
} else {
$pathway->addItem(vmText::_('COM_VIRTUEMART_CART_OVERVIEW'));
$document->setTitle(vmText::_('COM_VIRTUEMART_CART_OVERVIEW'));
$text = vmText::_('COM_VIRTUEMART_CHECKOUT_TITLE');
$this->checkout_task = 'checkout';
}
$dynUpdate = '';
if (VmConfig::get('oncheckout_ajax', false)) {
$dynUpdate = ' data-dynamic-update="1" ';
}
$this->checkout_link_html = '<button type="submit" id="checkoutFormSubmit" name="' . $this->checkout_task . '" value="1" class="vm-button-correct" ' . $dynUpdate . ' ><span>' . $text . '</span> </button>';
if (VmConfig::get('oncheckout_opc', 1)) {
if (!class_exists('vmPSPlugin')) {
require JPATH_VM_PLUGINS . DS . 'vmpsplugin.php';
}
JPluginHelper::importPlugin('vmshipment');
JPluginHelper::importPlugin('vmpayment');
//vmdebug('cart view oncheckout_opc ');
$lSelectShipment = $this->lSelectShipment();
$lSelectPayment = $this->lSelectPayment();
if (!$lSelectShipment or !$lSelectPayment) {
if (!VmConfig::get('oncheckout_opc', 1)) {
vmInfo('COM_VIRTUEMART_CART_ENTER_ADDRESS_FIRST');
}
$this->pointAddress = true;
}
} else {
$this->checkPaymentMethodsConfigured();
$this->checkShipmentMethodsConfigured();
}
if ($this->cart->virtuemart_shipmentmethod_id) {
$shippingText = vmText::_('COM_VIRTUEMART_CART_CHANGE_SHIPPING');
} else {
$shippingText = vmText::_('COM_VIRTUEMART_CART_EDIT_SHIPPING');
}
$this->assignRef('select_shipment_text', $shippingText);
if ($this->cart->virtuemart_paymentmethod_id) {
$paymentText = vmText::_('COM_VIRTUEMART_CART_CHANGE_PAYMENT');
} else {
$paymentText = vmText::_('COM_VIRTUEMART_CART_EDIT_PAYMENT');
}
$this->assignRef('select_payment_text', $paymentText);
$this->cart->prepareAddressFieldsInCart();
$this->layoutName = $this->cart->layout;
if (empty($this->layoutName)) {
$this->layoutName = 'default';
}
if ($this->cart->layoutPath) {
$this->addTemplatePath($this->cart->layoutPath);
}
if (!empty($this->layoutName) and $this->layoutName != 'default') {
$this->setLayout(strtolower($this->layoutName));
}
//set order language
$lang = JFactory::getLanguage();
$order_language = $lang->getTag();
$this->assignRef('order_language', $order_language);
}
}
}
$this->useSSL = VmConfig::get('useSSL', 0);
$this->useXHTML = false;
$this->assignRef('totalInPaymentCurrency', $totalInPaymentCurrency);
//We never want that the cart is indexed
$document->setMetaData('robots', 'NOINDEX, NOFOLLOW, NOARCHIVE, NOSNIPPET');
if ($this->cart->_inConfirm) {
vmInfo('COM_VIRTUEMART_IN_CONFIRM');
}
$current = JFactory::getUser();
$this->allowChangeShopper = false;
$this->adminID = false;
if (VmConfig::get('oncheckout_change_shopper')) {
$this->allowChangeShopper = vmAccess::manager('user');
}
if ($this->allowChangeShopper) {
$this->userList = $this->getUserList();
}
if (VmConfig::get('oncheckout_ajax', false)) {
vmJsApi::jDynUpdate();
}
parent::display($tpl);
}
示例3: defined
* 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.php 8661 2015-01-23 11:36:23Z Milbo $
*/
// Check to ensure this file is included in Joomla!
defined('_JEXEC') or die('Restricted access');
/* Let's see if we found the product */
if (empty($this->product)) {
echo vmText::_('COM_VIRTUEMART_PRODUCT_NOT_FOUND');
echo '<br /><br /> ' . $this->continue_link_html;
return;
}
echo shopFunctionsF::renderVmSubLayout('askrecomjs', array('product' => $this->product));
vmJsApi::jDynUpdate();
vmJsApi::addJScript('updDynamicListeners', "\njQuery(document).ready(function() { // GALT: Start listening for dynamic content update.\n\t// If template is aware of dynamic update and provided a variable let's\n\t// set-up the event listeners.\n\tif (Virtuemart.container)\n\t\tVirtuemart.updateDynamicUpdateListeners();\n\n}); ");
if (vRequest::getInt('print', false)) {
?>
<body onload="javascript:print();">
<?php
}
?>
<div class="productdetails-view productdetails">
<?php
// Back To Category Button
if ($this->product->virtuemart_category_id) {
$catURL = JRoute::_('index.php?option=com_virtuemart&view=category&virtuemart_category_id=' . $this->product->virtuemart_category_id, FALSE);
示例4: display
//.........这里部分代码省略.........
$parent = $product_model->getProduct($product->product_parent_id);
$document->addHeadLink($parent->canonical, 'canonical', 'rel', '');
} else {
$document->addHeadLink($product->canonical, 'canonical', 'rel', '');
}
} else {
if ($format == 'pdf') {
defined('K_PATH_IMAGES') or define('K_PATH_IMAGES', VMPATH_ROOT);
}
}
// Set the titles
// $document->setTitle should be after the additem pathway
if ($product->customtitle) {
$document->setTitle(strip_tags(html_entity_decode($product->customtitle, ENT_QUOTES)));
} else {
$document->setTitle(strip_tags(html_entity_decode(($category->category_name ? vmText::_($category->category_name) . ' : ' : '') . $product->product_name, ENT_QUOTES)));
}
$this->allowReview = $ratingModel->allowReview($product->virtuemart_product_id);
$this->showReview = $ratingModel->showReview($product->virtuemart_product_id);
$this->rating_reviews = '';
if ($this->showReview) {
$this->review = $ratingModel->getReviewByProduct($product->virtuemart_product_id);
$this->rating_reviews = $ratingModel->getReviews($product->virtuemart_product_id);
}
if ($this->showRating) {
$this->vote = $ratingModel->getVoteByProduct($product->virtuemart_product_id);
}
$this->allowRating = $ratingModel->allowRating($product->virtuemart_product_id);
$superVendor = vmAccess::isSuperVendor();
if ($superVendor == 1 or $superVendor == $product->virtuemart_vendor_id or $superVendor) {
$edit_link = JURI::root() . 'index.php?option=com_virtuemart&tmpl=component&manage=1&view=product&task=edit&virtuemart_product_id=' . $product->virtuemart_product_id;
$this->edit_link = $this->linkIcon($edit_link, 'COM_VIRTUEMART_PRODUCT_FORM_EDIT_PRODUCT', 'edit', false, false);
} else {
$this->edit_link = "";
}
// Load the user details
$this->user = JFactory::getUser();
// More reviews link
$uri = JURI::getInstance();
$uri->setVar('showall', 1);
$uristring = vmURI::getCleanUrl();
$this->assignRef('more_reviews', $uristring);
if ($product->metadesc) {
$document->setDescription(strip_tags(html_entity_decode($product->metadesc, ENT_QUOTES)));
} else {
$document->setDescription(strip_tags(html_entity_decode($product->product_name, ENT_QUOTES)) . " " . $category->category_name . " " . strip_tags(html_entity_decode($product->product_s_desc, ENT_QUOTES)));
}
if ($product->metakey) {
$document->setMetaData('keywords', $product->metakey);
}
if ($product->metarobot) {
$document->setMetaData('robots', $product->metarobot);
}
if ($app->getCfg('MetaTitle') == '1') {
$document->setMetaData('title', $product->product_name);
//Maybe better product_name
}
if ($app->getCfg('MetaAuthor') == '1') {
$document->setMetaData('author', $product->metaauthor);
}
$user = JFactory::getUser();
$showBasePrice = (vmAccess::manager() or vmAccess::isSuperVendor());
$this->assignRef('showBasePrice', $showBasePrice);
$productDisplayShipments = array();
$productDisplayPayments = array();
if (!class_exists('vmPSPlugin')) {
require JPATH_VM_PLUGINS . DS . 'vmpsplugin.php';
}
JPluginHelper::importPlugin('vmshipment');
JPluginHelper::importPlugin('vmpayment');
$dispatcher = JDispatcher::getInstance();
$returnValues = $dispatcher->trigger('plgVmOnProductDisplayShipment', array($product, &$productDisplayShipments));
$returnValues = $dispatcher->trigger('plgVmOnProductDisplayPayment', array($product, &$productDisplayPayments));
$this->assignRef('productDisplayPayments', $productDisplayPayments);
$this->assignRef('productDisplayShipments', $productDisplayShipments);
if (empty($category->category_template)) {
$category->category_template = VmConfig::get('categorytemplate');
}
shopFunctionsF::setVmTemplate($this, $category->category_template, $product->product_template, $category->category_product_layout, $product->layout);
shopFunctionsF::addProductToRecent($virtuemart_product_id);
$currency = CurrencyDisplay::getInstance();
$this->assignRef('currency', $currency);
if (vRequest::getCmd('layout', 'default') == 'notify') {
$this->setLayout('notify');
}
//Added by Seyi Awofadeju to catch notify layout
VmConfig::loadJLang('com_virtuemart');
vmJsApi::chosenDropDowns();
//This must be loaded after the customfields are rendered (they may need to overwrite the handlers)
if (VmConfig::get('jdynupdate', TRUE) or $app->isAdmin()) {
vmJsApi::jDynUpdate();
}
if ($show_prices == '1') {
if (!class_exists('calculationHelper')) {
require VMPATH_ADMIN . DS . 'helpers' . DS . 'calculationh.php';
}
vmJsApi::jPrice();
}
parent::display($tpl);
}
示例5: chosenDropDowns
static function chosenDropDowns()
{
static $chosenDropDowns = false;
if (!$chosenDropDowns) {
$be = self::isAdmin();
if (VmConfig::get('jchosen', 0) or $be) {
vmJsApi::addJScript('chosen.jquery.min', false, false);
if (!$be) {
vmJsApi::jDynUpdate();
vmJsApi::addJScript('vmprices');
}
vmJsApi::css('chosen');
$selectText = 'COM_VIRTUEMART_DRDOWN_AVA2ALL';
$vm2string = "editImage: 'edit image',select_all_text: '" . vmText::_('COM_VIRTUEMART_DRDOWN_SELALL') . "',select_some_options_text: '" . vmText::_($selectText) . "'";
if ($be or vRequest::getInt('manage', false)) {
$selector = 'jQuery("select")';
} else {
$selector = 'jQuery(".vm-chzn-select")';
}
$script = 'if (typeof Virtuemart === "undefined")
var Virtuemart = {};
Virtuemart.updateChosenDropdownLayout = function() {
var vm2string = {' . $vm2string . '};
jQuery(function($) {
' . $selector . '.chosen({enable_select_all: true,select_all_text : vm2string.select_all_text,select_some_options_text:vm2string.select_some_options_text,disable_search_threshold: 5});
});
}
Virtuemart.updateChosenDropdownLayout();';
self::addJScript('updateChosen', $script);
}
$chosenDropDowns = true;
}
return;
}