function edit()
 {
     $coupon_id = JRequest::getInt('coupon_id');
     $coupon = JTable::getInstance('coupon', 'jshop');
     $coupon->load($coupon_id);
     $edit = $coupon_id ? $edit = 1 : ($edit = 0);
     $arr_type_coupon = array();
     $arr_type_coupon[0] = new StdClass();
     $arr_type_coupon[0]->coupon_type = 0;
     $arr_type_coupon[0]->coupon_value = _JSHOP_COUPON_PERCENT;
     $arr_type_coupon[1] = new StdClass();
     $arr_type_coupon[1]->coupon_type = 1;
     $arr_type_coupon[1]->coupon_value = _JSHOP_COUPON_ABS_VALUE;
     if (!$coupon_id) {
         $coupon->coupon_type = 0;
         $coupon->finished_after_used = 1;
         $coupon->for_user_id = 0;
     }
     $currency_code = getMainCurrencyCode();
     $lists['coupon_type'] = JHTML::_('select.radiolist', $arr_type_coupon, 'coupon_type', 'onchange="changeCouponType()"', 'coupon_type', 'coupon_value', $coupon->coupon_type);
     $_tax = $this->getModel("taxes");
     $all_taxes = $_tax->getAllTaxes();
     $list_tax = array();
     foreach ($all_taxes as $tax) {
         $list_tax[] = JHTML::_('select.option', $tax->tax_id, $tax->tax_name . ' (' . $tax->tax_value . '%)', 'tax_id', 'tax_name');
     }
     $lists['tax'] = JHTML::_('select.genericlist', $list_tax, 'tax_id', 'class = "inputbox" size = "1" ', 'tax_id', 'tax_name', $coupon->tax_id);
     $view = $this->getView("coupons", 'html');
     $view->setLayout("edit");
     $view->assign('coupon', $coupon);
     $view->assign('lists', $lists);
     $view->assign('edit', $edit);
     $view->assign('currency_code', $currency_code);
     $view->assign('etemplatevar', '');
     JPluginHelper::importPlugin('jshoppingadmin');
     $dispatcher = JDispatcher::getInstance();
     $dispatcher->trigger('onBeforeEditCoupons', array(&$view));
     $view->displayEdit();
 }
Example #2
0
 function checkout()
 {
     $jshopConfig = JSFactory::getConfig();
     $_orders = JSFactory::getModel("orders");
     $order_status = $_orders->getAllOrderStatus();
     $lists['status'] = JHTML::_('select.genericlist', $order_status, 'default_status_order', 'class = "inputbox" size = "1"', 'status_id', 'name', $jshopConfig->default_status_order);
     $currency_code = getMainCurrencyCode();
     $_countries = JSFactory::getModel("countries");
     $countries = $_countries->getAllCountries(0);
     $first = JHTML::_('select.option', 0, _JSHOP_SELECT, 'country_id', 'name');
     array_unshift($countries, $first);
     $lists['default_country'] = JHTML::_('select.genericlist', $countries, 'default_country', 'class = "inputbox" size = "1"', 'country_id', 'name', $jshopConfig->default_country);
     $vendor_order_message_type = array();
     $vendor_order_message_type[] = JHTML::_('select.option', 0, _JSHOP_NOT_SEND_MESSAGE, 'id', 'name');
     $vendor_order_message_type[] = JHTML::_('select.option', 1, _JSHOP_WE_SEND_MESSAGE, 'id', 'name');
     $vendor_order_message_type[] = JHTML::_('select.option', 2, _JSHOP_WE_SEND_ORDER, 'id', 'name');
     $vendor_order_message_type[] = JHTML::_('select.option', 3, _JSHOP_WE_ALWAYS_SEND_ORDER, 'id', 'name');
     $lists['vendor_order_message_type'] = JHTML::_('select.genericlist', $vendor_order_message_type, 'vendor_order_message_type', 'class = "inputbox" size = "1"', 'id', 'name', $jshopConfig->vendor_order_message_type);
     $option = array();
     $option[] = JHTML::_('select.option', 0, _JSHOP_STEP_3_4, 'id', 'name');
     $option[] = JHTML::_('select.option', 1, _JSHOP_STEP_4_3, 'id', 'name');
     $lists['step_4_3'] = JHTML::_('select.genericlist', $option, 'step_4_3', 'class = "inputbox"', 'id', 'name', $jshopConfig->step_4_3);
     $view = $this->getView("config", 'html');
     $view->setLayout("checkout");
     $view->assign("lists", $lists);
     $view->assign("currency_code", $currency_code);
     $view->assign('etemplatevar', '');
     $view->sidebar = JHtmlSidebar::render();
     $dispatcher = JDispatcher::getInstance();
     $dispatcher->trigger('onBeforeEditConfigCheckout', array(&$view));
     $view->display();
 }
                   </td>
                 </tr>
               </table>
            </td> 
          </tr>
      </table>
      </div>
      <?php 
    }
    ?>
      <div class="myorders_total">
        <?php 
    print _JSHOP_TOTAL;
    ?>
