protected function getInput() { $html = ''; $fieldId = isset($this->element['id']) ? $this->element['id'] : 'jform_product_list'; $html = J2StorePopup::popup("index.php?option=com_j2store&view=coupons&task=setProducts&layout=products&tmpl=component&function=jSelectProduct&field=" . $fieldId, JText::_("J2STORE_SET_PRODUCTS"), array('width' => 800, 'height' => 400, 'class' => 'btn btn-success')); return $html; }
function getInput() { //fetchElement($name, $value, &$node, $control_name){ $app = JFactory::getApplication(); $fieldName = $this->fieldname; //get libraries $html = ''; $html .= '<table class="adminlist table j2store_itemfiles"><tr><td>'; $cid = JRequest::getVar('id'); if ($cid) { $link = 'index.php?option=com_j2store&view=products&task=setfiles&id=' . $cid . '&tmpl=component'; //let us first get Product Attribute Names $files = $this->getProductFiles($cid); if (!empty($files)) { $html .= $files; } //$html .= J2StorePopup::popup( $link, JText::_( "PLG_J2STORE_ADD_REMOVE_FILES" ), array('onclose' => '\function(){j2storeNewModal(\''.JText::_('Saving the Product Files...').'\'); Joomla.submitbutton(\'apply\');}') ); $html .= J2StorePopup::popup($link, JText::_("PLG_J2STORE_ADD_REMOVE_FILES"), array('class' => 'btn btn-success')); $html .= JText::_('PLG_J2STORE_FILES_NOTE'); // $html.='<a rel="{handler: "iframe", size: {x: 800, y: 500}}" onclick="IeCursorFix(); return false;" href="index.php?option=com_j2store&view=products&task=setfiles&id='.$cid.'&tmpl=component" title="Files" class="modal-button">Files</a>'; } else { $html .= JText::_('PLG_J2STORE_CLICK_TO_UPLOAD_FILES'); } $html .= '</td></tr></table>'; JPluginHelper::importPlugin('j2store'); //trigger plugin event $results = $app->triggerEvent('onJ2StoreAfterProductForm', array($cid)); $html .= trim(implode("\n", $results)); //echo $html.'ss';exit; return $html; }
protected function getInput() { //print_r($this); $html = ''; $fieldId = isset($this->element['id']) ? $this->element['id'] : 'jform_product_list'; $products = F0FModel::getTmpInstance('Products', 'J2StoreModel')->enabled(1)->getList(); $productarray = array(); $value = array(); $link = 'index.php?option=com_j2store&view=products&task=setProducts&tmpl=component&object=' . $this->name; $selected_value = array(); if (isset($this->value) && !empty($this->value)) { $selected_value = isset($this->value['ids']) && !empty($this->value['ids']) ? $this->value['ids'] : array(); } if (is_array($selected_value) && !empty($selected_value)) { foreach ($products as $product) { $product = J2Product::getInstance()->setId($product->j2store_product_id)->getProduct(); if (in_array($product->j2store_product_id, $selected_value)) { $productarray[$product->j2store_product_id] = $product->product_name; } } } $js = "\r\n\t\tfunction jSelectItem(id, title, object) {\r\n\t\tvar exists = jQuery('#j2store-product-li-'+id).html();\n\t\t\tif(!exists){\n\t\t\t\tvar container = jQuery('<li/>' ,{'id' :'j2store-product-li-'+id,'class':'j2store-product-list-menu'}).appendTo(jQuery('#j2store-product-item-list'));\n\t\t\t\tvar span = jQuery('<label/>',{'class':'label label-info'}).html(title).appendTo(container);\n\t\t\t\tvar input =jQuery('<input/>',{value:id, type:'hidden', name:'jform[request][j2store_item][ids][]'}).appendTo(container);\n\t\t\t\tvar remove = jQuery('<a/>',{'class':'btn btn-danger btn-mini' ,'onclick':'jQuery(this).closest(\"li\").remove();' }).html('<i class=\"icon icon-remove\"></i>').appendTo(container);\n\t\t\t\t}else{\n\t\t\t\t\talert('" . JText::_('J2STORE_PRODUCT_ALREADY_EXISTS') . "');\n\t\t\t\t}\n\t\tif(typeof(window.parent.SqueezeBox.close=='function')){\r\n\t\t\twindow.parent.SqueezeBox.close();\r\n\t\t}\r\n\t\telse {\r\n\t\t\tdocument.getElementById('sbox-window').close();\r\n\t\t\t}\r\n\t\t}\n\t\tfunction removeProductList(id){\n\t\t\tjQuery('#j2store-product-li-'+id).remove();\n\t\t}\n\t\t"; $css = '#j2store-product-item-list{ list-style:none; margin:5px; }'; JFactory::getDocument()->addScriptDeclaration($js); JFactory::getDocument()->addStyleDeclaration($css); $html .= JHTML::_('behavior.modal', 'a.modal'); $html .= '<div id="' . $fieldId . '">'; $html .= '<label class="control-label"></label>'; $html .= '<span class="input-append">'; $html .= '<input type="text" id="' . $this->name . '" name="" disabled="disabled"/>'; $html .= '<a class="modal btn btn-primary" title="' . JText::_('J2STORE_SELECT_AN_ITEM') . '" href="' . $link . '" rel="{handler: \'iframe\', size: {x: 700, y: 450}}"><i class="icon-list"></i> ' . JText::_('J2STORE_SELECT_PRODUCT') . '</a>'; $html .= J2StorePopup::popup("index.php?option=com_j2store&view=coupons&task=setProducts&layout=products&tmpl=component&function=jSelectProduct&field=" . $fieldId, JText::_("J2STORE_SET_PRODUCTS"), array('width' => 800, 'height' => 400)); $html . '</span>'; $html .= '<ul id="j2store-product-item-list" >'; foreach ($productarray as $key => $value) { $html .= '<li class="j2store-product-list-menu" id="j2store-product-li-' . $key . '">'; $html .= '<label class="label label-info">'; $html .= $value; $html .= '<input type="hidden" value="' . $key . '" name="jform[request][j2store_item][ids][]">'; $html .= '</label>'; $html .= '<a class="btn btn-danger btn-mini" onclick="removeProductList(' . $key . ');">'; $html .= '<i class="icon icon-remove"></i>'; $html .= '</a>'; $html .= '</li>'; } $html .= '</ul>'; $html .= '</div>'; return $html; }
protected function getInput() { $app = JFactory::getApplication(); $fieldName = $this->fieldname; //get libraries $html = ''; $html .= '<table class="table j2store_itemoptions"><tr><td>'; $cid = $app->input->get('id', 0); if ($cid) { $link = 'index.php?option=com_j2store&view=products&task=setpricerange&id=' . $cid . '&tmpl=component'; //let us first get Product Attribute Names $attributes = $this->getProductPriceRange($cid); if (!empty($attributes)) { $html .= $attributes; } $html .= J2StorePopup::popup($link, JText::_("J2STORE_PLG_CONTENT_PR_ADD_REMOVE_PRICERANGE"), array('class' => 'btn btn-success')); $html .= '<small>' . JText::_('J2STORE_PLG_CONTENT_PR_NOTE') . '</small>'; } else { $html .= JText::_('J2STORE_PLG_CONTENT_PR_CLICK_SAVE_FILL_RANGE'); } $html .= '</td></tr></table>'; return $html; }
if ($this->orderinfos && !empty($this->orderinfos)) { foreach ($this->orderinfos as $orderinfo) { ?> <?php $addressTable = F0FTable::getInstance('Address', 'J2StoreTable'); $addressTable->load($orderinfo->j2store_address_id); $fields = $this->fieldClass->getFields($addressTable->type, $addressTable, 'address'); ?> <li id="j2store-address-tr-<?php echo $orderinfo->j2store_address_id; ?> " class="j2store-myprofile-address-single-list well" > <ul class="j2store-myprofile-address-controls inline pull-right"> <li class="myprofile-address-control-edit"> <?php echo J2StorePopup::popup('index.php?option=com_j2store&view=myprofile&task=editAddress&layout=address&tmpl=component&address_id=' . $orderinfo->j2store_address_id, JText::_('J2STORE_EDIT'), array('update' => true, 'width' => 800, 'height' => 500)); ?> </li> <li class="myprofile-address-control-delete"> <a href="<?php echo JRoute::_('index.php?option=com_j2store&view=myprofile&task=deleteAddress&address_id=' . $orderinfo->j2store_address_id); ?> " > <?php echo JText::_('J2STORE_DELETE'); ?> </a> </li> </ul> <?php foreach ($fields as $fieldName => $oneExtraField) {
* @package J2Store * @copyright Copyright (c)2014-17 Ramesh Elamathi / J2Store.org * @license GNU GPL v3 or later */ // No direct access defined('_JEXEC') or die; ?> <div class="product-files"> <div class="control-group"> <?php echo J2Html::label(JText::_('J2STORE_SET_PRODUCT_FILES'), 'product_files_option', array('class' => 'control-label')); ?> <div class="controls"> <?php echo J2StorePopup::popup("index.php?option=com_j2store&view=products&task=setproductfiles&product_id=" . $this->item->j2store_product_id . "&layout=productfiles&tmpl=component", JText::_("J2STORE_PRODUCT_SET_FILES"), array('class' => 'btn btn-success')); ?> </div> </div> <div class="control-group"> <?php echo J2Html::label(JText::_('J2STORE_PRODUCT_FILE_DOWNLOAD_LIMIT'), 'product_files_option', array('class' => 'control-label')); ?> <div class="controls"> <?php echo J2Html::text($this->form_prefix . '[params][download_limit]', $this->item->params->get('download_limit')); ?> </div> </div> <div class="control-group">
</dd> <?php } ?> <dt> <?php echo JText::_('J2STORE_ORDER_TRANSACTION_LOG'); ?> </dt> <dd> <?php $log_url = "index.php?option=com_j2store&view=orders&task=viewtxnlog&tmpl=component&id=" . @$row->id; $text = JText::_("J2STORE_VIEW"); echo '<span class="btn">'; echo J2StorePopup::popup($log_url, $text); echo '</span>'; ?> </dd> <?php echo $selectableBase->getFormatedCustomFields($row, 'customfields', 'payment'); ?> </dl> <?php if (isset($order->event->J2StoreBeforeShippingDisplay)) { ?> <?php echo $order->event->J2StoreBeforeShippingDisplay; ?> <?php
<div class="j2store-product-pricing"> <div class="control-group"> <?php echo J2Html::label(JText::_('J2STORE_PRODUCT_REGULAR_PRICE'), 'price', array('class' => 'control-label')); ?> <?php echo J2Html::price($this->form_prefix . '[price]', $this->variant->price, array('class' => 'input')); ?> </div> <div class="control-group"> <?php echo J2Html::label(JText::_('J2STORE_PRODUCT_SET_ADVANCED_PRICING'), 'sale_price', array('class' => 'control-label')); ?> <!-- Link to advanced pricing options. Opens as a popup. --> <?php echo J2StorePopup::popup("index.php?option=com_j2store&view=products&task=setproductprice&variant_id=" . $this->variant->j2store_variant_id . "&layout=productpricing&tmpl=component", JText::_("J2STORE_PRODUCT_SET_PRICES"), array('class' => 'btn btn-success')); ?> </div> <div class="control-group"> <?php echo J2Html::label(JText::_('J2STORE_PRODUCT_PRICING_CALCULATOR'), 'price_calculator', array('class' => 'control-label')); ?> <?php //dropdown list: pre-populate it with Standard (to start with). We will extend this at a later point of time ?> <?php echo $pricing_calculator; ?> </div> </div>
echo $row->j2store_order_id; ?> ,<?php echo $row->order_id; ?> )" value="<?php echo JText::_('J2STORE_ORDER_STATUS_SAVE'); ?> " /> </td> <td> <div class="order-list-print"> <?php $url = JRoute::_("index.php?option=com_j2store&view=orders&task=printOrder&tmpl=component&order_id=" . $row->order_id); echo J2StorePopup::popup($url, JText::_("J2STORE_PRINT_INVOICE"), array('class' => 'fa fa-print btn btn-small btn-primary')); ?> </div> </td> </tr> <?php } ?> <?php } else { ?> <tr> <td colspan="10"> <?php
<td style="text-align: left;"> <a href="<?php echo $item->link; ?> "> <?php echo JText::_($item->shipping_method_name); ?> </a> <div class="shipping_rates"> <?php $id = JFactory::getApplication()->input->getInt('id', '0'); ?> <span style="float: right;"> [<?php echo J2StorePopup::popup("index.php?option=com_j2store&view=shipping&task=view&id={$id}&shippingTask=setRates&tmpl=component&sid={$item->j2store_shippingmethod_id}", JText::_('J2STORE_SHIPM_SET_RATES')); ?> ]</span> <?php if ($shipping_method_type = J2StoreShipping::getType($item->shipping_method_type)) { echo "<b>" . JText::_('J2STORE_STANDARD_SHIPPING_TYPE') . "</b>: " . JText::_($shipping_method_type->title); } if ($item->subtotal_minimum > '0') { echo "<br/><b>" . JText::_('J2STORE_SHIPPING_METHODS_MINIMUM_SUBTOTAL_REQUIRED') . "</b>: " . J2Store::currency()->format($item->subtotal_minimum); } if ($item->subtotal_maximum > '-1') { echo "<br/><b>" . JText::_('J2STORE_SHIPPING_METHODS_SUBTOTAL_MAX') . "</b>: " . J2Store::currency()->format($item->subtotal_maximum); } ?> </div> </td>
echo $this->variant->j2store_variant_id; ?> " class="btn btn-micro hasTooltip" title="" onclick="return listItemTask(<?php echo $this->variant->j2store_variant_id; ?> ,'setDefault')" href="javascript:void(0);" data-original-title="Set default"> <i class="icon-unfeatured"></i> </a> <?php } ?> </td> <td> <?php echo J2StorePopup::popup("index.php?option=com_j2store&view=products&task=setvariant&variant_id=" . $this->variant->j2store_variant_id . "&layout=variant_form&tmpl=component", JText::_("J2STORE_EDIT"), array('class' => 'btn btn-success')); ?> </td> <script type="text/javascript"> function listItemTask(id,isDefault){ //var id = jQuery("#"+input_id).attr('value'); jQuery.ajax({ url:'index.php?option=com_j2store&view=products&task=setDefaultVariant', dataType:'json', data :{'v_id' : id , 'status' : isDefault ,'product_id':<?php echo $this->variant->product_id; ?> }, success:function(json){
echo J2Html::label(JText::_('J2STORE_PRODUCT_REGULAR_PRICE'), 'price', array('class' => 'control-label')); ?> <?php echo J2Html::price($this->form_prefix . '[price]', $this->item->price, array('class' => 'input ')); ?> </div> <div class="control-group"> <?php echo J2Html::label(JText::_('J2STORE_PRODUCT_SET_ADVANCED_PRICING'), 'sale_price', array('class' => 'control-label')); ?> <?php $url = "index.php?option=com_j2store&view=products&task=setproductprice&variant_id=" . $this->item->j2store_variant_id . "&layout=productpricing&tmpl=component"; ?> <?php echo J2StorePopup::popup($url, JText::_("J2STORE_PRODUCT_SET_PRICES"), array('class' => 'btn btn-success')); ?> </div> <div class="form-group"> <?php echo J2Html::label(JText::_('J2STORE_PRODUCT_PRICING_CALCULATOR'), 'pricing_calculator', array('class' => 'control-label')); ?> <?php //dropdown list: pre-populate it with Standard (to start with). We will extend this at a later point of time ?> <?php // echo $this->pricing_calculator; //pricing options echo J2Html::select()->clearState()->type('genericlist')->name($this->form_prefix . '[pricing_calculator]')->value($this->item->pricing_calculator)->setPlaceHolders(J2Store::product()->getPricingCalculators())->getHtml(); ?> </div>
"> <?php echo $this->escape($row->shipping_method_name); ?> </a> </span> <br /> <b><?php echo JText::_('J2STORE_SHIPM_TYPE'); ?> </b>: <?php $model = $this->getModel('shippingmethods'); $row->shipping_method_type = $model->getShippingMethodType($row->shipping_method_type); echo $this->escape($row->shipping_method_type); ?> <span style="float: right"> [<?php echo J2StorePopup::popup("index.php?option=com_j2store&view=shippingmethods&task=setrates&id=" . $row->id . "&tmpl=component", JText::_("J2STORE_SHIPM_SET_RATES")); ?> ] </span> </td> <td align="center"><?php echo $published; ?> </td> </tr> <?php $k = 1 - $k; } ?>
<label class="attribute_option_label"> <?php echo JText::_('J2STORE_SEARCH_AND_ADD_VARIANT_OPTION'); ?> </label> <?php echo J2Html::text('Selectoption', '', array('id' => 'optionselector')); ?> </td> </tr> </tbody> <tfoot> <tr> <td colspan="3"> <?php echo J2StorePopup::popup("index.php?option=com_j2store&view=products&task=setpaimport&product_type=" . $this->item->product_type . "&product_id=" . $this->item->j2store_product_id . "&layout=paimport&tmpl=component", JText::_('J2STORE_IMPORT_PRODUCT_OPTIONS'), array('class' => 'btn btn-success', 'width' => 800, 'height' => 500)); ?> </td> </tr> </tfoot> </table> </div> </div> <div class="span5"> <div class="alert alert-info"> <h4><?php echo JText::_('J2STORE_QUICK_HELP'); ?> </h4> <?php echo JText::_('J2STORE_PRODUCT_OPTIONS_HELP_TEXT');
echo J2Html::hidden($this->form_prefix . '[item_options][' . $poption->j2store_productoption_id . '][j2store_productoption_id]', $poption->j2store_productoption_id); ?> <?php echo J2Html::hidden($this->form_prefix . '[item_options][' . $poption->j2store_productoption_id . '][option_id]', $poption->option_id); ?> <small>(<?php echo $poption->option_unique_name; ?> )</small> <small><?php JText::_('J2STORE_OPTION_TYPE'); echo JText::_('J2STORE_' . JString::strtoupper($poption->type)); ?> </small> <?php echo J2StorePopup::popup("index.php?option=com_j2store&view=products&task=setproductoptionvalues&product_id=" . $this->item->j2store_product_id . "&productoption_id=" . $poption->j2store_productoption_id . "&layout=productoptionvalues&tmpl=component", JText::_("J2STORE_SET_VALUES"), array()); ?> </td> <td> <span class="optionRemove" onClick="removePAOption(<?php echo $poption->j2store_productoption_id; ?> )">X</span> </td> </tr> <?php } ?> <?php } ?>
</td> <td> <span class="j2store-order-action-icons"> <span class="j2store-order-view"> <?php $viewUrl = JRoute::_('index.php?option=com_j2store&view=myprofile&task=vieworder&tmpl=component&order_id=' . $item->order_id); ?> <?php echo J2StorePopup::popup($viewUrl, '', array('class' => 'fa fa-list-alt')); ?> </span> <span class="j2store-order-print"> <?php $printUrl = JRoute::_('index.php?option=com_j2store&view=myprofile&task=printOrder&tmpl=component&order_id=' . $item->order_id); echo J2StorePopup::popup($printUrl, '', array('class' => 'fa fa-print')); ?> </span> <?php if (JFolder::exists(JPATH_LIBRARIES . '/tcpdf')) { include_once JPATH_LIBRARIES . '/tcpdf/tcpdf.php'; if (class_exists('TCPDF')) { ?> <span class="j2store-order-pdf"> <a href="<?php echo JRoute::_('index.php?option=com_j2store&view=myprofile&task=createOrderPdf&order_id=' . $item->order_id); ?> " > <i class="icon icon-download fa fa-download-alt"></i> </a>
if ($this->state->user_id) { $user_name = J2Html::getUserNameById($this->state->user_id); } ?> <div class="input-append"> <input type="text" class="input-small" name="user_name" value="<?php echo $user_name; ?> " id="jform_user_id_name" readonly="true" aria-invalid="false" /> <input type="hidden" onchange="j2storeGetAddress()" name="user_id" value="" id="jform_user_id" class="j2store-order-filters" readonly="true"/> <?php $url = 'index.php?option=com_users&view=users&layout=modal&tmpl=component&field=jform_user_id'; ?> <?php echo J2StorePopup::popup($url, '<i class="icon icon-user"></i>', array('class' => 'btn btn-primary modal_jform_created_by')); ?> </div> </div> <td> <?php echo JText::_('J2STORE_FILTER_PAYMENTS'); ?> : <?php echo J2Html::select()->clearState()->type('genericlist')->name('paykey')->value($this->state->paykey)->attribs(array('onchange' => 'this.form.submit', 'class' => 'j2store-order-filters'))->setPlaceHolders(array('' => JText::_('J2STORE_SELECT_OPTION')))->hasOne('Payments')->setRelations(array('fields' => array('key' => 'element', 'name' => 'element')))->getHtml(); ?> </td> </tr> <tr> <td colspan="2">
<td> <?php $parent_options = J2StoreHelperSelect::getParentOption($poption->j2store_productoption_id, $poption->parent_id, $poption->option_id); echo J2Html::select()->clearState()->type('genericlist')->name($this->form_prefix . '[item_options][' . $poption->j2store_productoption_id . '][parent_id]')->value($poption->parent_id)->setPlaceHolders($parent_options)->attribs(array('class' => 'input-small'))->getHtml(); ?> </td> <td> <?php if (isset($poption->type) && !in_array($poption->type, array('select', 'radio', 'checkbox'))) { ?> <?php if (isset($poption->parent_id) && !empty($poption->parent_id)) { ?> <?php echo J2StorePopup::popup("index.php?option=com_j2store&view=products&task=setparentoptionvalues&productoption_id=" . $poption->j2store_productoption_id . "&layout=parentproductopvalues&tmpl=component", JText::_("J2STORE_OPTION_PARENT_OPTION_VALUES"), array()); ?> <?php } ?> <?php } ?> </td> <td> <?php echo J2Html::select()->clearState()->type('genericlist')->name($this->form_prefix . '[item_options][' . $poption->j2store_productoption_id . '][required]')->value($poption->required)->setPlaceHolders(array('0' => JText::_('J2STORE_NO'), '1' => JText::_('J2STORE_YES')))->attribs(array('class' => 'input-small'))->getHtml(); ?> </td>