本文整理汇总了PHP中XLite::getCustomerScript方法的典型用法代码示例。如果您正苦于以下问题:PHP XLite::getCustomerScript方法的具体用法?PHP XLite::getCustomerScript怎么用?PHP XLite::getCustomerScript使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类XLite
的用法示例。
在下文中一共展示了XLite::getCustomerScript方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: doActionLocate
/**
* Place URL into engine's endpoints
*
* @return void
*/
protected function doActionLocate()
{
$engines = \XLite\Core\Request::getInstance()->engines;
if ($engines) {
foreach ($this->getEngines() as $key => $engine) {
if (in_array($key, $engines)) {
$url = urlencode(\XLite::getInstance()->getShopURL(\XLite\Core\Converter::buildURL('sitemap', '', array(), \XLite::getCustomerScript())));
$url = str_replace('%url%', $url, $engine['url']);
$request = new \XLite\Core\HTTP\Request($url);
$response = $request->sendRequest();
if (200 == $response->code) {
\XLite\Core\TopMessage::addInfo('Site map successfully registred on X', array('engine' => $key));
} else {
\XLite\Core\TopMessage::addWarning('Site map has not been registred in X', array('engine' => $key));
}
}
}
}
$postedData = \XLite\Core\Request::getInstance()->getData();
$options = \XLite\Core\Database::getRepo('\\XLite\\Model\\Config')->findBy(array('category' => $this->getOptionsCategory()));
$isUpdated = false;
foreach ($options as $key => $option) {
$name = $option->getName();
$type = $option->getType();
if (isset($postedData[$name]) || 'checkbox' == $type) {
if ('checkbox' == $type) {
$option->setValue(isset($postedData[$name]) ? 'Y' : 'N');
} else {
$option->setValue($postedData[$name]);
}
$isUpdated = true;
\XLite\Core\Database::getEM()->persist($option);
}
}
if ($isUpdated) {
\XLite\Core\Database::getEM()->flush();
}
}
示例2: getWebhookURL
/**
* Get webhook URL
*
* @return string
*/
public function getWebhookURL()
{
$url = explode('&xid=', \XLite::getInstance()->getShopURL(\XLite\Core\Converter::buildURL('callback', null, array(), \XLite::getCustomerScript()), \XLite\Core\Config::getInstance()->Security->customer_security));
return $url[0];
}
示例3: preprocessOpenGraphMetaTags
/**
* Preprocess Open Graph meta tags
*
* @param string $tags Tags content
*
* @return string
*/
protected function preprocessOpenGraphMetaTags($tags)
{
$categoryURL = $this->getParent() ? \XLite\Core\Converter::makeURLValid(\XLite::getInstance()->getShopURL(\XLite\Core\Converter::buildURL('category', '', array('category_id' => $this->getCategoryId()), \XLite::getCustomerScript()))) : \XLite::getInstance()->getShopURL();
return str_replace(array('[PAGE_URL]', '[IMAGE_URL]'), array($categoryURL, $this->getImage() ? $this->getImage()->getFrontURL() : ''), $tags);
}
示例4: buildProductPreviewURL
/**
* Defines the product preview URL
*
* @param integer $productId Product id
*
* @return string
*/
public function buildProductPreviewURL($productId)
{
return \XLite\Core\Converter::buildURL('product', 'preview', array('product_id' => $productId), \XLite::getCustomerScript());
}
示例5: getSitemapURL
/**
* Get sitemap URL
*
* @return string
*/
protected function getSitemapURL()
{
return \XLite::getInstance()->getShopURL(\XLite\Core\Converter::buildURL('sitemap', '', array(), \XLite::getCustomerScript()));
}
示例6: getCallbackUrl
/**
* Get callback URL
*
* @param string $xpcBackReference Reference between X-Payments payment and X-Cart transaction
* @param bool $forZeroAuth Call back for zero auth or regular order
*
* @return string
*/
public static function getCallbackUrl($xpcBackReference)
{
if (!$forZeroAuth) {
// Order callback
$url = \XLite\Core\Converter::buildUrl('callback', 'callback', array('xpcBackReference' => $xpcBackReference), \XLite::getCustomerScript());
} else {
// Add new card callback
$url = \XLite\Core\Converter::buildUrl('callback', 'callback', array('xpcBackReference' => $xpcBackReference, 'for_zero_auth' => '1'), \XLite::getCustomerScript());
}
return \XLite::getInstance()->getShopUrl($url);
}
示例7: getIframeUrl
/**
* Get iframe URL
*
* @return string
*/
public function getIframeUrl()
{
static $url = null;
if (!$url && $this->getAddressList()) {
try {
$url = \XLite\Module\CDev\XPaymentsConnector\Core\ZeroAuth::getInstance()->getIframeUrl($this->getProfile(), \XLite::getCustomerScript());
} catch (\Exception $e) {
$this->error = $e->getMessage();
}
}
return $url;
}
示例8: getDownloadURL
/**
* Get download URL for customer front-end by key
*
* @return string
*/
public function getDownloadURL(\XLite\Module\CDev\Egoods\Model\OrderItem\PrivateAttachment $attachment)
{
$params = $this->getGetterParams();
$params['key'] = $attachment->getDownloadKey();
return \XLite\Core\Converter::buildFullURL('storage', 'download', $params, \XLite::getCustomerScript());
}
示例9: sendOrderTrackingInformationCustomer
/**
* Send notification about created profile to the user
*
* @param \XLite\Model\Order $order Order object
*
* @return void
*/
public static function sendOrderTrackingInformationCustomer(\XLite\Model\Order $order)
{
$orderUrl = \XLite::getInstance()->getShopURL(\XLite\Core\Converter::buildURL('order', '', array('order_number' => $order->getOrderNumber()), \XLite::getCustomerScript()));
static::register(array('order' => $order, 'trackingNumbers' => $order->getTrackingNumbers(), 'orderURL' => $orderUrl, 'address' => $order->getProfile()->getBillingAddress(), 'recipientName' => $order->getProfile()->getName()));
static::compose(static::TYPE_ORDER_TRACKING_INFORMATION_CUSTOMER, static::getOrdersDepartmentMail(), $order->getProfile()->getLogin(), 'order_tracking_information', array(), true, \XLite::CUSTOMER_INTERFACE, static::getMailer()->getLanguageCode(\XLite::CUSTOMER_INTERFACE, $order->getProfile()->getLanguage()));
\XLite\Core\OrderHistory::getInstance()->registerCustomerEmailSent($order->getOrderId(), 'Tracking information is sent to the customer');
}
示例10: buildLoc
/**
* Build location URL
*
* @param array $loc Locationb as array
*
* @return string
*/
protected function buildLoc(array $loc)
{
$target = $loc['target'];
unset($loc['target']);
return \XLite\Core\Converter::buildURL($target, '', $loc, \XLite::getCustomerScript());
}
示例11: getGetterURL
/**
* Get attachment getter URL
*
* @return string
*/
public function getGetterURL()
{
return \XLite\Core\Converter::buildURL('storage', 'download', $this->getGetterParams(), \XLite::getCustomerScript());
}
示例12: getFrontURL
/**
* Get front URL
*
* @return string
*/
public function getFrontURL()
{
return $this->getProductId() ? \XLite\Core\Converter::makeURLValid(\XLite::getInstance()->getShopURL(\XLite\Core\Converter::buildURL('product', '', array('product_id' => $this->getProductId()), \XLite::getCustomerScript()))) : null;
}
示例13: getFrontURL
/**
* Get front URL
*
* @return string
*/
public function getFrontURL()
{
$url = null;
if ($this->getId()) {
$url = \XLite\Core\Converter::makeURLValid(\XLite::getInstance()->getShopURL(\XLite\Core\Converter::buildURL('newsMessage', '', array('id' => $this->getId()), \XLite::getCustomerScript(), true)));
}
return $url;
}
示例14: getIframeUrl
/**
* Get iframe URL
*
* @return string
*/
public function getIframeUrl(\XLite\Model\Profile $profile, $interface = false)
{
if (!$interface) {
$interface = \XLite::getCustomerScript();
}
$iframeUrl = false;
// Prepare cart
$cart = $this->createCart($profile);
$preparedCart = $this->getPreparedCart($cart);
if ($preparedCart) {
$transaction = $cart->getFirstOpenPaymentTransaction();
$this->getPaymentMethod()->getProcessor()->savePaymentSettingsToTransaction($transaction);
$xpcBackReference = $transaction->getPublicId();
$profile->setPendingZeroAuth($xpcBackReference);
$profile->setPendingZeroAuthInterface($interface);
\XLite\Core\Database::getEM()->flush();
// Data to send to X-Payments
$data = array('confId' => intval($this->getPaymentMethod()->getSetting('id')), 'refId' => $xpcBackReference, 'cart' => $preparedCart, 'language' => 'en', 'returnUrl' => $this->getClient()->getReturnUrl($xpcBackReference, true), 'callbackUrl' => $this->getClient()->getCallbackUrl($xpcBackReference, true));
// For API v1.3 and higher we can send the template for iframe
if (version_compare($this->getConfig()->xpc_api_version, '1.3') >= 0) {
$data += array('saveCard' => 'Y', 'template' => 'xc5');
}
$init = $this->getClient()->getApiRequest()->send('payment', 'init', $data);
if ($init->isSuccess()) {
$response = $init->getResponse();
$iframeUrl = $this->getConfig()->xpc_xpayments_url . '/payment.php?target=main&token=' . $response['token'];
$transaction->setDataCell('xpc_txnid', $response['txnId'], 'X-Payments transaction id', 'C');
$transaction->setDataCell('xpcBackReference', $xpcBackReference, 'X-Payments back reference', 'C');
// AntiFraud service
if (method_exists($transaction, 'processAntiFraudCheck')) {
$transaction->processAntiFraudCheck();
}
\XLite\Core\Database::getEM()->flush();
} else {
throw new \Exception($init->getError());
}
}
return $iframeUrl;
}
示例15: getWebhookURL
/**
* Get Webhook URL
*
* @return string
*/
public function getWebhookURL()
{
return \XLite::getInstance()->getShopURL(\XLite\Core\Converter::buildURL('callback', null, array(), \XLite::getCustomerScript()), \XLite\Core\Config::getInstance()->Security->customer_security);
}