: <span><?php 
    print formatprice($this->total, getMainCurrencyCode());
    ?>
</span>
      </div>
    <?php 
} else {
    ?>
        <div class="myorders_no_orders">
        <?php 
    print _JSHOP_NO_ORDERS;
    ?>
        </div>
    <?php 
}
?>
    <?php 
 function edit()
 {
     $jshopConfig = JSFactory::getConfig();
     $payment_id = JRequest::getInt("payment_id");
     $db = JFactory::getDBO();
     $payment = JTable::getInstance('paymentMethod', 'jshop');
     $payment->load($payment_id);
     $parseString = new parseString($payment->payment_params);
     $params = $parseString->parseStringToParams();
     $edit = $payment_id ? $edit = 1 : ($edit = 0);
     $_lang = $this->getModel("languages");
     $languages = $_lang->getAllLanguages(1);
     $multilang = count($languages) > 1;
     $_payments = $this->getModel("payments");
     if ($edit) {
         if (file_exists(JPATH_SITE . "/components/com_jshopping/payments/" . $payment->payment_class . "/" . $payment->payment_class . ".php")) {
             require_once JPATH_SITE . "/components/com_jshopping/payments/" . $payment->payment_class . "/" . $payment->payment_class . ".php";
             ob_start();
             $payment_class_name = $payment->payment_class;
             $_payment_method = new $payment_class_name();
             $_payment_method->showAdminFormParams($params);
             $lists['html'] = ob_get_contents();
             ob_get_clean();
         } else {
             $lists['html'] = '';
         }
     } else {
         $lists['html'] = '';
     }
     $currencyCode = getMainCurrencyCode();
     if ($jshopConfig->tax) {
         $_tax = $this->getModel("taxes");
         $all_taxes = $_tax->getAllTaxes();
         $list_tax = array();
         foreach ($all_taxes as $tax) {
             $list_tax[] = JHTML::_('select.option', $tax->tax_id, $tax->tax_name . ' (' . $tax->tax_value . '%)', 'tax_id', 'tax_name');
         }
         $list_tax[] = JHTML::_('select.option', -1, _JSHOP_PRODUCT_TAX_RATE, 'tax_id', 'tax_name');
         $lists['tax'] = JHTML::_('select.genericlist', $list_tax, 'tax_id', 'class = "inputbox"', 'tax_id', 'tax_name', $payment->tax_id);
     }
     $list_price_type = array();
     $list_price_type[] = JHTML::_('select.option', "1", $currencyCode, 'id', 'name');
     $list_price_type[] = JHTML::_('select.option', "2", "%", 'id', 'name');
     $lists['price_type'] = JHTML::_('select.genericlist', $list_price_type, 'price_type', 'class = "inputbox"', 'id', 'name', $payment->price_type);
     $nofilter = array();
     JFilterOutput::objectHTMLSafe($payment, ENT_QUOTES, $nofilter);
     $view = $this->getView("payments", 'html');
     $view->setLayout("edit");
     $view->assign('payment', $payment);
     $view->assign('edit', $edit);
     $view->assign('params', $params);
     $view->assign('lists', $lists);
     $view->assign('languages', $languages);
     $view->assign('multilang', $multilang);
     $view->assign('config', $jshopConfig);
     $view->assign('etemplatevar', '');
     JPluginHelper::importPlugin('jshoppingadmin');
     $dispatcher = JDispatcher::getInstance();
     $dispatcher->trigger('onBeforeEditPayments', array(&$view));
     $view->displayEdit();
 }
 function edit()
 {
     $jshopConfig = JSFactory::getConfig();
     $payment_id = JRequest::getInt("payment_id");
     $db = JFactory::getDBO();
     $payment = JSFactory::getTable('paymentMethod', 'jshop');
     $payment->load($payment_id);
     $parseString = new parseString($payment->payment_params);
     $params = $parseString->parseStringToParams();
     $edit = $payment_id ? $edit = 1 : ($edit = 0);
     $_lang = JSFactory::getModel("languages");
     $languages = $_lang->getAllLanguages(1);
     $multilang = count($languages) > 1;
     $_payments = JSFactory::getModel("payments");
     if ($edit) {
         $paymentsysdata = $payment->getPaymentSystemData();
         if ($paymentsysdata->paymentSystem) {
             ob_start();
             $paymentsysdata->paymentSystem->showAdminFormParams($params);
             $lists['html'] = ob_get_contents();
             ob_get_clean();
         } else {
             $lists['html'] = '';
         }
     } else {
         $lists['html'] = '';
     }
     $currencyCode = getMainCurrencyCode();
     if ($jshopConfig->tax) {
         $_tax = JSFactory::getModel("taxes");
         $all_taxes = $_tax->getAllTaxes();
         $list_tax = array();
         foreach ($all_taxes as $tax) {
             $list_tax[] = JHTML::_('select.option', $tax->tax_id, $tax->tax_name . ' (' . $tax->tax_value . '%)', 'tax_id', 'tax_name');
         }
         $list_tax[] = JHTML::_('select.option', -1, _JSHOP_PRODUCT_TAX_RATE, 'tax_id', 'tax_name');
         $lists['tax'] = JHTML::_('select.genericlist', $list_tax, 'tax_id', 'class = "inputbox"', 'tax_id', 'tax_name', $payment->tax_id);
     }
     $list_price_type = array();
     $list_price_type[] = JHTML::_('select.option', "1", $currencyCode, 'id', 'name');
     $list_price_type[] = JHTML::_('select.option', "2", "%", 'id', 'name');
     $lists['price_type'] = JHTML::_('select.genericlist', $list_price_type, 'price_type', 'class = "inputbox"', 'id', 'name', $payment->price_type);
     $payment_type = $_payments->getTypes();
     $opt = array();
     foreach ($payment_type as $key => $value) {
         $opt[] = JHTML::_('select.option', $key, $value, 'id', 'name');
     }
     if ($jshopConfig->shop_mode == 0 && $payment_id) {
         $disabled = 'disabled';
     } else {
         $disabled = '';
     }
     $lists['type_payment'] = JHTML::_('select.genericlist', $opt, 'payment_type', 'class = "inputbox" ' . $disabled, 'id', 'name', $payment->payment_type);
     $nofilter = array();
     JFilterOutput::objectHTMLSafe($payment, ENT_QUOTES, $nofilter);
     $view = $this->getView("payments", 'html');
     $view->setLayout("edit");
     $view->assign('payment', $payment);
     $view->assign('params', $params);
     $view->assign('lists', $lists);
     $view->assign('languages', $languages);
     $view->assign('multilang', $multilang);
     $view->assign('config', $jshopConfig);
     $dispatcher = JDispatcher::getInstance();
     $dispatcher->trigger('onBeforeEditPayments', array(&$view));
     $view->displayEdit();
 }