$options_tab_virtual_product .= '<a href="' . mslib_fe::typolink(",2002", '&tx_multishop_pi1[page_section]=get_micro_download_by_admin&language_id=' . $language['uid'] . '&products_id=' . $product['products_id']) . '" alt="' . $label . '" title="' . $label . '">' . $label . '</a> <a href="' . mslib_fe::typolink($this->shop_pid . ',2003', '&tx_multishop_pi1[page_section]=edit_product&pid=' . $_REQUEST['pid'] . '&action=edit_product&delete_micro_download=1&language_id=' . $language['uid']) . '" onclick="return confirm(\'' . addslashes($this->pi_getLL('admin_label_js_are_you_sure')) . '\')"><img src="' . $this->FULL_HTTP_URL_MS . 'templates/images/icons/delete2.png" border="0" alt="delete ' . htmlspecialchars($lngproduct[$language['uid']]['file_label']) . '"></a>'; } $options_tab_virtual_product .= '</div></div> <div class="form-group toggle_advanced_option" id="msEditProductInputVirtualProductExternalUrl_' . $language['uid'] . '"> <label for="file_remote_location" class="col-md-2 control-label">' . $this->pi_getLL('admin_external_url') . '</label> <div class="col-md-10"> <input type="text" class="form-control text" name="file_remote_location[' . $language['uid'] . ']" id="file_remote_location[' . $language['uid'] . ']" value="' . htmlspecialchars($lngproduct[$language['uid']]['file_remote_location']) . '"> </div> </div>'; $options_tab_virtual_product .= '</div></div></div>'; } } $shipping_payment_method = ''; if ($this->ms['MODULES']['PRODUCT_EDIT_METHOD_FILTER']) { $payment_methods = mslib_fe::loadPaymentMethods(); // loading shipping methods eof $shipping_methods = mslib_fe::loadShippingMethods(); if (count($payment_methods) or count($shipping_methods)) { // the value is are the negate value // negate 1 mean the shipping/payment are excluded $shipping_payment_method .= ' <div class="form-group div_products_mappings toggle_advanced_option" id="msEditProductInputPaymentMethod"> <label class="control-label col-md-2">' . $this->pi_getLL('admin_mapped_methods') . '</label> <div class="col-md-10"> <div class="innerbox_methods"> <div class="innerbox_payment_methods"> <p class="form-control-static"><strong>' . $this->pi_getLL('admin_payment_methods') . '</strong></p> '; // load mapped ids $method_mappings = array();
public function getProductMappedMethods($pids = array(), $type = '', $user_country = '0') { //hook to let other plugins further manipulate the settings $collecting_active_method = false; $active_methods_data = array(); if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/pi1/classes/class.mslib_fe.php']['getProductMappedMethodsPreProc'])) { foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/pi1/classes/class.mslib_fe.php']['getProductMappedMethodsPreProc'] as $funcRef) { $params = array('pids' => &$pids, 'type' => &$type, 'user_country' => &$user_country, 'collecting_active_method' => &$collecting_active_method); \TYPO3\CMS\Core\Utility\GeneralUtility::callUserFunction($funcRef, $params, $this); } } if (is_array($pids) and count($pids)) { switch ($type) { case 'payment': // first we load all options $allmethods = mslib_fe::loadPaymentMethods(0, $user_country, true, true); $count_a = count($allmethods); $count_b = 0; $count_c = 0; foreach ($pids as $pid) { $str = $GLOBALS['TYPO3_DB']->SELECTquery('s.code, pmm.negate', 'tx_multishop_products_method_mappings pmm, tx_multishop_payment_methods s', 's.status=1 and pmm.type=\'' . $type . '\' and pmm.products_id = \'' . $pid . '\' and pmm.method_id=s.id', '', '', ''); $qry = $GLOBALS['TYPO3_DB']->sql_query($str); $array = array(); while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($qry)) { if (!isset($allmethods[$row['code']])) { if (!$row['negate']) { $allmethods[$row['code']] = mslib_fe::loadPaymentMethod($row['code']); if ($collecting_active_method) { $active_methods_data[$type][$row['code']] = $allmethods[$row['code']]; } $count_c++; } } else { if ($row['negate'] > 0) { unset($allmethods[$row['code']]); $count_b++; } else { if ($collecting_active_method) { $active_methods_data[$type][$row['code']] = $allmethods[$row['code']]; } } } } } //$count_b=count($allmethods); if ($count_a == $count_b || !$count_b && !$count_c) { $allmethods = array(); } break; case 'shipping': // first we load all options $allmethods = mslib_fe::loadShippingMethods(0, $user_country, true, true); $count_a = count($allmethods); $count_b = 0; $count_c = 0; foreach ($pids as $pid) { $str = $GLOBALS['TYPO3_DB']->SELECTquery('s.*, d.description, d.name, pmm.negate', 'tx_multishop_products_method_mappings pmm, tx_multishop_shipping_methods s, tx_multishop_shipping_methods_description d', 's.status=1 and pmm.type=\'' . $type . '\' and pmm.products_id = \'' . $pid . '\' and pmm.method_id=s.id and d.language_id=\'' . $this->sys_language_uid . '\' and s.id=d.id', '', 's.sort_order', ''); $qry = $GLOBALS['TYPO3_DB']->sql_query($str); while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($qry)) { if (!isset($allmethods[$row['code']])) { if (!$row['negate']) { $allmethods[$row['code']] = mslib_fe::loadShippingMethod($row['code']); if ($collecting_active_method) { $active_methods_data[$type][$row['code']] = $allmethods[$row['code']]; } $count_c++; } } else { if ($row['negate'] > 0) { unset($allmethods[$row['code']]); $count_b++; } else { if ($collecting_active_method) { $active_methods_data[$type][$row['code']] = $allmethods[$row['code']]; } } } } } //$count_b=count($allmethods); if ($count_a == $count_b || !$count_b && !$count_c) { $allmethods = array(); } break; } //hook to let other plugins further manipulate the settings if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/pi1/classes/class.mslib_fe.php']['getProductMappedMethodsPostProc'])) { foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/pi1/classes/class.mslib_fe.php']['getProductMappedMethodsPostProc'] as $funcRef) { $params = array('pids' => &$pids, 'type' => &$type, 'user_country' => &$user_country, 'allmethods' => &$allmethods, 'active_methods_data' => &$active_methods_data, 'collecting_active_method' => &$collecting_active_method); \TYPO3\CMS\Core\Utility\GeneralUtility::callUserFunction($funcRef, $params, $this); } } return $allmethods; } }
$shipping_methods_user = mslib_fe::getCustomerMappedMethods($user_id, 'shipping'); if (!count($payment_methods_user)) { $payment_methods = $payment_methods_group; } if (!count($shipping_methods)) { $shipping_methods = $shipping_methods_group; } } } break; } } if (!count($payment_methods)) { // nothing is loaded. this cant be valid so let's load the default methods. // loading payment methods $payment_methods = mslib_fe::loadPaymentMethods(0, $user_country, true, true); } if (!count($shipping_methods)) { // loading shipping methods eof $shipping_methods = mslib_fe::loadShippingMethods(0, $delivery_user_country, true, true); } } if (count($shipping_methods) == 0 and count($payment_methods) == 0) { $stepCodes = array('checkout_address', 'checkout_review', 'checkout_finished'); } else { $stepCodes = array('checkout_address', 'checkout_shipping_payment_method', 'checkout_review', 'checkout_finished'); } function CheckoutStepping(&$steps, $current, $pointer) { $output = '<ul id="checkout_crumbar">'; for ($i = 0; $i < count($steps); $i++) {
break; } } if (count($payment_methods_user)) { $payment_methods = $payment_methods_user; } else { if (count($payment_methods_group)) { $payment_methods = $payment_methods_group; } else { $payment_methods = $payment_methods_product; } } if (!count($payment_methods)) { // nothing is loaded. this cant be valid so let's load the default methods. // load payment method based on store origin country $payment_methods = mslib_fe::loadPaymentMethods(0, $countries_id, true, true); } $data = array(); $k = 0; foreach ($payment_methods as $payment_name => $payment_data) { $vars = unserialize($payment_data['vars']); if ($countries_id > 0) { $tax_ruleset = mslib_fe::taxRuleSet($payment_data['tax_id'], 0, $countries_id, 0); } else { $tax_ruleset = mslib_fe::getTaxRuleSet($payment_data['tax_id'], 0); } $payment_data['tax_rate'] = $tax_ruleset['total_tax_rate'] / 100; //print_r($payment_data); if (!$tr_type or $tr_type == 'even') { $tr_type = 'odd'; } else {