示例#1
0
 /**
  * Assembles the $child_options variable for storage in the product table
  *
  * @param unknown_type $d
  * @return unknown
  */
 function set_child_options($d)
 {
     if ($d["product_parent_id"] != 0) {
         $child_options = null;
     } else {
         $child_options = vmrequest::getYesOrNo('display_use_parent') . "," . vmGet($d, 'product_list', 'N') . "," . vmrequest::getYesOrNo('display_headers') . "," . vmrequest::getYesOrNo('product_list_child') . "," . vmrequest::getYesOrNo('product_list_type') . "," . vmrequest::getYesOrNo('display_desc') . "," . vmrequest::getVar('desc_width') . "," . vmrequest::getVar('attrib_width') . "," . vmrequest::getVar('child_class_sfx');
     }
     return $child_options;
 }
示例#2
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;
     }
 }
 /**
  * Creates the Quantity Input Boxes/Radio Buttons/Lists for Products
  *
  * @param int $product_id The Parent Product ID
  * @param int $prod_id The actual Product ID
  * @param string $child
  * @param string $use_parent
  * @return string
  */
 function show_quantity_box($product_id, $prod_id, $child = false, $use_parent = 'N')
 {
     global $VM_LANG;
     $tpl = vmTemplate::getInstance();
     if ($child == 'Y') {
         //We have a child list so get the current quantity;
         $quantity = 0;
         for ($i = 0; $i < $_SESSION["cart"]["idx"]; $i++) {
             if ($_SESSION['cart'][$i]["product_id"] == $prod_id) {
                 $quantity = $_SESSION['cart'][$i]["quantity"];
             }
         }
     } else {
         $quantity = vmrequest::getInt('quantity', 1);
     }
     // Detremine which style to use
     if ($use_parent == 'Y' && !empty($product_id)) {
         $id = $product_id;
     } else {
         $id = $prod_id;
     }
     //Get style to use
     $product_in_stock = ps_product::get_field($id, 'product_in_stock');
     $quantity_options = ps_product::get_quantity_options($id);
     extract($quantity_options);
     //Start output of quantity
     //Check for incompatabilities and reset to normal
     if (CHECK_STOCK == '1' && !$product_in_stock) {
         $display_type = 'hide';
     }
     if (empty($display_type) || @$display_type == "hide" && $child == 'Y' || @$display_type == "radio" && $child == 'YM' || @$display_type == "radio" && !$child) {
         $display_type = "none";
     }
     unset($quantity_options['display_type']);
     $tpl->set('prod_id', $prod_id);
     $tpl->set('quantity', $quantity);
     $tpl->set('display_type', $display_type);
     $tpl->set('child', $child);
     $tpl->set('quantity_options', $quantity_options);
     //Determine if label to be used
     $html = $tpl->fetch('product_details/includes/quantity_box_general.tpl.php');
     return $html;
 }
* @copyright Copyright (C) 2009 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__);
if (!isset($_REQUEST["shopper_id"]) || empty($_REQUEST["shopper_id"])) {
    echo $VM_LANG->_('VM_CHECKOUT_ORDERIDNOTSET');
} else {
    include CLASSPATH . "payment/ps_ipayment.cfg.php";
    $order_number = vmrequest::getVar('shopper_id');
    $q = 'SELECT order_id,order_total,order_status,order_currency FROM #__{vm}_orders WHERE ';
    $q .= '#__{vm}_orders.user_id= ' . $auth["user_id"] . "\n";
    $q .= 'AND #__{vm}_orders.order_number=\'' . $db->getEscaped($order_number) . "'";
    $db->query($q);
    if ($db->next_record()) {
        if (vmRequest::getVar('ret_status') == 'SUCCESS') {
            ?>
 
        <img src="<?php 
            echo VM_THEMEURL;
            ?>
images/button_ok.png" align="middle" alt="<?php 
            echo $VM_LANG->_('VM_CHECKOUT_SUCCESS');
            ?>
" border="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}' ";
示例#6
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';
* @package VirtueMart
* @subpackage html
* @copyright Copyright (C) 2004-2007 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__);
require_once CLASSPATH . 'ps_order_status.php';
$ps_order_status = new ps_order_status();
$order_status_id = vmrequest::getInt('order_status_id', 0);
$option = empty($option) ? vmGet($_REQUEST, 'option', 'com_virtuemart') : $option;
//First create the object and let it print a form heading
$formObj = new formFactory($VM_LANG->_('PHPSHOP_ORDER_STATUS_FORM_LBL'));
//Then Start the form
$formObj->startForm();
$readonly = '';
if (!empty($order_status_id)) {
    $q = "SELECT * FROM #__{vm}_order_status WHERE order_status_id='{$order_status_id}'";
    $db->query($q);
    $db->next_record();
    if (in_array($db->f('order_status_code'), $ps_order_status->_protected_status_codes)) {
        $readonly = 'readonly="readonly"';
    }
}
?>
示例#8
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']();