Exemple #1
0
 function execute($commands_array)
 {
     // init cObj so that the template parser works inside the cli
     /* @var $cObj tslib_cObj */
     chdir(PATH_site);
     if (!$GLOBALS['TSFE'] instanceof tslib_fe) {
         $GLOBALS['TSFE'] = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('tslib_fe', $GLOBALS['TYPO3_CONF_VARS'], 0, 0);
         $GLOBALS['TSFE']->config['config']['language'] = null;
         $GLOBALS['TSFE']->initTemplate();
     }
     if (!isset($GLOBALS['TT'])) {
         $GLOBALS['TT'] = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('t3lib_TimeTrackNull');
     }
     $GLOBALS['TSFE']->tmpl->getFileName_backPath = PATH_site;
     $this->cObj = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('tslib_cObj');
     switch ($commands_array['action']) {
         case 'rebuild_flat_database':
             mslib_befe::rebuildFlatDatabase();
             break;
     }
     // hook
     if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/cli/multishop.php']['cli_cron'])) {
         $params = array('commands_array' => &$commands_array);
         foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/cli/multishop.php']['cli_cron'] as $funcRef) {
             \TYPO3\CMS\Core\Utility\GeneralUtility::callUserFunction($funcRef, $params, $this);
         }
     }
 }
