$data['available_shippingcost_method_box'][$sids] = mslib_fe::currency() . ' +' . mslib_fe::amount2Cents($priceArray['shipping_costs_method_box_including_vat'], 0, 0); } else { if ($priceArray['shipping_costs_including_vat'] < 0) { $data['available_shippingcost'][$sids] = mslib_fe::currency() . ' -' . mslib_fe::amount2Cents($priceArray['shipping_costs_including_vat'], 0, 0); $data['available_shippingcost_method_box'][$sids] = mslib_fe::currency() . ' -' . mslib_fe::amount2Cents($priceArray['shipping_costs_method_box_including_vat'], 0, 0); } } } else { $data['available_shippingcost'][$sids] = ''; if ($priceArray['shipping_costs'] > 0 || $this->ms['MODULES']['ALWAYS_DISPLAY_SHIPPING_COSTS'] > 0) { $data['available_shippingcost'][$sids] = mslib_fe::currency() . ' +' . mslib_fe::amount2Cents($priceArray['shipping_costs'], 0, 0); $data['available_shippingcost_method_box'][$sids] = mslib_fe::currency() . ' +' . mslib_fe::amount2Cents($priceArray['shipping_costs_method_box'], 0, 0); } else { if ($priceArray['shipping_costs'] < 0) { $data['available_shippingcost'][$sids] = mslib_fe::currency() . ' -' . mslib_fe::amount2Cents($priceArray['shipping_costs'], 0, 0); $data['available_shippingcost_method_box'][$sids] = mslib_fe::currency() . ' -' . mslib_fe::amount2Cents($priceArray['shipping_costs_method_box'], 0, 0); } } } } // we display the shipping costs and payment costs including vat if ($this->ms['MODULES']['PRODUCT_EDIT_METHOD_FILTER'] && !$this->post['tx_multishop_pi1']['sid']) { if (count($available_sid) == 1) { $this->post['tx_multishop_pi1']['sid'] = $available_sid[0]; } else { // set to unreachable number for shipping method id so the session for shipping method are cleared $this->post['tx_multishop_pi1']['sid'] = 999999; } } $data['shipping_preselected_id'] = $this->post['tx_multishop_pi1']['sid']; $this->post['caller_segment'] = 'getHtmlCartContents';
if (!count($plugins_extra_tab['tabs_header']) && !count($plugins_extra_tab['tabs_content'])) { $subpartArray['###LABEL_EXTRA_PLUGIN_TABS###'] = ''; $subpartArray['###CONTENT_EXTRA_PLUGIN_TABS###'] = ''; } else { $subpartArray['###LABEL_EXTRA_PLUGIN_TABS###'] = implode("\n", $plugins_extra_tab['tabs_header']); $subpartArray['###CONTENT_EXTRA_PLUGIN_TABS###'] = implode("\n", $plugins_extra_tab['tabs_content']); } $subpartArray['###ADMIN_LABEL_JS_PLEASE_SELECT_CATEGORY_FOR_THIS_PRODUCT###'] = $this->pi_getLL('admin_label_js_please_select_category_for_this_product'); $subpartArray['###ADMIN_LABEL_JS_PRODUCT_NAME_IS_EMPTY###'] = addslashes(htmlspecialchars($this->pi_getLL('admin_label_js_product_name_is_empty'))); $subpartArray['###ADMIN_LABEL_JS_DEFINE_PRODUCT_NAME_FIRST_IN_DETAILS_TABS###'] = addslashes(htmlspecialchars($this->pi_getLL('admin_label_js_define_product_name_first_in_details_tabs'))); $subpartArray['###ADMIN_LABEL_PRODUCT_NOT_LOADED_SORRY_WE_CANT_FIND_IT###'] = $this->pi_getLL('admin_label_product_not_loaded_sorry_we_cant_find_it'); if (!$this->ms['MODULES']['DISPLAY_MANUFACTURERS_ADVICE_PRICE_INPUT']) { $subpartArray['###MANUFACTURERS_ADVICE_PRICE###'] = ''; } else { $manufacturers_advice_price_tax = mslib_fe::taxDecimalCrop($product['manufacturers_advice_price'] * $product_tax_rate / 100); $manufacturers_advice_price_excl_vat_display = mslib_fe::taxDecimalCrop($product['manufacturers_advice_price'], 2, false); $manufacturers_advice_price_incl_vat_display = mslib_fe::taxDecimalCrop($product['manufacturers_advice_price'] + $manufacturers_advice_price_tax, 2, false); $subpartArray['###LABEL_MANUFACTURERS_ADVIES_PRICE###'] = $this->pi_getLL('admin_label_manufacturers_advice_price'); $subpartArray['###LABEL_EXCLUDING_VAT3###'] = $this->pi_getLL('excluding_vat'); $subpartArray['###LABEL_INCLUDING_VAT3###'] = $this->pi_getLL('including_vat'); $subpartArray['###LABEL_CURRENCY6###'] = mslib_fe::currency(); $subpartArray['###LABEL_CURRENCY7###'] = mslib_fe::currency(); $subpartArray['###VALUE_EXCL_VAT_MANUFACTURERS_ADVICE_PRICE###'] = $manufacturers_advice_price_excl_vat_display; $subpartArray['###VALUE_INCL_VAT_MANUFACTURERS_ADVICE_PRICE###'] = $manufacturers_advice_price_incl_vat_display; $subpartArray['###VALUE_ORIGINAL_MANUFACTURERS_ADVICE_PRICE###'] = $product['manufacturers_advice_price']; } $content .= $this->cObj->substituteMarkerArrayCached($subparts['template'], array(), $subpartArray); } else { $content .= $this->pi_getLL('admin_label_product_not_loaded_sorry_we_cant_find_it'); } }
$markerArray['CHECKBOX_COUNTER0'] = $s; $markerArray['CHECKBOX_COUNTER1'] = $s; $markerArray['CELL_NUMBER'] = $p * $this->ms['MODULES']['PRODUCTS_LISTING_LIMIT'] + $s + 1; $markerArray['PRODUCT_NAME'] = $rs['products_name'] ? $rs['products_name'] : $this->pi_getLL('no_name'); $markerArray['PRODUCT_CATEGORIES_CRUMBAR'] = $cat_crumbar; $markerArray['PRODUCT_MODEL'] = $rs['products_model']; $markerArray['PRODUCT_STATUS'] = $status; $markerArray['LINK_EDIT_CAT'] = $link_edit_cat; $markerArray['CATEGORY_NAME'] = $rs['categories_name']; $markerArray['VALUE_TAX_ID'] = $rs['tax_id']; $markerArray['CURRENCY0'] = mslib_fe::currency(); $markerArray['CURRENCY1'] = mslib_fe::currency(); $markerArray['CURRENCY2'] = mslib_fe::currency(); $markerArray['CURRENCY3'] = mslib_fe::currency(); $markerArray['CURRENCY4'] = mslib_fe::currency(); $markerArray['CURRENCY5'] = mslib_fe::currency(); $markerArray['SUFFIX_PRICE_EXCL_VAT'] = $this->pi_getLL('excluding_vat'); $markerArray['SUFFIX_PRICE_INCL_VAT'] = $this->pi_getLL('including_vat'); $markerArray['SUFFIX_SPECIAL_PRICE_EXCL_VAT'] = $this->pi_getLL('excluding_vat'); $markerArray['SUFFIX_SPECIAL_PRICE_INCL_VAT'] = $this->pi_getLL('including_vat'); $markerArray['SUFFIX_CAPITAL_PRICE_EXCL_VAT'] = $this->pi_getLL('excluding_vat'); $markerArray['SUFFIX_CAPITAL_PRICE_INCL_VAT'] = $this->pi_getLL('including_vat'); $markerArray['VALUE_PRICE_EXCL_VAT'] = htmlspecialchars($product_price_display); $markerArray['VALUE_PRICE_INCL_VAT'] = htmlspecialchars($product_price_display_incl); $markerArray['VALUE_ORIGINAL_PRICE'] = $rs['products_price']; $markerArray['VALUE_SPECIAL_PRICE_EXCL_VAT'] = htmlspecialchars($special_price_display); $markerArray['VALUE_SPECIAL_PRICE_INCL_VAT'] = htmlspecialchars($special_price_display_incl); $markerArray['VALUE_ORIGINAL_SPECIAL_PRICE'] = $rs['specials_new_products_price']; $markerArray['VALUE_CAPITAL_PRICE_EXCL_VAT'] = htmlspecialchars($capital_price_display); $markerArray['VALUE_CAPITAL_PRICE_INCL_VAT'] = htmlspecialchars($capital_price_display_incl); $markerArray['VALUE_ORIGINAL_CAPITAL_PRICE'] = $rs['product_capital_price'];
$free_shippingcosts = 0; $fsc_price_display = 0; $fsc_price_display_incl = 0; if (!empty($row3['override_shippingcosts'])) { $freeshippingcosts_above = true; list($free_shippingcosts, ) = explode(':', $row3['override_shippingcosts']); $fsc_tax = mslib_fe::taxDecimalCrop($free_shippingcosts * $sc_tax_rate / 100); $fsc_price_display = mslib_fe::taxDecimalCrop($free_shippingcosts, 2, false); $fsc_price_display_incl = mslib_fe::taxDecimalCrop($free_shippingcosts + $fsc_tax, 2, false); } $content .= '<hr> <div class="form-group"> <label id="' . $zone_pid . '_NivLevel' . $i . '" class="control-label col-md-4 secondLabel"><div class="checkbox checkbox-success"><input type="checkbox" name="freeshippingcostsabove[' . $zone_pid . ']" id="freeshippingcostsabove[' . $zone_pid . ']" value="1"' . ($freeshippingcosts_above ? ' checked="checked"' : '') . ' /><label for="freeshippingcostsabove[' . $zone_pid . ']">' . $this->pi_getLL('free_shippingcosts_for_order_amount_above') . '</label></div></label> <div class="col-md-8"> <div class="msAttributesField"><div class="input-group"><span class="input-group-addon">' . mslib_fe::currency() . '</span><input type="text" id="display_name" name="display_name" class="form-control msProductsPriceExcludingVat priceInputDisplay" value="' . htmlspecialchars($fsc_price_display) . '" rel="' . $row['id'] . '" autocomplete="off"><span class="input-group-addon">' . $this->pi_getLL('excluding_vat') . '</span></div></div> <div class="msAttributesField"><div class="input-group"><span class="input-group-addon">' . mslib_fe::currency() . '</span><input type="text" name="display_name" id="display_name" class="form-control msProductsPriceIncludingVat priceInputDisplay" value="' . htmlspecialchars($fsc_price_display_incl) . '" rel="' . $row['id'] . '" autocomplete="off"><span class="input-group-addon">' . $this->pi_getLL('including_vat') . '</span></div></div> <div class="msAttributesField hidden"><input type="hidden" style="text-align:right" size="3" name="freeshippingcostsabove_value[' . $zone_pid . ']" class="priceInputReal" value="' . $free_shippingcosts . '"></div> </div> </div> '; $content .= '</div>'; $content .= '<script type="text/javascript">'; $content .= "</script>"; $content .= '</div>'; //break; $zone_index++; } //end for weight based } else { // hook to process custom visual shipping cost type if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/scripts/admin_pages/admin_shipping_cost.php']['processZoneShippingCostType'])) {
$tmpcontent .= '<tr><td colspan="' . $colspan . '" style="text-align:left;"><a href="#" id="button_manual_new_product" class="btn btn-success">' . $this->pi_getLL('add_manual_product', 'ADD ITEM') . '</a></td></tr>'; } } else { $colspan = 7; } // $tmpcontent.='<tr><td colspan="'.$colspan.'"><hr class="hr"></td></tr>'; $orders_tax_data = unserialize($orders['orders_tax_data']); $tmpcontent .= '<tr><td align="right" colspan="' . $colspan . '" class="">'; if ($this->ms['MODULES']['ORDER_EDIT'] and !$orders['is_locked']) { $payment_method = mslib_fe::getPaymentMethod($orders['payment_method'], 'p.code'); $shipping_method = mslib_fe::getShippingMethod($orders['shipping_method'], 's.code'); if ($this->ms['MODULES']['SHOW_PRICES_INCLUDING_VAT']) { $shipping_costs = mslib_fe::currency() . ' <input type="text" id="display_shipping_method_cost" value="' . round($orders['shipping_method_costs'] + $orders_tax_data['shipping_tax'], 4) . '" class="align_right" style="width:60px"> <input name="tx_multishop_pi1[shipping_method_costs]" type="hidden" value="' . $orders['shipping_method_costs'] . '"> <input type="hidden" id="shipping_method_tax_id" value="' . $shipping_method['tax_id'] . '" class="align_right" style="width:60px">'; $payment_costs = mslib_fe::currency() . ' <input type="text" id="display_payment_method_cost" value="' . round($orders['payment_method_costs'] + $orders_tax_data['payment_tax'], 4) . '" class="align_right" style="width:60px"> <input name="tx_multishop_pi1[payment_method_costs]" type="hidden" value="' . $orders['payment_method_costs'] . '"> <input type="hidden" id="payment_method_tax_id" value="' . $payment_method['tax_id'] . '" class="align_right" style="width:60px"> '; } else { $shipping_costs = '<input name="tx_multishop_pi1[shipping_method_costs]" type="text" value="' . round($orders['shipping_method_costs'], 4) . '" class="align_right" style="width:60px">'; $payment_costs = '<input name="tx_multishop_pi1[payment_method_costs]" type="text" value="' . round($orders['payment_method_costs'], 4) . '" class="align_right" style="width:60px">'; } } else { if ($this->ms['MODULES']['SHOW_PRICES_INCLUDING_VAT']) { $shipping_costs = mslib_fe::amount2Cents($orders['shipping_method_costs'] + $orders_tax_data['shipping_tax'], 0); $payment_costs = mslib_fe::amount2Cents($orders['payment_method_costs'] + $orders_tax_data['payment_tax'], 0); } else { $shipping_costs = mslib_fe::amount2Cents($orders['shipping_method_costs'], 0); $payment_costs = mslib_fe::amount2Cents($orders['payment_method_costs'], 0); }
<option value="amount" selected="selected">amount</option> <option value="percentage">percentage</option> </select> </div> </div> <div class="form-group" id="handling_cost_percentage_div" style="display:none"> <label class="control-label col-md-2">' . $this->pi_getLL('handling_costs') . '</label> <div class="col-md-10"> <input class="form-control" name="handling_costs" id="handling_cost_percentage_input" type="text" value="0%" disabled="disabled" /> </div> </div> <div class="form-group" id="handling_cost_amount_div"> <label class="control-label col-md-2">' . $this->pi_getLL('handling_costs') . '</label> <div class="col-md-10"> <div class="msAttributesField"><div class="input-group"><span class="input-group-addon">' . mslib_fe::currency() . ' </span><input type="text" id="display_name" name="display_name" class="form-control msHandlingCostExcludingVat priceInputDisplay" value="0.00" autocomplete="off"><span class="input-group-addon">' . $this->pi_getLL('excluding_vat') . '</span></div></div> <div class="msAttributesField"><div class="input-group"><span class="input-group-addon">' . mslib_fe::currency() . ' </span><input type="text" name="display_name" id="display_name" class="form-control msHandlingCostIncludingVat priceInputDisplay" value="0.00" autocomplete="off"><span class="input-group-addon">' . $this->pi_getLL('including_vat') . '</span></div></div> <div class="msAttributesField hidden"><input name="handling_costs" id="handling_cost_amount_input" class="priceInputReal" type="hidden" value="0" /></div> </div> </div> <div class="form-group"> <label for="tax_id" class="control-label col-md-2">' . $this->pi_getLL('admin_vat_rate') . '</label> <div class="col-md-10"> <select name="tax_id" id="tax_id" class="form-control"> <option value="0">' . $this->pi_getLL('admin_label_no_tax') . '</option>'; $str = "SELECT trg.*, t.rate FROM `tx_multishop_tax_rule_groups` trg, `tx_multishop_tax_rules` tr, `tx_multishop_taxes` t where trg.rules_group_id=tr.rules_group_id and tr.tax_id=t.tax_id group by trg.rules_group_id order by trg.rules_group_id asc"; $qry = $GLOBALS['TYPO3_DB']->sql_query($str); $tax_list_data = array(); while (($tax_group = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($qry)) != false) { $tax_list_data[] = 'product_tax_rate_list_js["' . $tax_group['rules_group_id'] . '"]="' . round(number_format($tax_group['rate'], 2), 2) . '"'; if (!$this->get['payment_method_id']) { $tmpcontent .= '<option value="' . $tax_group['rules_group_id'] . '" ' . ($tax_group['default_status'] ? 'selected' : '') . '>' . htmlspecialchars($tax_group['name']) . '</option>';
public function showAttributes($products_id, $add_tax_rate = '', $sessionData = array(), $readonly = 0, $hide_prices = 0, $returnAsArray = 0, $skipHiddenInCartAttributes = 0) { if (!is_numeric($products_id)) { return false; } //hook to let other plugins further manipulate the query if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/pi1/classes/class.mslib_fe.php']['showAttributesOptionNamesPreProc'])) { $params = array('this' => &$this, 'products_id' => &$products_id, 'readonly' => &$readonly, 'hide_prices' => &$hide_prices, 'sessionData' => &$sessionData); foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/pi1/classes/class.mslib_fe.php']['showAttributesOptionNamesPreProc'] as $funcRef) { \TYPO3\CMS\Core\Utility\GeneralUtility::callUserFunction($funcRef, $params, $this); } } $required_formfields = array(); if (!$this->ms['MODULES']['SHOW_PRICES_INCLUDING_VAT']) { $add_tax_rate = ''; } if (!$sessionData) { $sessionData = $GLOBALS['TSFE']->fe_user->getKey('ses', $this->cart_page_uid); $sessionData = $sessionData['products'][$this->get['tx_multishop_pi1']['cart_item']]; } $option_value_counter = 0; $query_array = array(); $query_array['select'][] = 'popt.required'; $query_array['select'][] = 'popt.products_options_id'; $query_array['select'][] = 'popt.products_options_name'; $query_array['select'][] = 'popt.listtype'; $query_array['select'][] = 'popt.hide'; $query_array['from'][] = 'tx_multishop_products_options popt'; $query_array['from'][] = 'tx_multishop_products_attributes patrib'; $query_array['where'][] = 'patrib.products_id=\'' . (int) $products_id . '\''; $query_array['where'][] = 'patrib.page_uid=\'' . (int) $this->showCatalogFromPage . '\''; $query_array['where'][] = 'popt.language_id = \'' . $this->sys_language_uid . '\''; //todo: hide_in_cart line should be enabled, but im not sure if it will cause bugs in other plugins so temporary disabled it //$query_array['where'][]='(popt.hide_in_cart=0 or popt.hide_in_cart is null)'; $query_array['group_by'][] = 'popt.products_options_id'; $query_array['order_by'][] = 'patrib.sort_order_option_name asc, patrib.sort_order_option_value asc'; if ($skipHiddenInCartAttributes) { $query_array['where'][] = 'popt.hide_in_cart=0'; } //hook to let other plugins further manipulate the query if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/pi1/classes/class.mslib_fe.php']['showAttributesOptionNamesQuery'])) { $params = array('this' => &$this, 'products_id' => $products_id, 'query_array' => &$query_array); foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/pi1/classes/class.mslib_fe.php']['showAttributesOptionNamesQuery'] as $funcRef) { \TYPO3\CMS\Core\Utility\GeneralUtility::callUserFunction($funcRef, $params, $this); } } $query_array['where'][] = 'patrib.options_id = popt.products_options_id'; $str = $GLOBALS['TYPO3_DB']->SELECTquery(is_array($query_array['select']) ? implode(",", $query_array['select']) : '', is_array($query_array['from']) ? implode(",", $query_array['from']) : '', is_array($query_array['where']) ? implode(" and ", $query_array['where']) : '', is_array($query_array['group_by']) ? implode(",", $query_array['group_by']) : '', is_array($query_array['order_by']) ? implode(",", $query_array['order_by']) : '', is_array($query_array['limit']) ? implode(",", $query_array['limit']) : ''); $qry = $GLOBALS['TYPO3_DB']->sql_query($str); $total_rows = $GLOBALS['TYPO3_DB']->sql_num_rows($qry); if ($returnAsArray) { $returnAsArrayData = array(); if ($total_rows > 0) { while ($options = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($qry)) { $returnAsArrayData[$options['products_options_id']] = $options; // now get the values $str = $GLOBALS['TYPO3_DB']->SELECTquery('pov.products_options_values_id, pov.products_options_values_name, pa.options_values_price, pa.options_values_id, pa.price_prefix', 'tx_multishop_products_attributes pa, tx_multishop_products_options_values pov, tx_multishop_products_options_values_to_products_options povp', 'pa.products_id = \'' . (int) $products_id . '\' and pa.options_id = \'' . $options['products_options_id'] . '\' and pa.page_uid = \'' . $this->showCatalogFromPage . '\' and pov.language_id = \'' . $this->sys_language_uid . '\' and pa.options_values_id = pov.products_options_values_id and povp.products_options_id=\'' . $options['products_options_id'] . '\' and povp.products_options_values_id=pov.products_options_values_id', '', 'pa.sort_order_option_value asc', ''); $products_options = $GLOBALS['TYPO3_DB']->sql_query($str); $total_values = $GLOBALS['TYPO3_DB']->sql_num_rows($products_options); if ($total_values) { while ($products_options_values = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($products_options)) { $returnAsArrayData[$options['products_options_id']]['values'][] = $products_options_values; } } } } return $returnAsArrayData; } if ($total_rows > 0) { $output = ''; $output_html = array(); $next_index = 0; $index_key = 0; while ($options = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($qry)) { $warning_holder = ''; if (!$options['hide']) { $load_default = 0; switch ($options['listtype']) { case 'divider': $output_html[$options['products_options_id']] .= '<div class="opties-field-attribute' . $options['products_options_id'] . ' opties-field-radio opties-field-divider" id="attribute_item_wrapper_' . $options['products_options_id'] . '"> <label></label> <div class="hr"></div> </div>'; $load_default = 0; break; case 'date': case 'datetime': $output_html[$options['products_options_id']] .= '<div class="opties-field-attribute' . $options['products_options_id'] . ' opties-field-radio opties-field-input" id="attribute_item_wrapper_' . $options['products_options_id'] . '"> <label>' . $options['products_options_name'] . ':</label> <div class="attribute_item_wrapper"> <input type="text" name="attributes[' . $options['products_options_id'] . ']" class="' . ($options['listtype'] == 'date' ? 'attributeDate' : 'attributeDateTime') . '" id="attributes' . $options['products_options_id'] . '" value="' . $sessionData['attributes'][$options['products_options_id']]['products_options_values_name'] . '" ' . ($options['required'] ? 'required="required"' : '') . ' /> </div> </div>'; $load_default = 0; break; case 'dateofbirth': case 'datecustom': $output_html[$options['products_options_id']] .= '<div class="opties-field-attribute' . $options['products_options_id'] . ' opties-field-radio opties-field-input" id="attribute_item_wrapper_' . $options['products_options_id'] . '"> <label>' . $options['products_options_name'] . ':</label> <div class="attribute_item_wrapper"> <input type="text" name="attributes[' . $options['products_options_id'] . ']" class="' . ($options['listtype'] == 'dateofbirth' ? 'attributeDateOfBirth' : 'attributeDateCustom') . '" id="attributes' . $options['products_options_id'] . '" value="' . $sessionData['attributes'][$options['products_options_id']]['products_options_values_name'] . '" ' . ($options['required'] ? 'required="required"' : '') . ' /> </div> </div>'; $load_default = 0; break; case 'input': $output_html[$options['products_options_id']] .= '<div class="opties-field-attribute' . $options['products_options_id'] . ' opties-field-radio opties-field-input" id="attribute_item_wrapper_' . $options['products_options_id'] . '"> <label>' . $options['products_options_name'] . ':</label> <div class="attribute_item_wrapper"> <input type="text" name="attributes[' . $options['products_options_id'] . ']" id="attributes' . $options['products_options_id'] . '" value="' . $sessionData['attributes'][$options['products_options_id']]['products_options_values_name'] . '" ' . ($options['required'] ? 'required="required"' : '') . ' /> </div> </div>'; $load_default = 0; break; case 'textarea': $output_html[$options['products_options_id']] .= '<div class="opties-field-attribute' . $options['products_options_id'] . ' opties-field-radio opties-field-textarea" id="attribute_item_wrapper_' . $options['products_options_id'] . '"> <label>' . $options['products_options_name'] . ':</label> <div class="attribute_item_wrapper"> <textarea name="attributes[' . $options['products_options_id'] . ']" id="attributes' . $options['products_options_id'] . '" ' . ($options['required'] ? 'required="required"' : '') . '>' . htmlspecialchars($sessionData['attributes'][$options['products_options_id']]['products_options_values_name']) . '</textarea> </div> </div>'; $load_default = 0; break; case 'hidden_field': $output_html[$options['products_options_id']] .= '<div class="opties-field-attribute' . $options['products_options_id'] . ' opties-field-radio opties-field-textarea" id="attribute_item_wrapper_' . $options['products_options_id'] . '"> <input type="hidden" name="attributes[' . $options['products_options_id'] . ']" id="attributes' . $options['products_options_id'] . '" value="' . $sessionData['attributes'][$options['products_options_id']]['products_options_values_name'] . '" /> </div>'; $load_default = 0; break; case 'file': $output_html[$options['products_options_id']] .= '<div class="opties-field-attribute' . $options['products_options_id'] . ' opties-field-radio opties-field-input" id="attribute_item_wrapper_' . $options['products_options_id'] . '"> <label>' . $options['products_options_name'] . ':</label> <div class="attribute_item_wrapper"> <input type="file" name="attributes[' . $options['products_options_id'] . ']" id="attributes' . $options['products_options_id'] . '" ' . ($options['required'] ? 'required="required"' : '') . ' /> </div> </div>'; $load_default = 0; break; case 'radio': $class = 'opties-field-attribute' . $options['products_options_id'] . ' opties-field-radio'; $warning_holder = '<div class="required-warning-box required-warning' . $options['products_options_id'] . '" style="display:none"></div>'; $load_default = 1; break; case 'checkbox': $class = 'opties-field-attribute' . $options['products_options_id'] . ' opties-field-radio opties-field-checkbox'; $warning_holder = '<div class="required-warning-box required-warning' . $options['products_options_id'] . '" style="display:none"></div>'; $load_default = 1; break; default: $load_default = 1; break; } //hook to let other plugins further manipulate the listypes if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/pi1/classes/class.mslib_fe.php']['showAttributesOptionNameItemHook'])) { $params = array('load_default' => &$load_default, 'products_id' => $products_id, 'options' => &$options, 'class' => &$class, 'output_html' => &$output_html); foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/pi1/classes/class.mslib_fe.php']['showAttributesOptionNameItemHook'] as $funcRef) { \TYPO3\CMS\Core\Utility\GeneralUtility::callUserFunction($funcRef, $params, $this); } } if ($load_default) { $load_default = 1; $class = 'opties-field-attribute' . $options['products_options_id'] . ' opties-field-radio'; } if ($load_default) { if ($readonly) { $output_html[$options['products_options_id']] .= '<ul>'; } $attribute_value_image_select = ''; if ($this->ms['MODULES']['ENABLE_ATTRIBUTE_VALUE_IMAGES']) { $attribute_value_image_select = ', pa.attribute_image as attribute_local_image, povp.products_options_values_image as attribute_global_image'; } // now get the values $str = $GLOBALS['TYPO3_DB']->SELECTquery('pov.products_options_values_id, pov.products_options_values_name, pa.options_values_price, pa.options_values_id, pa.price_prefix' . $attribute_value_image_select, 'tx_multishop_products_attributes pa, tx_multishop_products_options_values pov, tx_multishop_products_options_values_to_products_options povp', 'pa.products_id = \'' . (int) $products_id . '\' and pa.options_id = \'' . $options['products_options_id'] . '\' and pa.page_uid = \'' . $this->showCatalogFromPage . '\' and pov.language_id = \'' . $this->sys_language_uid . '\' and pa.options_values_id = pov.products_options_values_id and povp.products_options_id=\'' . $options['products_options_id'] . '\' and povp.products_options_values_id=pov.products_options_values_id', '', 'pa.sort_order_option_value asc', ''); $products_options = $GLOBALS['TYPO3_DB']->sql_query($str); $total_values = $GLOBALS['TYPO3_DB']->sql_num_rows($products_options); if (!$readonly) { $output_html[$options['products_options_id']] .= '<div class="' . $class . '" id="attribute_item_wrapper_' . $options['products_options_id'] . '"><label>' . $options['products_options_name'] . ':</label>' . $warning_holder . '<div class="attribute_item_wrapper">'; } else { $output_html[$options['products_options_id']] .= '<li><label>' . $options['products_options_name'] . ':</label>'; } // SHOW_ATTRIBUTE_DESCRIPTION if (SHOW_ATTRIBUTE_DESCRIPTION && !empty($products_options_name_values['description'])) { $output_html[$options['products_options_id']] .= $products_options_name_values['description'] . "<br/>"; } $opt = 0; $next_index++; $next_index2 = 0; $items = ''; $options_values = array(); $value_counter = 1; while ($products_options_values = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($products_options)) { $value_desc = ''; $str_val_desc = "SELECT povdesc.* from tx_multishop_products_options_values_to_products_options_desc povdesc, tx_multishop_products_options_values_to_products_options povpo where povdesc.products_options_values_to_products_options_id=povpo.products_options_values_to_products_options_id and povpo.products_options_id='" . (int) $options['products_options_id'] . "' and povpo.products_options_values_id='" . $products_options_values['options_values_id'] . "' and povdesc.language_id='" . $this->sys_language_uid . "'"; $qry_val_desc = $GLOBALS['TYPO3_DB']->sql_query($str_val_desc); if ($GLOBALS['TYPO3_DB']->sql_num_rows($qry_val_desc) > 0) { $row_val_desc = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($qry_val_desc); if (!empty($row_val_desc['description'])) { $value_desc = htmlspecialchars('<div class="valuesdesc_info">' . $row_val_desc['description'] . '</div>'); $value_desc = ' <a href="#" data-placement="left" class="values_desc_tooltip" title="' . $value_desc . '"><span class="glyphicon glyphicon-info-sign" aria-hidden="true"></span></a>'; } } $options_values[] = $products_options_values; $attribute_value_image = ''; if ($this->ms['MODULES']['ENABLE_ATTRIBUTE_VALUE_IMAGES']) { $products_options_values['attribute_image'] = ''; if (!empty($products_options_values['attribute_local_image'])) { $products_options_values['attribute_image'] = $products_options_values['attribute_local_image']; } else { if (!empty($products_options_values['attribute_global_image'])) { $products_options_values['attribute_image'] = $products_options_values['attribute_global_image']; } } if (!empty($products_options_values['attribute_image'])) { $image_alt = $options['products_options_name'] . ': ' . $products_options_values['products_options_values_name']; if ($products_options_values['options_values_price'] != '0') { $image_alt .= ' ' . $products_options_values['price_prefix'] . ' ' . mslib_fe::currency() . mslib_fe::amount2Cents2($products_options_values['options_values_price']); } $tooltips_attribute_image = htmlspecialchars('<div class="valuesdesc_info"><img src="' . mslib_befe::getImagePath($products_options_values['attribute_image'], 'attribute_values', 'small') . '" />'); $attribute_value_image = '<a href="#" data-placement="left" class="values_desc_tooltip" title="' . $tooltips_attribute_image . '"><img src="' . mslib_befe::getImagePath($products_options_values['attribute_image'], 'attribute_values', 'small') . '" alt="' . $image_alt . '" class="attribute_value_images" width="20px" height="20px" /></a>'; } } // hook for manipulating the $products_options_values array // hook to let other plugins further manipulate the option values display if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/pi1/classes/class.mslib_fe.php']['attributesArray'])) { $params = array('options' => &$options, 'products_options_values' => &$products_options_values, 'products_id' => &$products_id); foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/pi1/classes/class.mslib_fe.php']['attributesArray'] as $funcRef) { \TYPO3\CMS\Core\Utility\GeneralUtility::callUserFunction($funcRef, $params, $this); } } // hook if ($hide_prices) { $products_options_values['options_values_price'] = 0; } $option_value_counter++; if ($add_tax_rate) { // add vat $products_options_values['options_values_price'] = round($products_options_values['options_values_price'] * (1 + $add_tax_rate), 2); } // print_r($products_options_values); if (!$readonly) { if ($total_values < 2 and $options['listtype'] != 'checkbox') { $label = '<span class="attributes-values">' . $products_options_values['products_options_values_name'] . '</span>'; if ($products_options_values['options_values_price'] != '0') { $label .= ' (' . $products_options_values['price_prefix'] . ' ' . mslib_fe::currency() . mslib_fe::amount2Cents2($products_options_values['options_values_price']) . ')'; } $output_html[$options['products_options_id']] .= "\n" . $label . '<input name="attributes[' . $options['products_options_id'] . ']" id="attributes' . $options['products_options_id'] . '" type="hidden" value="' . $products_options_values['products_options_values_id'] . '" /></li>'; } else { switch ($options['listtype']) { case 'radio': $items .= "\n" . ' <div class="attribute_item" id="attribute_item_wrapper_' . $options['products_options_id'] . '_' . $products_options_values['products_options_values_id'] . '"> <div class="radio radio-success radio-inline"> <input name="attributes[' . $options['products_options_id'] . ']" id="attributes' . $options['products_options_id'] . '_' . $option_value_counter . '" type="radio" value="' . $products_options_values['products_options_values_id'] . '"'; if (count($sessionData['attributes'][$options['products_options_id']])) { foreach ($sessionData['attributes'] as $options_id => $item) { if ($options_id == $options['products_options_id']) { if ($item['products_options_values_id'] == $products_options_values['products_options_values_id']) { $items .= ' checked="checked"'; } } } } else { if ($value_counter === 1 && !$options['required']) { $items .= ' checked="checked"'; } } $items .= ' class="attributes' . $options['products_options_id'] . ' attribute-value-radio" ' . ($options['required'] ? 'required="required"' : '') . ' data-sort="' . $index_key . '" rel="attributes' . $options['products_options_id'] . '" /> <label for="attributes' . $options['products_options_id'] . '_' . $option_value_counter . '"> ' . $attribute_value_image . ' <span class="attribute_value_label">' . $products_options_values['products_options_values_name'] . $value_desc . '</span> </label> <div class="attribute_item_price">'; if ($products_options_values['options_values_price'] != '0') { $items .= $products_options_values['price_prefix'] . ' ' . mslib_fe::currency() . mslib_fe::amount2Cents2($products_options_values['options_values_price']); } $items .= '</div></div></div>'; break; case 'checkbox': $items .= "\n" . ' <div class="attribute_item" id="attribute_item_wrapper_' . $options['products_options_id'] . '_' . $products_options_values['products_options_values_id'] . '"> <div class="checkbox checkbox-success checkbox-inline"> <input name="attributes[' . $options['products_options_id'] . '][]" id="attributes' . $options['products_options_id'] . '_' . $option_value_counter . '" type="checkbox" value="' . $products_options_values['products_options_values_id'] . '"'; if (count($sessionData['attributes'][$options['products_options_id']])) { foreach ($sessionData['attributes'][$options['products_options_id']] as $item) { if ($item['products_options_values_id'] == $products_options_values['products_options_values_id']) { $items .= ' checked'; } } } $items .= ' class="attributes' . $options['products_options_id'] . ' PrettyInput attribute-value-checkbox" data-sort="' . $index_key . '" rel="attributes' . $options['products_options_id'] . '" /> <label for="attributes' . $options['products_options_id'] . '_' . $option_value_counter . '"> ' . $attribute_value_image . ' <span class="attribute_value_label">' . $products_options_values['products_options_values_name'] . '</span> </label> <div class="attribute_item_price">'; if ($products_options_values['options_values_price'] != '0') { $items .= $products_options_values['price_prefix'] . ' ' . mslib_fe::currency() . mslib_fe::amount2Cents2($products_options_values['options_values_price']); } $items .= '</div></div></div>'; break; default: $items .= "\n" . '<option value="' . $products_options_values['products_options_values_id'] . '" '; if ($sessionData['attributes'][$options['products_options_id']]['products_options_values_id'] == $products_options_values['products_options_values_id']) { $selected = 1; $items .= ' SELECTED'; } $aantal = strlen($products_options_values['products_options_values_name']); $t = ""; if ($products_options_values['options_values_price'] != '0') { $t = ' (' . $products_options_values['price_prefix'] . ' ' . mslib_fe::currency() . mslib_fe::amount2Cents2($products_options_values['options_values_price']) . ') '; $aantal = $aantal + strlen($t); } $x = 62 - $aantal; $x = INFO_SELECTBOX_OPTIONS_SPACE - $aantal; $spaces = ''; for ($i = 0; $i <= $x; $i++) { $spaces .= ' '; } $items .= '>' . $products_options_values['products_options_values_name'] . $spaces . $t; $items .= '</option>'; break; } } } else { if ($sessionData['attributes'][$options['products_options_id']] == $products_options_values['products_options_values_id']) { $items .= $products_options_values['products_options_values_name'] . '</li>'; } } $next_index2++; $value_counter++; } if ($total_values > 0) { if (!$readonly) { switch ($options['listtype']) { case 'input': case 'checkbox': case 'radio': break; default: if ($total_values > 1) { $html = ''; $html .= '<select name="attributes[' . $options['products_options_id'] . ']" class="attributes' . $options['products_options_id'] . '" id="attributes' . $options['products_options_id'] . '" ' . ($options['required'] ? 'required="required"' : '') . ' data-sort="' . $index_key . '">'; if ($options['required']) { $html .= '<option value="">' . $this->pi_getLL('choose_selection') . '</option>'; } $items = $html . $items . '</select>' . "\n"; } break; } $output_html[$options['products_options_id']] .= $items; } } if (!$readonly) { $output_html[$options['products_options_id']] .= '</div></div>' . "\n"; } if ($readonly) { $output_html[$options['products_options_id']] .= '</li></ul>'; } // hook to let other plugins further manipulate the option values display if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/pi1/classes/class.mslib_fe.php']['ShowAttributesLoadDefaultOutputHTML'])) { $params = array('load_default' => &$load_default, 'products_id' => $products_id, 'options' => &$options, 'readonly' => $readonly, 'options_values' => &$options_values, 'output' => &$output, 'output_html' => &$output_html, 'index_key' => $index_key); foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/pi1/classes/class.mslib_fe.php']['ShowAttributesLoadDefaultOutputHTML'] as $funcRef) { \TYPO3\CMS\Core\Utility\GeneralUtility::callUserFunction($funcRef, $params, $this); } } // hook } else { // hook to let other plugins further manipulate the option values display if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/pi1/classes/class.mslib_fe.php']['showAttributesOptionValuesHook'])) { $params = array('load_default' => &$load_default, 'products_id' => $products_id, 'options' => &$options, 'readonly' => $readonly, 'output' => &$output, 'output_html' => &$output_html, 'index_key' => $index_key); foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/pi1/classes/class.mslib_fe.php']['showAttributesOptionValuesHook'] as $funcRef) { \TYPO3\CMS\Core\Utility\GeneralUtility::callUserFunction($funcRef, $params, $this); } } // hook } $index_key++; } else { $output_html[$options['products_options_id']] = '<input type="hidden" id="attributes' . $options['products_options_id'] . '" name="attributes[' . $options['products_options_id'] . ']" value="0">'; } } // hook to let other plugins further manipulate the option values display if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/pi1/classes/class.mslib_fe.php']['showAttributesOutputHTMLPostHook'])) { $params = array('products_id' => $products_id, 'output_html' => &$output_html); foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/pi1/classes/class.mslib_fe.php']['showAttributesOutputHTMLPostHook'] as $funcRef) { \TYPO3\CMS\Core\Utility\GeneralUtility::callUserFunction($funcRef, $params, $this); } } // hook if (count($output_html)) { $product_attribute_options_html = implode("\n", $output_html); if (strpos($product_attribute_options_html, 'attribute_item_wrapper') !== false) { $output .= '<div class="products_attributesWrapper">'; $title = $this->pi_getLL('product_options'); if ($title) { $output .= '<h3>' . $this->pi_getLL('product_options') . '</h3>'; } $output .= '<div class="products_attributes">' . $product_attribute_options_html . '</div>'; $output .= '</div>'; } else { $output .= '<div class="products_attributes_hidden_field">' . $product_attribute_options_html . '</div>'; } } } return $output; }
// refine the payment data, only sent what it's need to rebuild the <li> on the client side $data[$payment_data['sort_order']]['payment_id'] = $payment_data['id']; $data[$payment_data['sort_order']]['payment_label'] = $payment_data['name']; $data[$payment_data['sort_order']]['payment_description'] = $payment_data['description']; $data[$payment_data['sort_order']]['psp_plugin_content'] = ''; $data[$payment_data['sort_order']]['li_class'] = $tr_type; $data[$payment_data['sort_order']]['radio_class'] = 'regular-payment'; $price = ''; if (!empty($payment_data['handling_costs'])) { $price = $payment_data['handling_costs']; if ($vars['handling_costs_type'] != 'percentage') { if ($price && $payment_data['tax_rate'] > 0 && $this->ms['MODULES']['SHOW_PRICES_INCLUDING_VAT']) { $price = $price * $payment_data['tax_rate'] + $price; } if ($price > 0.0 || $price < 0.0) { $price = mslib_fe::currency() . ' +' . mslib_fe::amount2Cents($price, 0, 0); } else { $price = ''; } } $data[$payment_data['sort_order']]['handling_cost'] = $price; } else { $data[$payment_data['sort_order']]['handling_cost'] = ''; } if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scripts/ajax_pages/get_country_payment_methods.php']['paymentMethodDataArray'])) { $params = array('data' => &$data, 'payment_data' => &$payment_data); foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scripts/ajax_pages/get_country_payment_methods.php']['paymentMethodDataArray'] as $funcRef) { \TYPO3\CMS\Core\Utility\GeneralUtility::callUserFunction($funcRef, $params, $this); } } $k++;
manual_attributes_selectbox += \'</span>\'; manual_attributes_selectbox += \'<span> : </span>\'; manual_attributes_selectbox += \'<span class="product_attributes_values">\'; if (optvalid_value != "") { manual_attributes_selectbox += \'<input type="hidden" class="edit_product_manual_values\' + n + \' edit_manual_attributes_input" name="edit_manual_values[]" style="width:187px" value="\' + optvalid_value + \'"/>\'; } else { manual_attributes_selectbox += \'<input type="hidden" class="edit_product_manual_values\' + n + \' edit_manual_attributes_input" name="edit_manual_values[]" style="width:187px"/>\'; } manual_attributes_selectbox += \'<input type="hidden" name="is_manual_value[]"value="0"/>\'; manual_attributes_selectbox += \'</span>\'; manual_attributes_selectbox += \'</div>\';'; $tmpcontent .= ' var number_class_display = "attributesPriceInputDisplay" + optid_value + optvalid_value; var number_class_real = "attributesPriceInputReal" + optid_value + optvalid_value; var manual_attributes_price = \'<div class="msAttributesField"><div class="input-group"><span class="input-group-addon">' . mslib_fe::currency() . '</span><input type="text" id="display_manual_name_excluding_vat" name="display_name_excluding_vat" class="form-control msManualOrderProductPriceExcludingVat priceInputDisplay \' + number_class_display + \'" value="\' + decimalCrop(price_data.display_values_price) + \'" autocomplete="off"><span class="input-group-addon">' . $this->pi_getLL('excluding_vat') . '</span></div></div>\'; manual_attributes_price += \'<div class="msAttributesField"><div class="input-group"><span class="input-group-addon">' . mslib_fe::currency() . '</span><input type="text" name="display_name" id="display_manual_name_including_vat" class="form-control msManualOrderProductPriceIncludingVat priceInputDisplay \' + number_class_display + \'" value="\' + decimalCrop(price_data.display_values_price_including_vat) + \'" autocomplete="off"><span class="input-group-addon">' . $this->pi_getLL('including_vat') . '</span></div></div>\'; manual_attributes_price += \'<div class="msAttributesField hidden"><input class="priceInputReal text \' + number_class_real + \'" type="hidden" name="edit_manual_price[]" id="edit_product_price" value="\' + price_data.price_prefix + price_data.values_price + \'" /></div>\';'; $tmpcontent .= ' var cloned_row=$(\'#last_edit_product_row\').clone(); cloned_row.removeAttr("id"); cloned_row.removeAttr("class"); cloned_row.addClass(row_class + " manual_new_attributes"); $.each(cloned_row.children(), function(i){ var current_class=$(this).prop("class"); if (current_class=="last_edit_product_row_pname_col") { $(this).empty(""); $(this).append(manual_attributes_selectbox); } if (current_class=="last_edit_product_row_pprice_col") { $(this).empty(""); $(this).append(manual_attributes_price);