*/ global $mosConfig_absolute_path, $sess, $VM_LANG; // Load the virtuemart main parse code if( @file_exists(dirname(__FILE__).'/../../components/com_virtuemart/virtuemart_parser.php' )) { require_once( dirname(__FILE__).'/../../components/com_virtuemart/virtuemart_parser.php' ); } else { require_once( dirname(__FILE__).'/../components/com_virtuemart/virtuemart_parser.php' ); } $category_id = vmRequest::getInt('category_id'); $text_before = $params->get( 'text_before', ''); $show_dropdown = $params->get( 'show_dropdown', 1); $show_linklist = $params->get( 'show_linklist', 1); $auto = $params->get( 'auto', 0); $sess = new ps_session; $query = "SELECT DISTINCT m.manufacturer_id, m.mf_name FROM #__{vm}_manufacturer m LEFT JOIN #__{vm}_product_mf_xref mx ON mx.manufacturer_id = m.manufacturer_id LEFT JOIN #__{vm}_product p ON p.product_id = mx.product_id LEFT JOIN #__{vm}_product_category_xref cx ON cx.product_id = p.product_id WHERE cx.category_id =".(int)$category_id; $query .= " ORDER BY m.mf_name ASC"; $query_all = "SELECT m.manufacturer_id,m.mf_name FROM #__{vm}_manufacturer m "; $query_all .= "ORDER BY m.mf_name ASC"; $db = new ps_DB; if ($auto == 1 && !empty( $category_id ) ) {
</span> <?php if (!trim(ps_product::product_has_attributes($row->product_id, true))) { ?> <div class="ice-addtocart"> <form action="<?php echo $row->addtocart_link; ?> " method="post" name="addtocart" id="addtocart<?php echo $row->product_id; ?> " onsubmit="handleAddToCart( this.id );return false;" > <input type="hidden" name="option" value="com_virtuemart" /> <input type="hidden" name="page" value="shop.cart" /> <input type="hidden" name="Itemid" value="<?php echo ps_session::getShopItemid(); ?> " /> <input type="hidden" name="func" value="cartAdd" /> <input type="hidden" name="prod_id" value="<?php echo $row->product_id; ?> " /> <input type="hidden" name="product_id" value="<?php echo $row->product_id; ?> " /> <input type="hidden" name="quantity" value="1" /> <input type="hidden" name="set_price[]" value="" /> <input type="hidden" name="adjust_price[]" value="" /> <input type="hidden" name="master_product[]" value="" />
* * www.virtuemart.net */ global $mosConfig_absolute_path, $sess, $VM_LANG; // Load the virtuemart main parse code if (@file_exists(dirname(__FILE__) . '/../../components/com_virtuemart/virtuemart_parser.php')) { require_once dirname(__FILE__) . '/../../components/com_virtuemart/virtuemart_parser.php'; } else { require_once dirname(__FILE__) . '/../components/com_virtuemart/virtuemart_parser.php'; } $category_id = vmRequest::getInt('category_id'); $text_before = $params->get('text_before', ''); $show_dropdown = $params->get('show_dropdown', 1); $show_linklist = $params->get('show_linklist', 1); $auto = $params->get('auto', 0); $sess = new ps_session(); $query = "SELECT DISTINCT m.manufacturer_id, m.mf_name\n\t\t\t\t\tFROM #__{vm}_manufacturer m\n\t\t\t\t\tLEFT JOIN #__{vm}_product_mf_xref mx ON mx.manufacturer_id = m.manufacturer_id\n\t\t\t\t\tLEFT JOIN #__{vm}_product p ON p.product_id = mx.product_id\n\t\t\t\t\tLEFT JOIN #__{vm}_product_category_xref cx ON cx.product_id = p.product_id\n\t\t\t\t\tWHERE cx.category_id =" . (int) $category_id; $query .= " ORDER BY m.mf_name ASC"; $query_all = "SELECT m.manufacturer_id,m.mf_name FROM #__{vm}_manufacturer m "; $query_all .= "ORDER BY m.mf_name ASC"; $db = new ps_DB(); if ($auto == 1 && !empty($category_id)) { $db->query($query); } else { $db->query($query_all); } $res = $db->record; if (empty($res)) { if ($auto == 1) { $db->query($query_all); $res = $db->record;
die('Please provide an permitted value for offset'); } } // basic SQL inject detection $my_insecure_array = array('keyword' => $_REQUEST['keyword'], 'category_id' => $_REQUEST['category_id'], 'product_id' => $_REQUEST['product_id'], 'user_id' => $_REQUEST['user_id'], 'user_info_id' => $_REQUEST['user_info_id'], 'page' => $_REQUEST['page'], 'func' => $_REQUEST['func']); while (list($key, $value) = each($my_insecure_array)) { if (stristr($value, 'FROM ') || stristr($value, 'UPDATE ') || stristr($value, 'WHERE ') || stristr($value, 'ALTER ') || stristr($value, 'SELECT ') || stristr($value, 'SHUTDOWN ') || stristr($value, 'CREATE ') || stristr($value, 'DROP ') || stristr($value, 'DELETE FROM') || stristr($value, 'script') || stristr($value, '<>') || stristr($value, '=') || stristr($value, 'SET ')) { die('Please provide a permitted value for ' . $key); } } // Load module definitions $module = array(); $label = array(); // Instantiate db and session class $db = new ps_DB(); $sess = new ps_session(); $perm = new ps_perm(); $vars = array(); // In case someone tries to be sneaky $run_dir = 0; $run_func = 0; // Set default language as specified in phpshop.cfg if (!isset($lang)) { $lang = LANGUAGE; $sess->register("lang"); } // Save current page call $this_page = $page; // Register previous page if (!isset($last_page)) { $sess->register("last_page");
// Instantiate the permission class $perm = new ps_perm(); // Instantiate the HTML helper class $ps_html = new ps_html(); // Constructor initializes the session! $sess = new ps_session(); // Instantiate the ps_shopper_group class $ps_shopper_group = new ps_shopper_group(); // Get default and this users's Shopper Group $shopper_group = $ps_shopper_group->get_shoppergroup_by_id($my->id); // User authentication $auth = $perm->doAuthentication($shopper_group); // Initialize the cart $cart = ps_cart::initCart(); // Initialise Recent Products $recentproducts = ps_session::initRecentProducts(); // Instantiate the module class $ps_module = new ps_module(); // Instantiate the function class $ps_function = new ps_function(); // Set the mosConfig_live_site to its' SSL equivalent $GLOBALS['real_mosConfig_live_site'] = $GLOBALS['mosConfig_live_site']; if ($_SERVER['SERVER_PORT'] == 443 || @$_SERVER['HTTPS'] == 'on' || @strstr($page, "checkout.")) { // Change the global Live Site Value to HTTPS $GLOBALS['mosConfig_live_site'] = ereg_replace('/$', '', SECUREURL); $mm_action_url = SECUREURL; } else { $mm_action_url = URL; } // Enable Mambo Debug Mode when Shop Debug is on if (vmShouldDebug()) {
/** * This function returns a base64_encoded string: * VMsessionId|JsessionID * */ function getMartId() { global $vmuser, $mosConfig_secret; // Get the Joomla! / Mambo session ID $sessionId = ps_session::getSessionId(); $userNameSeed = ''; if ($vmuser->id) { $userNameSeed = '|' . md5($vmuser->username . $vmuser->password . $mosConfig_secret); if (is_callable(array('mosMainFrame', 'remCookieName_User'))) { if (!empty($GLOBALS['real_mosConfig_live_site']) && empty($_REQUEST['real_mosConfig_live_site'])) { $GLOBALS['mosConfig_live_site'] = $GLOBALS['real_mosConfig_live_site']; } $userNameSeed .= '|' . vmGet($_COOKIE, mosMainFrame::remCookieName_User(), ''); } } $martID = base64_encode(vmCreateHash($_COOKIE[$this->_session_name] . $sessionId) . $userNameSeed); return $martID; }
<?php if( !empty($price) ) { ?> <div class="box_product_price"><em>Price:</em><?php echo $price; ?> </div> <?php } ?> <!-- The add to cart DIV. --> <div class="product_buttons"> <div style="padding: 0px 0px 0px 0px;"> <div class="width"> <a class="details" title="<?php echo $product_name ?>" href="<?php echo $product_link ?>"><?php echo "Details" ?></a> <?php if( !empty($addtocart_link) ) { ?> <form action="<?php echo $mm_action_url ?>index.php" method="post" name="addtocart" id="addtocart" style="width:81px; margin:auto"> <input type="hidden" name="option" value="com_virtuemart" /> <input type="hidden" name="page" value="shop.cart" /> <input type="hidden" name="Itemid" value="<?php echo ps_session::getShopItemid(); ?>" /> <input type="hidden" name="func" value="cartAdd" /> <input type="hidden" name="prod_id" value="<?php echo $product_id; ?>" /> <input type="hidden" name="product_id" value="<?php echo $product_id ?>" /> <input type="hidden" name="quantity" value="1" /> <input type="hidden" name="set_price[]" value="" /> <input type="hidden" name="adjust_price[]" value="" /> <input type="hidden" name="master_product[]" value="" /> <input type="submit" class="addtocart_button_module" value="<?php echo $VM_LANG->_('PHPSHOP_CART_ADD_TO') ?>" title="<?php echo $VM_LANG->_('PHPSHOP_CART_ADD_TO') ?>" /> </form> <?php } ?> </div></div></div> </div>