Пример #1
0
 /**
  * Writes the configuration file for this payment method
  * @param array An array of objects
  * @returns boolean True when writing was successful
  */
 function write_configuration(&$d)
 {
     global $vendor_image_url, $vmLogger;
     $lang = jfactory::getLanguage();
     $name = $lang->getBackwardLang();
     if (file_exists(CLASSPATH . "payment/paypal_api/languages/lang." . $name . ".admin.php")) {
         include CLASSPATH . "payment/paypal_api/languages/lang." . $name . ".admin.php";
     } else {
         include CLASSPATH . "payment/paypal_api/languages/lang.english.admin.php";
     }
     if (substr(vmget($d, 'PAYPAL_API_IMAGEURL'), 0, 5) != 'https') {
         $vmLogger->info(PAYPAL_API_TEXT_IMAGE_URL_WARN);
     }
     $my_config_array = array("PAYPAL_API_API_USERNAME" => vmget($d, 'PAYPAL_API_API_USERNAME'), "PAYPAL_API_API_PASSWORD" => vmget($d, 'PAYPAL_API_API_PASSWORD'), "PAYPAL_API_API_SIGNATURE" => vmget($d, 'PAYPAL_API_API_SIGNATURE'), "PAYPAL_API_PAYMENTTYPE" => vmget($d, 'PAYPAL_API_PAYMENTTYPE', 'Sale'), "PAYPAL_API_IMAGEURL" => vmget($d, 'PAYPAL_API_IMAGEURL', $vendor_image_url), "PAYPAL_API_CART_BUTTON_ON" => vmget($d, 'PAYPAL_API_CART_BUTTON_ON', '1'), "PAYPAL_API_DIRECT_PAYMENT_ON" => vmget($d, 'PAYPAL_API_DIRECT_PAYMENT_ON', '0'), "PAYPAL_API_VERIFIED_ONLY" => vmget($d, 'PAYPAL_API_VERIFIED_ONLY', '1'), "PAYPAL_API_VERIFIED_STATUS" => $d['PAYPAL_API_VERIFIED_STATUS'], "PAYPAL_API_PENDING_STATUS" => $d['PAYPAL_API_PENDING_STATUS'], "PAYPAL_API_INVALID_STATUS" => $d['PAYPAL_API_INVALID_STATUS'], "PAYPAL_API_CHECK_CARD_CODE" => vmget($d, 'PAYPAL_API_CHECK_CARD_CODE', 'YES'), "PAYPAL_API_CERTIFICATE" => vmget($d, 'PAYPAL_API_CERTIFICATE'), "PAYPAL_API_USE_SHIPPING" => vmrequest::getint('PAYPAL_API_USE_SHIPPING', 1), "PAYPAL_API_DEBUG" => vmrequest::getint('PAYPAL_API_DEBUG', 0));
     $config = "<?php\n";
     $config .= "if( !defined( '_VALID_MOS' ) && !defined( '_JEXEC' ) ) die( 'Direct Access to '.basename(__FILE__).' is not allowed.' ); \n\n";
     foreach ($my_config_array as $key => $value) {
         $config .= "define ('{$key}', '{$value}');\n";
     }
     $config .= "?>";
     if ($fp = fopen(CLASSPATH . "payment/" . __CLASS__ . ".cfg.php", "w")) {
         fputs($fp, $config, strlen($config));
         fclose($fp);
         return true;
     } else {
         return false;
     }
 }
Пример #2
0
$info['authorname'] = $vendor_name;
$info['email'] = $vendor_mail;
$info['managingEditor'] = $vendor_mail . " (" . $vendor_name . ")";
$info['date'] = date('r');
$info['year'] = date('Y');
$info['link'] = $mosConfig_live_site;
$info['encoding'] = $iso;
$info['language'] = 'en';
if (is_array($lang)) {
    $info['language'] = $lang[0];
}
$info['cache'] = VM_FEED_CACHE;
$info['cache_time'] = VM_FEED_CACHETIME;
$info['category_id'] = $category_id;
// Filter by category? At this place, category_id is INT
$info['product_number'] = max(5, min(vmrequest::getint('limit', 20), 200));
// Print a minimum of 5 & a maxmimum of 200 products
$info['feed_description'] = 'VirtueMart Product Syndication';
$info['product_description_type'] = VM_FEED_DESCRIPTION_TYPE;
$info['limit_desc'] = VM_FEED_LIMITTEXT;
$info['text_length'] = VM_FEED_MAX_TEXT_LENGTH;
$info['show_description'] = VM_FEED_SHOW_DESCRIPTION;
$info['show_price'] = VM_FEED_SHOW_PRICES;
$info['show_image'] = VM_FEED_SHOW_IMAGES;
$info['image_file'] = $vendor_image_url;
$info['image_alt'] = $vendor_store_name;
/* Setting "Time To Live"
* This is the time after reader should refresh the info
* Unit of measure: Minutes
*/
$info['TTL'] = '1440';
Пример #3
0
* @package VirtueMart
* @subpackage html
* @copyright Copyright (C) 2004-2008 soeren - 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
*/
mm_showMyFileName(__FILE__);
$mainframe->setPageTitle($VM_LANG->_('PHPSHOP_USER_FORM_ADD_SHIPTO_LBL'));
require_once CLASSPATH . "ps_userfield.php";
$user_id = vmrequest::getint('user_id');
$user_info_id = vmGet($_REQUEST, 'user_info_id');
$missing = vmGet($vars, 'missing');
$missing_style = "color: Red; font-weight: Bold;";
if (!empty($missing)) {
    echo "<script type=\"text/javascript\">alert('" . $VM_LANG->_('CONTACT_FORM_NC') . "'); </script>\n";
}
?>
<h2><?php 
echo $VM_LANG->_('PHPSHOP_USER_FORM_ADD_SHIPTO_LBL');
?>
</h2>
<?php 
if (!empty($user_info_id)) {
    $q = "SELECT * from #__{vm}_user_info ";
    $q .= "WHERE #__{vm}_user_info.user_info_id='{$user_info_id}' ";
Пример #4
0
*
* @version $Id: shop.cart.php 2430 2010-06-10 15:14:08Z soeren $
* @package VirtueMart
* @subpackage html
* @copyright Copyright (C) 2004-2010 soeren - 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
*/
mm_showMyFileName(__FILE__);
$manufacturer_id = vmrequest::getint('manufacturer_id');
$mainframe->setPageTitle($VM_LANG->_('PHPSHOP_CART_TITLE'));
$mainframe->appendPathWay($VM_LANG->_('PHPSHOP_CART_TITLE'));
$continue_link = '';
if (!empty($category_id)) {
    $continue_link = $sess->url($_SERVER['PHP_SELF'] . '?page=shop.browse&amp;category_id=' . $category_id);
} elseif (empty($category_id) && !empty($product_id)) {
    $db->query('SELECT `category_id` FROM `#__{vm}_product_category_xref` WHERE `product_id`=' . intval($product_id));
    $db->next_record();
    $category_id = $db->f('category_id');
    $continue_link = $sess->url($_SERVER['PHP_SELF'] . '?page=shop.browse&amp;category_id=' . $category_id);
} elseif (!empty($manufacturer_id)) {
    $continue_link = $sess->url($_SERVER['PHP_SELF'] . '?page=shop.browse&amp;manufacturer_id=' . $manufacturer_id);
}
$show_basket = true;
$tpl = new $GLOBALS['VM_THEMECLASS']();