Exemple #2
0
    for ($x = $start_page_number; $x <= $end_page_number; $x++) {
        if ($p == $x) {
            $results['pagination']['page_number'][$x]['link'] = 0;
            $results['pagination']['page_number'][$x]['number'] = $x;
        } else {
            $results['pagination']['page_number'][$x]['link'] = $x;
            $results['pagination']['page_number'][$x]['number'] = $x;
        }
    }
    $results['pagination']['current_p'] = $p;
    if ($totpage == $p) {
        $results['pagination']['next'] = false;
        $results['pagination']['last'] = false;
    } else {
        $results['pagination']['next'] = $p + 1;
    }
    $results['pagination']['firstText'] = mslib_befe::strtoupper($this->pi_getLL('first'));
    $results['pagination']['first'] = mslib_befe::strtoupper($this->pi_getLL('first'));
    $results['pagination']['prevText'] = mslib_befe::strtoupper($this->pi_getLL('previous'));
    $results['pagination']['nextText'] = mslib_befe::strtoupper($this->pi_getLL('next'));
    $results['pagination']['last'] = mslib_befe::strtoupper($this->pi_getLL('last'));
    $results['pagination']['lastText'] = mslib_befe::strtoupper($this->pi_getLL('last'));
    $data['resultSet'] = $results;
    //$data['sql_dump']=$this->msDebugInfo;
    $content = json_encode($data);
    if ($this->ms['MODULES']['CACHE_FRONT_END']) {
        $Cache_Lite->save($content);
    }
}
echo $content;
exit;
 $subpartArray['###LABEL_PRODUCT_SEARCH_ENGINE_INDEXING_OFF_CHECKED###'] = (!$product['search_engines_allow_indexing'] and $_REQUEST['action'] == 'edit_product') ? 'checked="checked"' : '';
 $subpartArray['###LABEL_ADMIN_NO_INDEXING###'] = $this->pi_getLL('admin_no');
 $subpartArray['###LABEL_PRODUCT_CATEGORY###'] = $this->pi_getLL('admin_category');
 //categories path
 $old_current_categories_id = mslib_fe::getProductToCategories($this->get['pid'], $product['categories_id']);
 $current_categories_id = $old_current_categories_id;
 if ($this->get['action'] == 'add_product' && $this->get['cid'] > 0) {
     $old_current_categories_id = '';
     $current_categories_id = $this->get['cid'];
 }
 $subpartArray['###VALUE_OLD_CATEGORY_ID###'] = $old_current_categories_id;
 //$product['categories_id'];
 $subpartArray['###INPUT_CATEGORY_TREE###'] = '<input type="hidden" name="categories_id" id="categories_id" class="categoriesIdSelect2BigDropWider" value="' . $current_categories_id . '" />';
 $subpartArray['###INPUT_CATEGORY_TREE_DEFAULT_PATH###'] = '';
 if ($this->get['action'] == 'edit_product' && $this->ms['MODULES']['ENABLE_DEFAULT_CRUMPATH'] > 0) {
     $product_path = mslib_befe::getRecord($this->get['pid'], 'tx_multishop_products_to_categories', 'products_id', array('is_deepest=1 and default_path=1'));
     $default_path = 0;
     if (is_array($product_path) && count($product_path)) {
         $default_path = $product_path['node_id'];
     }
     $p2c_cats = explode(',', $old_current_categories_id);
     $default_path_sb = '<select name="default_path_categories_id" id="default_path_categories_id" class="categoriesIdSelect2BigDropWider">';
     $default_path_sb .= '<option value="">' . $this->pi_getLL('choose') . '</option>';
     foreach ($p2c_cats as $p2c_cat) {
         if ($p2c_cat > 0) {
             $cats = mslib_fe::Crumbar($p2c_cat, '', array());
             $cats = array_reverse($cats);
             $catpath = array();
             foreach ($cats as $cat_idx => $cat) {
                 $catpath[] = $cat['name'];
             }
        $available_sid[] = $mapped_shipping_method['id'];
    }
}
//
if (count($available_sid) > 0) {
    //if (!$this->ms['MODULES']['PRODUCT_EDIT_METHOD_FILTER']) {
    if (!$this->post['tx_multishop_pi1']['sid'] or !in_array($this->post['tx_multishop_pi1']['sid'], $available_sid)) {
        // if the posted shipping id is not in the available shipping method array then select the first valid shipping method
        $this->post['tx_multishop_pi1']['sid'] = $available_sid[0];
    }
    //}
    $shipping_method = mslib_fe::getShippingMethod($this->post['tx_multishop_pi1']['sid'], 's.id', $countries_id, true);
    $shipping_method_code = $shipping_method['code'];
    if (strlen($shipping_method['name']) > 1) {
        $char = substr($shipping_method['name'], 1, 1);
        if ($char == mslib_befe::strtolower($char)) {
            $shipping_method['name'] = $shipping_method['name'];
        }
    } else {
        $shipping_method['name'] = $shipping_method['name'];
    }
    $shipping_method_label = $shipping_method['name'];
    // shipping
    $price = '';
    $priceArray = mslib_fe::getShippingCosts($countries_id, $this->post['tx_multishop_pi1']['sid']);
    if ($this->ms['MODULES']['SHOW_PRICES_INCLUDING_VAT']) {
        $data['shipping_cost'] = '';
        $data['shipping_cost_cur'] = '';
        if ($priceArray['shipping_costs_including_vat'] > 0 || $this->ms['MODULES']['ALWAYS_DISPLAY_SHIPPING_COSTS'] > 0) {
            $data['shipping_cost'] = '' . $priceArray['shipping_costs_including_vat'];
            $data['shipping_cost_cur'] = mslib_fe::amount2Cents($priceArray['shipping_costs_including_vat']);
        $array = array();
        $array['configuration_value'] = $this->post['configuration']['global'];
        $query = $GLOBALS['TYPO3_DB']->UPDATEquery('tx_multishop_configuration', 'configuration_key=\'' . addslashes($this->post['configuration_key']) . '\'', $array);
        $res = $GLOBALS['TYPO3_DB']->sql_query($query);
    }
    if ($this->ms['MODULES']['GLOBAL_MODULES']['CACHE_FRONT_END'] or $this->conf['cacheConfiguration']) {
        if ($this->DOCUMENT_ROOT and !strstr($this->DOCUMENT_ROOT, '..')) {
            $command = "rm -rf " . $this->DOCUMENT_ROOT . "uploads/tx_multishop/tmp/cache/*";
            exec($command);
            $content .= '<br /><p><strong>' . $this->pi_getLL('admin_label_multishop_cache_has_been_cleared') . '</strong></p>';
        } else {
            $content .= '<br /><p><strong>' . $this->pi_getLL('admin_label_cache_not_cleared_something_is_wrong_with_configuration_document_root_is_not_set_directly') . '</strong></p>';
        }
    }
    if ($this->ms['MODULES']['GLOBAL_MODULES']['CACHE_FRONT_END']) {
        mslib_befe::cacheLite('clear_all', 'delete');
    }
    $string = 'loadConfiguration_' . $this->shop_pid;
    if ($this->post['tx_multishop_pi1']['referrer']) {
        header("Location: " . $this->post['tx_multishop_pi1']['referrer'] . "#module" . $this->post['tx_multishop_pi1']['gid']);
        exit;
    } else {
        header("Location: " . $this->FULL_HTTP_URL . mslib_fe::typolink($this->shop_pid . ',2003', 'tx_multishop_pi1[page_section]=admin_modules&gid=' . $this->post['gid'], 1));
        exit;
    }
}
if ($configuration['id'] or $_REQUEST['action'] == 'edit_module') {
    $configuration['parent_id'] = $this->get['cid'];
    $save_block = '
<div class="clearfix">
		<div class="pull-right">
        $where = '';
        if (count($cats) > 0) {
            foreach ($cats as $cat) {
                $where .= "categories_id[" . $level . "]=" . $cat['id'] . "&";
                $level++;
            }
            $where = substr($where, 0, strlen($where) - 1);
            $where .= '&';
        }
        // get all cats to generate multilevel fake url eof
    }
    $link = mslib_fe::typolink($this->conf['products_detail_page_pid'], '&' . $where . '&products_id=' . $current_product['products_id'] . '&tx_multishop_pi1[page_section]=products_detail');
    $catlink = mslib_fe::typolink($this->conf['products_listing_page_pid'], '&' . $where . '&tx_multishop_pi1[page_section]=products_listing');
    $counter++;
    if ($current_product['products_image']) {
        $image = '<img src="' . mslib_befe::getImagePath($current_product['products_image'], 'products', $this->imageWidth) . '" alt="' . htmlspecialchars($current_product['products_name']) . '" />';
    } else {
        $image = '<div class="no_image"></div>';
    }
    $ITEM_CLASS = '';
    if (($this->ROOTADMIN_USER or $this->ADMIN_USER and $this->CATALOGADMIN_USER) and !$current_product['products_status'] and !$this->ms['MODULES']['FLAT_DATABASE']) {
        $ITEM_CLASS = 'disabled_product';
    }
    $content .= '<li id="productlisting_' . $current_product['products_id'] . '" class="' . $ITEM_CLASS . '">
	<h2><a href="' . $link . '" class="ajax_link">' . $current_product['products_name'] . '</a></h2>
	<div class="image"><a href="' . $link . '" title="' . htmlspecialchars($current_product['products_name']) . '" class="ajax_link">' . $image . '</a></div>
	<div class="description">' . $current_product['products_shortdescription'] . '</div>
	<div class="category"><a href="' . $catlink . '" class="ajax_link">' . $current_product['categories_name'] . '</a></div>
	<div class="link_detail"><a href="' . $link . '" class="ajax_link">' . $this->pi_getLL('details') . '</a></div>
	';
    $final_price = mslib_fe::final_products_price($current_product);
 function getDefaultOrderStatus()
 {
     $filter = array();
     $filter[] = 'default_status=1';
     $filter[] = '(o.page_uid=\'0\' or o.page_uid=\'' . $this->showCatalogFromPage . '\') and o.deleted=0 and o.id=od.orders_status_id and od.language_id=\'0\'';
     $record = mslib_befe::getRecord('', 'tx_multishop_orders_status o, tx_multishop_orders_status_description od', '', $filter);
     return $record;
 }
Exemple #8
0
    $contentItem = '';
    foreach ($manufacturers as $row) {
        $link = mslib_fe::typolink($this->conf['search_page_pid'], '&tx_multishop_pi1[page_section]=manufacturers_products_listing&manufacturers_id=' . $row['manufacturers_id']);
        if ($this->ADMIN_USER) {
            $output['admin_manufacturers_sortable_id'] = 'sortable_manufacturer_' . $row['manufacturers_id'] . '';
        }
        $output['class_active'] = $row['manufacturers_id'] == $this->get['manufacturers_id'] ? 'active' : '';
        $output['manufacturers_link'] = $link;
        $output['manufacturers_name'] = htmlspecialchars($row['manufacturers_name']);
        $markerArray = array();
        $markerArray['ADMIN_MANUFACTURERS_SORTABLE_ID'] = $output['admin_manufacturers_sortable_id'];
        $markerArray['CLASS_ACTIVE'] = $output['class_active'];
        $markerArray['MANUFACTURERS_LINK'] = $output['manufacturers_link'];
        $markerArray['MANUFACTURERS_NAME'] = $output['manufacturers_name'];
        if ($row['manufacturers_image']) {
            $markerArray['MANUFACTURERS_IMAGE_NORMAL'] = '<img src="' . mslib_befe::getImagePath($row['manufacturers_image'], 'manufacturers', 'normal') . '">';
        } else {
            $markerArray['MANUFACTURERS_IMAGE_NORMAL'] = '';
        }
        $contentItem .= $this->cObj->substituteMarkerArray($subparts['item'], $markerArray, '###|###');
    }
    // fill the row marker with the expanded rows
    $subpartArray['###MANUFACTURERS_UID###'] = $output['manufacturers_uid'];
    $subpartArray['###MANUFACTURERS_HEADER###'] = $output['manufacturers_header'];
    $subpartArray['###ITEM###'] = $contentItem;
    // completed the template expansion by replacing the "item" marker in the template
    $content = $this->cObj->substituteMarkerArrayCached($subparts['template'], null, $subpartArray);
} else {
    header('HTTP/1.0 404 Not Found');
    // set custom 404 message
    $page = mslib_fe::getCMScontent('manufacturer_not_found_message', $GLOBALS['TSFE']->sys_language_uid);
    $qry = $GLOBALS['TYPO3_DB']->sql_query($str);
    $messages[] = $str;
}
// add invoice_grand_total_excluding_vat column
$str = "select invoice_grand_total_excluding_vat from tx_multishop_invoices limit 1";
$qry = $GLOBALS['TYPO3_DB']->sql_query($str);
if (!$qry) {
    $str = "ALTER TABLE `tx_multishop_invoices` ADD `invoice_grand_total_excluding_vat` decimal(24,14) default '0.00000000000000'";
    $qry = $GLOBALS['TYPO3_DB']->sql_query($str);
    $messages[] = $str;
}
$sql_order = "select id, orders_id, invoice_id, reversal_invoice from tx_multishop_invoices";
$qry_order = $GLOBALS['TYPO3_DB']->sql_query($sql_order);
if ($GLOBALS['TYPO3_DB']->sql_num_rows($qry_order)) {
    while ($invoices_row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($qry_order)) {
        $order_record = mslib_befe::getRecord($invoices_row['orders_id'], 'tx_multishop_orders', 'orders_id', array(), 'grand_total, grand_total_excluding_vat');
        if ($order_record['grand_total_excluding_vat'] > 0) {
            $updateArray = array();
            if ($invoices_row['reversal_invoice'] > 0) {
                // credit invoices
                if ($order_record['grand_total'] < 0) {
                    // reverse to positive value if the tx_multishop_orders.grand_total already minus
                    $updateArray['invoice_grand_total'] = str_replace('-', '', $order_record['grand_total']);
                    $updateArray['invoice_grand_total_excluding_vat'] = str_replace('-', '', $order_record['grand_total_excluding_vat']);
                } else {
                    $updateArray['invoice_grand_total'] = '-' . $order_record['grand_total'];
                    $updateArray['invoice_grand_total_excluding_vat'] = '-' . $order_record['grand_total_excluding_vat'];
                }
            } else {
                $updateArray['invoice_grand_total'] = $order_record['grand_total'];
                $updateArray['invoice_grand_total_excluding_vat'] = $order_record['grand_total_excluding_vat'];
    $params = array();
    foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/scripts/admin_pages/includes/admin_stats_orders/turn_over_per_month.php']['monthlyStatsOrdersPagePreProc'] as $funcRef) {
        \TYPO3\CMS\Core\Utility\GeneralUtility::callUserFunction($funcRef, $params, $this);
    }
}
// billing countries
$additional_where = array();
if (!$this->masterShop) {
    $additional_where[] = 'page_uid=\'' . $this->shop_pid . '\'';
}
$order_countries = mslib_befe::getRecords('', 'tx_multishop_orders', '', $additional_where, 'billing_country', 'billing_country asc');
$order_billing_country = array();
foreach ($order_countries as $order_country) {
    $cn_localized_name = htmlspecialchars(mslib_fe::getTranslatedCountryNameByEnglishName($this->lang, $order_country['billing_country']));
    if (!empty($cn_localized_name)) {
        $order_billing_country[] = '<option value="' . mslib_befe::strtolower($order_country['billing_country']) . '" ' . (mslib_befe::strtolower($this->get['country']) == strtolower($order_country['billing_country']) ? 'selected' : '') . '>' . $cn_localized_name . '</option>';
    }
}
ksort($order_billing_country);
$billing_countries_sb = '<select class="invoice_select2" name="country" id="country""><option value="">' . $this->pi_getLL('all_countries') . '</option>' . implode("\n", $order_billing_country) . '</select>';
$all_orders_status = mslib_fe::getAllOrderStatus($GLOBALS['TSFE']->sys_language_uid);
if ($this->post['Search'] and $this->get['payment_status'] != $this->cookie['payment_status']) {
    $this->cookie['payment_status'] = $this->get['payment_status'];
    $GLOBALS['TSFE']->fe_user->setKey('ses', 'tx_multishop_cookie', $this->cookie);
    $GLOBALS['TSFE']->storeSessionData();
}
if ($this->get['stats_year_sb'] > 0) {
    if ($this->get['stats_year_sb'] != $this->cookie['stats_year_sb']) {
        $this->cookie['stats_year_sb'] = $this->get['stats_year_sb'];
    }
} else {
 } else {
     foreach ($orders_products_attributes[$order['orders_products_id']] as $tmpkey => $options) {
         $options_attributes_tax_data = unserialize($options['attributes_tax_data']);
         if (is_numeric($options['products_options_id'])) {
             $str = $GLOBALS['TYPO3_DB']->SELECTquery('listtype', 'tx_multishop_products_options o', 'o.products_options_id=\'' . $options['products_options_id'] . '\' and language_id=\'' . $this->sys_language_uid . '\'', '', '', '');
             $qry = $GLOBALS['TYPO3_DB']->sql_query($str);
             $rowCheck = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($qry);
         }
         $attributes_tax_data = unserialize($options['attributes_tax_data']);
         $tmpcontent .= '<tr class="' . $tr_type . '"><td>&nbsp;</td><td>&nbsp;</td>';
         if ($rowCheck['listtype'] == 'file') {
             if ($options['products_options_values']) {
                 $filePath = $this->DOCUMENT_ROOT . 'uploads/tx_multishop/order_resources/' . rawurlencode($options['products_options_values']);
                 if (file_exists($filePath)) {
                     $displayImage = 0;
                     $imgtype = mslib_befe::exif_imagetype($filePath);
                     if ($imgtype) {
                         // valid image
                         $ext = image_type_to_extension($imgtype, false);
                         if ($ext) {
                             $displayImage = 1;
                         }
                     }
                     if ($displayImage) {
                         $size = getimagesize($filePath);
                         $width = '';
                         if ($size[0] > 350) {
                             $width = '150';
                         }
                         // display image with link
                         $htmlContent = '<br /><a href="' . $this->FULL_HTTP_URL . 'uploads/tx_multishop/order_resources/' . rawurlencode($options['products_options_values']) . '" class="msAdminDownloadIcon" target="_blank"><img src="' . $this->FULL_HTTP_URL . 'uploads/tx_multishop/order_resources/' . rawurlencode($options['products_options_values']) . '" width="' . $width . '" /></a>';
        $country_block = '';
        $delivery_country_block = '';
        if (count($enabled_countries) == 1) {
            $country_block .= '<input name="country" type="hidden" value="' . mslib_befe::strtolower($enabled_countries[0]['cn_short_en']) . '" />';
            $delivery_country_block .= '<input name="delivery_country" type="hidden" value="' . mslib_befe::strtolower($enabled_countries[0]['cn_short_en']) . '" />';
        } else {
            $default_country = mslib_fe::getCountryByIso($this->ms['MODULES']['COUNTRY_ISO_NR']);
            if (!$user['country']) {
                $user['country'] = $default_country['cn_short_en'];
            }
            if (!$user['delivery_country']) {
                $user['delivery_country'] = $default_country['cn_short_en'];
            }
            foreach ($enabled_countries as $country) {
                $tmpcontent_con .= '<option value="' . mslib_befe::strtolower($country['cn_short_en']) . '" ' . (mslib_befe::strtolower($user['country']) == mslib_befe::strtolower($country['cn_short_en']) ? 'selected' : '') . '>' . htmlspecialchars(mslib_fe::getTranslatedCountryNameByEnglishName($this->lang, $country['cn_short_en'])) . '</option>';
                $tmpcontent_con_delivery .= '<option value="' . mslib_befe::strtolower($country['cn_short_en']) . '" ' . (mslib_befe::strtolower($user['delivery_country']) == mslib_befe::strtolower($country['cn_short_en']) ? 'selected' : '') . '>' . htmlspecialchars(mslib_fe::getTranslatedCountryNameByEnglishName($this->lang, $country['cn_short_en'])) . '</option>';
            }
            if ($tmpcontent_con) {
                $country_block .= '
				<div class="account-field col-sm-' . ($this->conf['multistep_checkout_address_tmpl_path'] ? '12' : '8') . '" id="input-country">
					<label for="country" id="account-country">' . ucfirst($this->pi_getLL('country')) . '*</label>
					<select name="country" id="country" class="country" required="required" data-h5-errorid="invalid-country" title="' . $this->pi_getLL('country_is_required') . '">
						<option value="">' . ucfirst($this->pi_getLL('choose_country')) . '</option>
						' . $tmpcontent_con . '
					</select>
					<div id="invalid-country" class="error-space" style="display:none"></div>
		        </div>
				';
            }
        }
        // country eof
     $insertArray['email'] = $this->post['email'];
     $insertArray['username'] = $this->post['tx_multishop_pi1']['telephone'];
     $insertArray['building'] = $this->post['building'];
     $insertArray['street_name'] = $this->post['street_name'];
     $insertArray['address_number'] = $this->post['address_number'];
     $insertArray['address_ext'] = $this->post['address_ext'];
     $insertArray['address'] = $insertArray['street_name'] . ' ' . $insertArray['address_number'] . $insertArray['address_ext'];
     $insertArray['address'] = preg_replace('/\\s+/', ' ', $insertArray['address']);
     $insertArray['zip'] = $this->post['zip'];
     $insertArray['telephone'] = $this->post['tx_multishop_pi1']['telephone'];
     $insertArray['city'] = $this->post['city'];
     $insertArray['country'] = $this->post['country'];
     $insertArray['password'] = $insertArray['crdate'] = time();
     $insertArray['usergroup'] = $this->conf['fe_customer_usergroup'];
     $insertArray['pid'] = $this->conf['fe_customer_pid'];
     $insertArray['password'] = mslib_befe::getHashedPassword(rand(1000000, 9000000));
     $insertArray['tx_multishop_vat_id'] = $this->post['tx_multishop_vat_id'];
     $insertArray['tx_multishop_coc_id'] = $this->post['tx_multishop_coc_id'];
     $query = $GLOBALS['TYPO3_DB']->INSERTquery('fe_users', $insertArray);
     $res = $GLOBALS['TYPO3_DB']->sql_query($query);
     if ($res) {
         $customer_id = $GLOBALS['TYPO3_DB']->sql_insert_id();
     }
 }
 //add to orders
 if ($customer_id) {
     // now add the order
     $insertArray = array();
     $insertArray['customer_id'] = $customer_id;
     $insertArray['page_uid'] = $this->shop_pid;
     $insertArray['status'] = 1;
 function customAjaxPage(&$params, &$ref)
 {
     error_log("customAjaxPage hook");
     error_log("products path: " . $ref->ms['image_paths']['products']['original']);
     $ref->ms['image_paths']['variants']['original'] = 'uploads/tx_msvariants/images/original';
     error_log("variants path: " . $ref->ms['image_paths']['variants']['original']);
     if ($ref->ADMIN_USER) {
         if (isset($_SERVER["CONTENT_LENGTH"])) {
             //        switch ($ref->get['file_type']) {
             //          case 'variants_image':
             //          for ($x=0; $x<$ref->ms['MODULES']['NUMBER_OF_PRODUCT_IMAGES']; $x++) {
             //              // hidden filename that is retrieved from the ajax upload
             //            $i=$x;
             //            if ($i==0) {
             //              $i='';
             //            }
             //            $field='products_image'.$i;
             //            if ($ref->get['file_type']==$field) {
             $temp_file = $ref->DOCUMENT_ROOT . 'uploads/tx_multishop/tmp/' . uniqid();
             if (isset($_FILES['qqfile'])) {
                 move_uploaded_file($_FILES['qqfile']['tmp_name'], $temp_file);
             } else {
                 $input = fopen("php://input", "r");
                 $debug_file = fopen("/Applications/XAMPP/xamppfiles/htdocs/typo3/typo3temp/debug.txt", "w");
                 fwrite($debug_file, sys_get_temp_dir());
                 fclose($debug_file);
                 $temp = tmpfile();
                 $realSize = stream_copy_to_stream($input, $temp);
                 fclose($input);
                 $target = fopen($temp_file, "w");
                 fseek($temp, 0, SEEK_SET);
                 stream_copy_to_stream($temp, $target);
                 fclose($target);
             }
             error_log("temp file created");
             $size = getimagesize($temp_file);
             if ($size[0] > 5 and $size[1] > 5) {
                 error_log("size ok");
                 $imgtype = mslib_befe::exif_imagetype($temp_file);
                 if ($imgtype) {
                     error_log("type ok");
                     // valid image
                     $ext = image_type_to_extension($imgtype, false);
                     if ($ext) {
                         error_log("ext ok");
                         $i = 0;
                         $filename = mslib_fe::rewritenamein($ref->get['products_name']) . '.' . $ext;
                         $folder = mslib_befe::getImagePrefixFolder($filename);
                         $array = explode(".", $filename);
                         if (!is_dir($ref->DOCUMENT_ROOT . $ref->ms['image_paths']['variants']['original'] . '/' . $folder)) {
                             t3lib_div::mkdir($ref->DOCUMENT_ROOT . $ref->ms['image_paths']['variants']['original'] . '/' . $folder);
                         }
                         error_log("mkdir ok");
                         $folder .= '/';
                         $target = $ref->DOCUMENT_ROOT . $ref->ms['image_paths']['variants']['original'] . '/' . $folder . $filename;
                         if (file_exists($target)) {
                             error_log("file exists ok");
                             do {
                                 $filename = mslib_fe::rewritenamein($ref->get['products_name']) . ($i > 0 ? '-' . $i : '') . '.' . $ext;
                                 $folder_name = mslib_befe::getImagePrefixFolder($filename);
                                 $array = explode(".", $filename);
                                 $folder = $folder_name;
                                 if (!is_dir($ref->DOCUMENT_ROOT . $ref->ms['image_paths']['variants']['original'] . '/' . $folder)) {
                                     t3lib_div::mkdir($ref->DOCUMENT_ROOT . $ref->ms['image_paths']['variants']['original'] . '/' . $folder);
                                 }
                                 $folder .= '/';
                                 $target = $ref->DOCUMENT_ROOT . $ref->ms['image_paths']['variants']['original'] . '/' . $folder . $filename;
                                 $i++;
                             } while (file_exists($target));
                         }
                         error_log("before copy file ok");
                         if (copy($temp_file, $target)) {
                             $filename = mslib_befe::resizeProductImage($target, $filename, $ref->DOCUMENT_ROOT . t3lib_extMgm::siteRelPath($ref->extKey), 1);
                             $result = array();
                             $result['success'] = true;
                             $result['error'] = false;
                             $result['filename'] = $filename;
                             echo htmlspecialchars(json_encode($result), ENT_NOQUOTES);
                             exit;
                         }
                     }
                 }
             }
         }
         //          }
         //          break;
         //        }
         //      }
     }
     //    exit();
     //    break;
 }
Exemple #15
0
             if ($sort_type == 'desc') {
                 $no = time();
             } else {
                 $no = 1;
             }
             foreach ($getPost as $prod_id) {
                 if (is_numeric($prod_id) and is_numeric($cat_id)) {
                     $where = 'categories_id = ' . $cat_id . ' and products_id = ' . $prod_id;
                     $updateArray = array('sort_order' => $no);
                     $query = $GLOBALS['TYPO3_DB']->UPDATEquery('tx_multishop_products_to_categories', $where, $updateArray);
                     $res = $GLOBALS['TYPO3_DB']->sql_query($query);
                     $query = $GLOBALS['TYPO3_DB']->UPDATEquery('tx_multishop_products', "products_id = {$prod_id}", $updateArray);
                     $res = $GLOBALS['TYPO3_DB']->sql_query($query);
                     if ($this->ms['MODULES']['FLAT_DATABASE']) {
                         // if the flat database module is enabled we have to sync the changes to the flat table
                         mslib_befe::convertProductToFlat($prod_id);
                     }
                     if ($sort_type == 'desc') {
                         $no--;
                     } else {
                         $no++;
                     }
                 }
             }
         }
     }
     exit;
     break;
 case 'manufacturers':
     if ($this->ROOTADMIN_USER or $this->ADMIN_USER and $this->CATALOGADMIN_USER) {
         $getPost = $this->post['sortable_manufacturer'];
                    }
                }
                foreach ($tables as $table) {
                    if ($table) {
                        $qry = $GLOBALS['TYPO3_DB']->sql_query('TRUNCATE ' . $table);
                    }
                }
                foreach ($this->ms['image_paths']['products'] as $key => $path) {
                    if ($path) {
                        $return = mslib_befe::deltree($this->DOCUMENT_ROOT . $path);
                    }
                }
                foreach ($this->ms['image_paths']['categories'] as $key => $path) {
                    if ($path) {
                        $return = mslib_befe::deltree($this->DOCUMENT_ROOT . $path);
                    }
                }
                foreach ($this->ms['image_paths']['manufacturers'] as $key => $path) {
                    if ($path) {
                        $return = mslib_befe::deltree($this->DOCUMENT_ROOT . $path);
                    }
                }
                $content .= '<p>' . $this->pi_getLL('admin_label_everything_has_been_cleared') . '</p>';
                break;
        }
    }
}
$content .= '
</div>
</div>
';
				<div class="col-md-10">
				<input type="text" class="form-control text" name="meta_description[' . $language['uid'] . ']" id="meta_description[' . $language['uid'] . ']" value="' . htmlspecialchars($lngcat[$language['uid']]['meta_description']) . '">
				</div>
			</div>';
            $categories_meta_block .= '</div></div></div>';
        }
        // INPUT_CATEGORY_TREE
        $tmpcontent = '';
        if ($this->conf['enableMultipleShops'] && $this->ms['MODULES']['ENABLE_CATEGORIES_TO_CATEGORIES']) {
            $shopPids = explode(',', $this->conf['connectedShopPids']);
            $tmpcontent .= '<div class="form-group" class="msEditCategoriesInputMultipleShopCategory">
				<label>' . $this->pi_getLL('link_to_categories_in_other_shops') . '</label>
				<div class="msAttributesWrapper">';
            foreach ($shopPids as $shopPid) {
                if (is_numeric($shopPid) and $shopPid != $this->shop_pid) {
                    $pageinfo = mslib_befe::getRecord($shopPid, 'pages', 'uid', array('deleted=0 and hidden=0'));
                    if ($pageinfo['uid']) {
                        $categories_to_categories = '';
                        $shop_checkbox = '';
                        $select2_block_visibility = ' style="display:none"';
                        if ($this->get['action'] == 'edit_category') {
                            $categories_to_categories = mslib_fe::getCategoriesToCategories($this->get['cid'], $pageinfo['uid']);
                            if (!empty($categories_to_categories)) {
                                $shop_checkbox = ' checked="checked"';
                                $select2_block_visibility = ' style="display:block"';
                            }
                        }
                        $tmpcontent .= '<div class="msAttributes">
						<input type="checkbox" class="enableMultipleShopsCheckbox" id="enableMultipleShops_' . $pageinfo['uid'] . '" name="tx_multishop_pi1[enableMultipleShops][]" value="' . $pageinfo['uid'] . '" rel="' . $pageinfo['uid'] . '"' . $shop_checkbox . ' />
						<label for="enableMultipleShops_' . $pageinfo['uid'] . '">' . $pageinfo['title'] . '</label>
						<div class="msEditCategoriesInputMultipleShopCategory" id="msEditCategoriesInputMultipleShopCategory' . $pageinfo['uid'] . '"' . $select2_block_visibility . '>
     } else {
         $parentClasses[] = 'text-info';
     }
 }
 if ($order['by_phone']) {
     $classes[] = 'fa fa-phone fa-stack-1x fa-inverse';
     $markerArray['MANUAL_ORDER_ICON'] = '<span class="' . implode(' ', $parentClasses) . '"><i class="fa fa-circle fa-stack-2x fa-circle-phone"></i><i class="' . implode(' ', $classes) . '"></i></span>';
 } else {
     $classes[] = 'fa fa-cart-plus fa-stack-1x fa-inverse';
     $markerArray['MANUAL_ORDER_ICON'] = '<span class="' . implode(' ', $parentClasses) . '"><i class="fa fa-circle fa-stack-2x fa-circle-cart-plus"></i><i class="' . implode(' ', $classes) . '"></i></span>';
 }
 $markerArray['INVOICE_NUMBER'] = '';
 if ($this->ms['MODULES']['ADMIN_INVOICE_MODULE']) {
     $markerArray['INVOICE_NUMBER'] = '<td align="right">';
     $filter = array();
     $invoices = mslib_befe::getRecords($order['orders_id'], 'tx_multishop_invoices i', 'i.orders_id', $filter);
     $links = array();
     if (is_array($invoices) && count($invoices)) {
         foreach ($invoices as $invoice) {
             $invoice = mslib_fe::getInvoice($invoice['id'], 'id');
             $links[] = '<a href="' . mslib_fe::typolink($this->shop_pid . ',2002', 'tx_multishop_pi1[page_section]=download_invoice&tx_multishop_pi1[hash]=' . $invoice['hash']) . '" target="_blank">' . $invoice['invoice_id'] . '</a>';
         }
     }
     if (count($links)) {
         $markerArray['INVOICE_NUMBER'] .= implode('<br/>', $links);
     }
     $markerArray['INVOICE_NUMBER'] .= '</td>';
 }
 if (isset($this->get['tx_multishop_pi1']['is_proposal'])) {
     $markerArray['ORDER_EDIT_URL'] = mslib_fe::typolink($this->shop_pid . ',2003', '&tx_multishop_pi1[page_section]=edit_order&orders_id=' . $order['orders_id'] . '&action=edit_order&tx_multishop_pi1[is_proposal]=1');
 } else {
 function compareDatabaseFixProductToCategoryLinking()
 {
     $messages = array();
     $str = "show indexes from `tx_multishop_products_to_categories` ";
     $qry = $GLOBALS['TYPO3_DB']->sql_query($str);
     $unique_indexes = array();
     if ($GLOBALS['TYPO3_DB']->sql_num_rows($qry)) {
         while (($rs = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($qry)) != false) {
             $unique_indexes[] = $rs['Key_name'];
         }
         if (!in_array('p2c_unique_key', $unique_indexes)) {
             // add unique p2c key
             $unique_key = 'ALTER IGNORE TABLE `tx_multishop_products_to_categories` ADD UNIQUE `p2c_unique_key` (`products_id`, `categories_id`, `page_uid`, `node_id`, `is_deepest`, `crumbar_identifier`)';
             $res = $GLOBALS['TYPO3_DB']->sql_query($unique_key);
             $messages[] = $unique_key;
         }
     }
     //
     $p2c_records = mslib_befe::getRecords('', 'tx_multishop_products_to_categories', '', array(), '', '', '');
     if (is_array($p2c_records) && count($p2c_records)) {
         foreach ($p2c_records as $p2c_record) {
             //if (!strlen($p2c_record['crumbar_identifier'])) {
             tx_mslib_catalog::compareDatabaseRebuildProductsToCategoryTree($p2c_record['products_id'], $p2c_record['categories_id']);
             //}
         }
     }
     // p2c fixer routine code for redundant records
     $query_p2c = $GLOBALS['TYPO3_DB']->SELECTquery('*', 'tx_multishop_products_to_categories', '', 'products_id,node_id', 'products_to_categories_id asc', '');
     $res_p2c = $GLOBALS['TYPO3_DB']->sql_query($query_p2c);
     $delete_counter = 0;
     if ($GLOBALS['TYPO3_DB']->sql_num_rows($res_p2c)) {
         while ($row_p2c = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res_p2c)) {
             $query_p2c_del = $GLOBALS['TYPO3_DB']->SELECTquery('products_to_categories_id', 'tx_multishop_products_to_categories', 'products_id = \'' . $row_p2c['products_id'] . '\' and categories_id = \'' . $row_p2c['categories_id'] . '\' and node_id=\'' . $row_p2c['node_id'] . '\' and is_deepest=\'' . $row_p2c['is_deepest'] . '\'', '', 'products_to_categories_id asc', '');
             $res_p2c_del = $GLOBALS['TYPO3_DB']->sql_query($query_p2c_del);
             if ($GLOBALS['TYPO3_DB']->sql_num_rows($res_p2c_del)) {
                 while ($row_del = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res_p2c_del)) {
                     if ($row_p2c['products_to_categories_id'] != $row_del['products_to_categories_id']) {
                         $del_p2c_query = $GLOBALS['TYPO3_DB']->DELETEquery('tx_multishop_products_to_categories', 'products_to_categories_id=\'' . $row_del['products_to_categories_id'] . '\'');
                         $res = $GLOBALS['TYPO3_DB']->sql_query($del_p2c_query);
                         $delete_counter++;
                     }
                 }
             }
         }
         if ($delete_counter) {
             $messages[] = 'Delete ' . $delete_counter . ' redundant record(s) from tx_multishop_products_to_categories';
         }
     }
     // p2c fixer routine code for redundant records eol
     $message = implode("\n\n", $messages);
     if (count($messages)) {
         return $message;
     }
     return '';
 }
    $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();
        if ($this->get['customer_group_id']) {
            $method_mappings = mslib_befe::getMethodsByGroup($this->get['customer_group_id']);
        }
        $tr_type = '';
        if (is_array($payment_methods) && count($payment_methods)) {
            foreach ($payment_methods as $code => $item) {
                if (!$tr_type or $tr_type == 'even') {
                    $tr_type = 'odd';
                } else {
                    $tr_type = 'even';
                }
                $count++;
                $shipping_payment_method .= '<div class="form-group" id="multishop_payment_method_' . $item['id'] . '"><label class="control-label col-md-3">' . $item['name'] . '</label><div class="col-md-9">';
                if ($price_wrap) {
                    $tmpcontent .= $price_wrap;
                }
                $shipping_payment_method .= '<div class="checkbox checkbox-success checkbox-inline"><input name="payment_method[' . htmlspecialchars($item['id']) . ']" class="payment_method_cb" id="enable_payment_method_' . $item['id'] . '" type="checkbox" rel="' . $item['id'] . '" value="0"' . (is_array($method_mappings['payment']) && in_array($item['id'], $method_mappings['payment']) && !$method_mappings['payment']['method_data'][$item['id']]['negate'] ? ' checked' : '') . ' /><label for="enable_payment_method_' . $item['id'] . '">' . $this->pi_getLL('enable') . '</label></div>';
                             mslib_befe::updateImportedProductsLockedFields($pid, 'tx_multishop_products_to_categories', array('categories_id' => $this->post['tx_multishop_pi1']['target_categories_id']));
                         }
                         mslib_befe::moveProduct($pid, $this->post['tx_multishop_pi1']['target_categories_id'], $old_categories_id);
                     }
                 }
             }
             break;
         case 'duplicate':
             foreach ($this->post['selectedProducts'] as $old_categories_id => $array) {
                 if ($this->post['tx_multishop_pi1']['target_categories_id'] > 0) {
                     $target_cat_id = $this->post['tx_multishop_pi1']['target_categories_id'];
                 } else {
                     $target_cat_id = $old_categories_id;
                 }
                 foreach ($array as $pid) {
                     mslib_befe::duplicateProduct($pid, $target_cat_id);
                 }
             }
             break;
         default:
             // custom page hook that can be controlled by third-party plugin
             if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/scripts/admin_pages/admin_products_search_and_edit.php']['adminProductsSearchAndEditActionProductIteratorProc'])) {
                 $params = array('action' => &$this->post['tx_multishop_pi1']['action'], 'postMessageArray' => &$postMessageArray);
                 foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/scripts/admin_pages/admin_products_search_and_edit.php']['adminProductsSearchAndEditActionProductIteratorProc'] as $funcRef) {
                     \TYPO3\CMS\Core\Utility\GeneralUtility::callUserFunction($funcRef, $params, $this);
                 }
             }
             // custom page hook that can be controlled by third-party plugin eof
             break;
     }
 }
