Exemple #1
0
 /**
  * Creates a drop-down list for currencies. The currency ID is used as option value
  *
  * @param string $list_name The name of the select element
  * @param string $value The value of the pre-selected option
  * @return HTML code with the drop-down list
  */
 function list_currency_id($list_name, $value = "")
 {
     echo ps_html::getCurrencyList($list_name, $value, 'currency_id');
 }
 case 'getpriceform':
     include_class('shopper');
     include_class('product');
     $shopper_group_id = intval(vmGet($_REQUEST, 'shopper_group_id', 5));
     $product_id = intval(vmGet($_REQUEST, 'product_id'));
     $currency_code = vmGet($_REQUEST, 'product_currency', $vendor_currency);
     $price = $ps_product->getPriceByShopperGroup($product_id, $shopper_group_id);
     if (isset($price['product_currency'])) {
         $currency_code = $price['product_currency'];
         $currency_code = $price['product_currency'];
     }
     $formName = 'priceForm';
     $content = '<form id="' . $formName . '" method="post" name="priceForm">';
     $content .= '<table class="adminform"><tr><td><strong>' . $VM_LANG->_('PHPSHOP_PRICE_FORM_PRICE') . ':</strong></td><td><input type="text" name="product_price" value="' . $price['product_price'] . '" class="inputbox" id="product_price_' . $formName . '" size="11" /></td></tr>';
     $content .= '<tr><td><strong>' . $VM_LANG->_('PHPSHOP_PRICE_FORM_GROUP') . ':</strong></td><td>' . $ps_shopper_group->list_shopper_groups('shopper_group_id', $shopper_group_id, 'onchange="reloadForm( \'' . $product_id . '\', \'shopper_group_id\', this.options[this.selectedIndex].value);"') . '</td></tr>';
     $content .= '<tr><td><strong>' . $VM_LANG->_('PHPSHOP_PRICE_FORM_CURRENCY') . ':</strong></td><td>' . ps_html::getCurrencyList('product_currency', $currency_code, 'currency_code', 'style="max-width:120px;"') . '</td></tr></table>';
     $content .= '<input type="hidden" name="product_price_id" value="' . $price['product_price_id'] . '" id="product_price_id_' . $formName . '" />';
     $content .= '<input type="hidden" name="product_id" value="' . $product_id . '" />';
     $content .= '<input type="hidden" name="func" value="' . (empty($price['product_price_id']) ? 'productPriceAdd' : 'productPriceUpdate') . '" />';
     $content .= '<input type="hidden" name="ajax_request" value="1" />';
     $content .= '<input type="hidden" name="no_html" value="1" />';
     $content .= '<input type="hidden" name="vmtoken" value="' . vmSpoofValue($sess->getSessionId()) . '" />';
     $content .= '<input type="hidden" name="option" value="' . $option . '" />';
     $content .= '</form>';
     vmConnector::sendHeaderAndContent(200, $content);
     break;
 case 'getproducts':
     if (!defined('SERVICES_JSON_SLICE')) {
         require_once CLASSPATH . 'JSON.php';
     }
     $db =& new ps_DB();