Exemple #22
0
                $tmp_listing .= '<li class="ui-menu-item ui-menu-item-alternate" role="menuitem">
					<a alt="' . substr($customer['name'], 0, 50) . '" class="ui-corner-all" tabindex="-1" href="' . mslib_fe::typolink($this->shop_pid . ',2003', '&tx_multishop_pi1[page_section]=edit_customer&tx_multishop_pi1[cid]=' . $customer['uid'] . '&action=edit_customer', 1) . '">
						<div class="single_row">' . substr($customer['name'], 0, 50) . '</div>
					</a>
				</li>';
            }
            $tmp_listing .= '<li class="ui-category"><span id="admin_ajax_res_footer">' . $this->pi_getLL('admin_label_total_number') . ': ' . $resultset['customers']['total_rows'] . '</span></li>';
        }
        // end customers
        // products
        if (count($resultset['products']['products'])) {
            $tmp_listing .= '<li class="ui-category"><span id="admin_ajax_res_header">' . $this->pi_getLL('products') . '</span></li>';
            foreach ($resultset['products']['products'] as $product) {
                $prod_link = mslib_fe::typolink($this->shop_pid . ',2003', 'tx_multishop_pi1[page_section]=edit_product&cid=' . $product['categories_id'] . '&pid=' . $product['products_id'] . '&action=edit_product', 1);
                if ($product['products_image']) {
                    $prod_image = '<div class="ajax_products_image">' . '<img src="' . mslib_befe::getImagePath($product['products_image'], 'products', '50') . '">' . '</div>';
                } else {
                    $prod_image = '<div class="ajax_products_image"><div class="no_image_50"></div>
					</div>';
                }
                $prod_name = '<div class="ajax_products_name">' . substr($product['products_name'], 0, 50) . '</div>';
                $prod_desc = '<div class="ajax_products_shortdescription">' . str_highlight(substr($product['products_shortdescription'], 0, 75), $this->get['q']) . '</div>';
                if ($product['products_price'] != $product['final_price']) {
                    $prod_price = '<div class="ajax_products_price"><div class="ajax_old_price">' . mslib_fe::amount2Cents($product['products_price'], 0) . '</div><div class="ajax_specials_price">' . mslib_fe::amount2Cents($product['final_price'], 0) . '</div></div>';
                } else {
                    $prod_price = '<div class="ajax_products_price"><div class="ajax_normal_price">' . mslib_fe::amount2Cents($product['products_price'], 0) . '</div></div>';
                }
                $tmp_listing .= '<li class="ui-menu-item ui-menu-item-alternate" role="menuitem">
					<a alt="test product" class="ui-corner-all" tabindex="-1" href="' . $prod_link . '">
						<div class="ajax_products_image_wrapper">
							' . $prod_image . '
<?php

if (!defined('TYPO3_MODE')) {
    die('Access denied.');
}
set_time_limit(86400);
ignore_user_abort(true);
mslib_befe::rebuildFlatDatabase();
$content .= 'Flat database created.';
            }
            $where = substr($where, 0, strlen($where) - 1);
            $where .= '&';
        }
        // get all cats to generate multilevel fake url eof
    }
    $link = mslib_fe::typolink($this->conf['products_detail_page_pid'], '&' . $where . '&products_id=' . $product['products_id'] . '&tx_multishop_pi1[page_section]=products_detail&skeywords=' . urlencode($this->get['q']));
    $prod['Link'] = $link;
    if ($product['products_image']) {
        $prod['Image'] = '<div class="ajax_products_image">' . '<img src="' . mslib_befe::getImagePath($product['products_image'], 'products', '50') . '">' . '</div>';
    } else {
        $prod['Image'] = '<div class="ajax_products_image"><div class="no_image_50"></div></div>';
    }
    $prod['Title'] = '<div class="ajax_products_name">' . substr($product['products_name'], 0, 50) . '</div><div class="ajax_products_model">' . substr($product['products_model'], 0, 50) . '</div>';
    $prod['Title'] = $prod['Title'];
    $prod['Desc'] = '<div class="ajax_products_shortdescription">' . addslashes(mslib_befe::str_highlight(substr($product['products_shortdescription'], 0, 75), $this->get['q'])) . '</div>';
    if ($product['products_price'] != $product['final_price']) {
        $prod['Price'] = '<div class="ajax_products_price"><div class="ajax_old_price">' . mslib_fe::amount2Cents($product['products_price']) . '</div><div class="ajax_specials_price">' . mslib_fe::amount2Cents($product['final_price']) . '</div></div>';
    } else {
        $prod['Price'] = '<div class="ajax_products_price"><div class="ajax_normal_price">' . mslib_fe::amount2Cents($product['products_price']) . '</div></div>';
    }
    $prod['Name'] = substr($product['products_name'], 0, 50);
    $prod['skeyword'] = $this->get['q'];
    $prod['Page'] = $pages;
    $prod['Product'] = true;
    $data[] = $prod;
}
if (isset($this->get['page'])) {
    if ($totpage > 1) {
        //echo $totpage;
        if ($pages != $totpage) {
                        for ($i = $sc_row; $i <= 10; $i++) {
                            $nextVal = $i + 1;
                            if ($row_counter == 1) {
                                $content .= '<div id="' . $zone_pid . '_Row_' . $i . '" class="form-group">';
                            } else {
                                $content .= '<div id="' . $zone_pid . '_Row_' . $i . '" class="form-group" style="display:none">';
                            }
                            $content .= '
								<label id="' . $zone_pid . '_Label_' . $i . '" class="form-inline control-label col-md-4 firstLabel">Level ' . $i . ':
								<span id="' . $zone_pid . '_BeginWeightLevel' . $i . '" >0 ' . $this->pi_getLL('admin_shipping_kg') . '</span>
								<span id="' . $zone_pid . '_TotLevel' . $i . '" > ' . $this->pi_getLL('up_to_and_including') . ' </span>
								';
                            $disabled = '';
                            if ($row_counter == 1) {
                                $content .= '<select class="form-control" name="' . $row['id'] . ":" . $zone['id'] . '[]" id="' . $zone_pid . '_EndWeightLevel' . $i . '" onchange="UpdateWeightPrice(' . $nextVal . ', ' . $zone_pid . ', this.value); ">
										' . mslib_befe::createSelectboxWeightsList() . '
										</select>';
                            } else {
                                $disabled = ' disabled="disabled"';
                                $content .= '<select class="form-control" name="' . $row['id'] . ":" . $zone['id'] . '[]" id="' . $zone_pid . '_EndWeightLevel' . $i . '" onchange="UpdateWeightPrice(' . $nextVal . ', ' . $zone_pid . ', this.value); "></select>';
                            }
                            $content .= '</label>
								<div class="col-md-8">
									<div id="' . $zone_pid . '_PriceLevel' . $i . '">
										<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 ' . $zone_pid . '_priceInput' . $i . '" value="" rel="' . $row['id'] . '"' . $disabled . ' 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 ' . $zone_pid . '_priceInput' . $i . '" value="" rel="' . $row['id'] . '"' . $disabled . ' 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;display:none;" size="3" name="' . $zone_pid . '_Price[]" id="' . $zone_pid . '_Price' . $i . '" value="" class="priceInputReal ' . $zone_pid . '_priceInput' . $i . '"' . $disabled . '/></div>
									</div>
								</div>
							</div>';
                            $row_counter++;
					$(v).removeAttr("disabled");
					$(c_selectbox_id).removeAttr("disabled");
				});
			}
		}
	});
});
</script>';
$counter = 0;
$categories = mslib_fe::getSubcatsOnly($this->categoriesStartingPoint, 1);
$cat_selectbox = '';
$contentItem = '';
foreach ($categories as $category) {
    $counter++;
    if ($category['categories_image']) {
        $image = '<img src="' . mslib_befe::getImagePath($category['categories_image'], 'categories', 'normal') . '" alt="' . htmlspecialchars($category['categories_name']) . '">';
    } else {
        $image = '<div class="no_image"></div>';
    }
    // get all cats to generate multilevel fake url
    $level = 0;
    $cats = mslib_fe::Crumbar($category['categories_id']);
    $cats = array_reverse($cats);
    $where = '';
    if (count($cats) > 0) {
        foreach ($cats as $item) {
            $where .= "categories_id[" . $level . "]=" . $item['id'] . "&";
            $level++;
        }
        $where = substr($where, 0, strlen($where) - 1);
        $where .= '&';
Exemple #27
0
 $markerArray['ITEM_COUNTER'] = $itemCounter;
 $markerArray['PRODUCTS_NAME'] = $current_product['products_name'];
 $markerArray['PRODUCTS_MODEL'] = $current_product['products_model'];
 $markerArray['PRODUCTS_DESCRIPTION'] = $current_product['products_description'];
 $markerArray['PRODUCTS_SHORTDESCRIPTION'] = $current_product['products_shortdescription'];
 $markerArray['PRODUCTS_SHORT_DESCRIPTION'] = $current_product['products_shortdescription'];
 $markerArray['PRODUCTS_DETAIL_PAGE_LINK'] = $output['link'];
 $markerArray['CATEGORIES_NAME'] = $current_product['categories_name'];
 $markerArray['CATEGORIES_NAME_PAGE_LINK'] = $output['catlink'];
 $markerArray['PRODUCTS_IMAGE'] = $output['image'];
 $markerArray['PRODUCTS_IMAGE_200'] = $output['image_200'];
 $markerArray['PRODUCTS_IMAGE_300'] = $output['image_300'];
 $markerArray['PRODUCTS_IMAGE_URL'] = mslib_befe::getImagePath($current_product['products_image'], 'products', $this->imageWidth);
 $markerArray['PRODUCTS_IMAGE_URL_100'] = mslib_befe::getImagePath($current_product['products_image'], 'products', '100');
 $markerArray['PRODUCTS_IMAGE_URL_200'] = mslib_befe::getImagePath($current_product['products_image'], 'products', '200');
 $markerArray['PRODUCTS_IMAGE_URL_300'] = mslib_befe::getImagePath($current_product['products_image'], 'products', '300');
 $markerArray['PRODUCTS_PRICE'] = $output['products_price'];
 $markerArray['PRODUCTS_PRICE_PER_EACH'] = $output['products_price_per_each'];
 $markerArray['OLD_PRICE_WITH_CONTAINER'] = $output['old_price_with_container'];
 $markerArray['PRODUCTS_SKU'] = $current_product['sku_code'];
 $markerArray['PRODUCTS_EAN'] = $current_product['ean_code'];
 $markerArray['PRODUCTS_URL'] = $current_product['products_url'];
 $markerArray['ORDER_UNIT_NAME'] = $current_product['order_unit_name'];
 $markerArray['MANUFACTURERS_ID'] = $current_product['manufacturers_id'];
 $markerArray['MANUFACTURERS_NAME'] = $current_product['manufacturers_name'];
 $markerArray['OLD_PRICE'] = '';
 if ($current_product['old_price']) {
     $markerArray['OLD_PRICE'] = mslib_fe::amount2Cents($current_product['old_price']);
 }
 $markerArray['FINAL_PRICE'] = mslib_fe::amount2Cents($current_product['final_price']);
 $markerArray['OLD_PRICE_PLAIN'] = number_format($current_product['old_price'], 2, ',', '.');
     if ($oldsearch) {
         if ($this->ms['MODULES']['REGULAR_SEARCH_MODE'] == '%keyword') {
             // do normal indexed search
             $filter[] = "(" . $tbl . "products_name like '%" . addslashes($this->get['skeyword']) . "')";
         } else {
             if ($this->ms['MODULES']['REGULAR_SEARCH_MODE'] == 'keyword%') {
                 // do normal indexed search
                 $filter[] = "(" . $tbl . "products_name like '" . addslashes($this->get['skeyword']) . "%')";
             } else {
                 // do normal indexed search
                 $filter[] = "(" . $tbl . "products_name like '%" . addslashes($this->get['skeyword']) . "%')";
             }
         }
     } else {
         // do fulltext search
         $tmpstr = addslashes(mslib_befe::ms_implode(', ', $array, '"', '+', true));
         $select[] = "MATCH (" . $tbl . "products_name) AGAINST ('" . $tmpstr . "' in boolean mode) AS score";
         $where[] = "MATCH (" . $tbl . "products_name) AGAINST ('" . $tmpstr . "' in boolean mode)";
         $orderby[] = 'score desc';
     }
 } else {
     $orderby[] = 'rand()';
 }
 // filter by products name eof
 if ($this->ms['MODULES']['FLAT_DATABASE']) {
     $orderby[] = 'final_price_difference desc';
 } else {
     $orderby[] = 'p.products_date_available desc';
 }
 if ($this->ajax_content) {
     $limit = 4;
                     $address['fax'] = $user['fax'];
                     $address['deleted'] = 0;
                     $address['page_uid'] = $this->shop_pid;
                     if ($item['deleted'] != '') {
                         $address['deleted'] = $item['deleted'];
                     }
                     $address['addressgroup'] = '';
                     $str = "SELECT tx_multishop_customer_id from tt_address where tx_multishop_customer_id='" . $uid . "'";
                     $qry = $GLOBALS['TYPO3_DB']->sql_query($str);
                     if ($GLOBALS['TYPO3_DB']->sql_num_rows($qry)) {
                         $query = $GLOBALS['TYPO3_DB']->UPDATEquery('tt_address', 'tx_multishop_customer_id=' . $uid, $address);
                         $res = $GLOBALS['TYPO3_DB']->sql_query($query);
                     } else {
                         $address['tx_multishop_default'] = 1;
                         $address['tx_multishop_address_type'] = 'billing';
                         $address = mslib_befe::rmNullValuedKeys($address);
                         $query = $GLOBALS['TYPO3_DB']->INSERTquery('tt_address', $address);
                         $res = $GLOBALS['TYPO3_DB']->sql_query($query);
                         $uid = $GLOBALS['TYPO3_DB']->sql_insert_id();
                     }
                 }
             }
         }
         if ($log_file) {
             $content = '';
         }
         // end foreach
     }
     // if($file_location and file_exists($file_location))
     // @unlink($file_location);
 }
Exemple #30
0
        //$str2="SELECT * from static_countries c, tx_multishop_countries_to_zones c2z where c2z.cn_iso_nr=c.cn_iso_nr order by c.cn_short_en";
        $qry2 = $GLOBALS['TYPO3_DB']->sql_query($str2);
        $enabled_countries = array();
        while (($row2 = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($qry2)) != false) {
            $countries_name = mslib_fe::getTranslatedCountryNameByEnglishName($this->lang, $row2['cn_short_en']);
            $row2['locale_countries_name'] = $countries_name;
            $enabled_countries[$countries_name] = $row2;
        }
        ksort($enabled_countries);
        // load enabled countries to array eof
        if (count($enabled_countries) == 1) {
            $deliver_to_sb .= '<input name="deliver_to_country" type="hidden" value="' . mslib_befe::strtolower($enabled_countries[0]['cn_short_en']) . '" />';
        } else {
            $default_country = mslib_fe::getCountryByIso($this->tta_shop_info['cn_iso_nr']);
            foreach ($enabled_countries as $country) {
                $tmpcontent_con .= '<option value="' . mslib_befe::strtolower($country['cn_short_en']) . '" ' . (mslib_befe::strtolower($default_country['cn_short_en']) == mslib_befe::strtolower($country['cn_short_en']) ? 'selected' : '') . '>' . htmlspecialchars($country['locale_countries_name']) . '</option>';
            }
            if ($tmpcontent_con) {
                $deliver_to_sb .= '
				<select name="deliver_to_country" id="deliver_to_country" class="country" title="' . $this->pi_getLL('country_is_required') . '">
					' . $tmpcontent_con . '
				</select>
				';
            }
        }
        // country eof
        $subpartArray['###SHIPPING_COST_COUNTRY_SELECTION###'] = '
		<div class="shoppingcart_shipping_cost_wrapper">
			<div class="shipping_deliver_to"><label for="deliver_to_country">' . $this->pi_getLL('deliver_in') . '<label>' . $deliver_to_sb . '</div>
			<div class="shipping_deliver_by"></div>
		</div>