Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Leaderboard

Popular Content

Showing content with the highest reputation on 11/03/2011 in all areas

  1. Имеется: - пробная установка ocStore v1.0.1 релиз в раздел сайта (по урлу вида http://thesite.dom/teststore/) - включены ЧПУ типа SeoPro - заданы алиасы категориям и товарам - .htaccess содержит обычное ... RewriteEngine On RewriteBase /teststore/ RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^([^?]*) index.php?_route_=$1 [L,QSA] ... При попытке перейти по ЧПУ-ссылке категории вида http://thesite.dom/teststore/testcategory/ получаем диагностику redirect loop в браузере, а апачев accesslog пишет что-то вроде: "GET /teststore/testcategory/ HTTP/1.1" 301 - "GET /teststore/testcategory/ HTTP/1.1" 301 - "GET /teststore/testcategory/ HTTP/1.1" 301 - "GET /teststore/testcategory/ HTTP/1.1" 301 - "GET /teststore/testcategory/ HTTP/1.1" 301 - ... и так много раз подряд.В файле catalog/controller/common/seo_pro.php за это ответственен такой участок кода: class ControllerCommonSeoPro extends Controller { ... skipped ... private function validate($link) { ... skipped ... $seo_url = $this->url->link($this->request->get['route'], $args, $scheme); $seo_url = str_replace('&', '&', $seo_url); if ($link != rawurldecode(ltrim(parse_url($seo_url, PHP_URL_PATH), '/'))) { // <== вот тут не сработало условие $get[] = 'route'; $data = array_diff_key($this->request->get, array_flip($get)); if (count($data)) { $seo_url .= (strpos($seo_url, '?') === false) ? '?' : '&'; $seo_url .= urldecode(http_build_query($data)); } header($this->request->server['SERVER_PROTOCOL'] . ' 301 Moved Permanently'); $this->response->redirect($seo_url); } } } У себя исправил так: class ControllerCommonSeoPro extends Controller { ... skipped ... private function validate($link) { ... skipped ... $seo_url = $this->url->link($this->request->get['route'], $args, $scheme); $seo_url = str_replace('&', '&', $seo_url); $linkpfx = ltrim(parse_url($this->config->get('config_url'), PHP_URL_PATH), '/'); if ($linkpfx.$link != rawurldecode(ltrim(parse_url($seo_url, PHP_URL_PATH), '/'))) { //if ($link != rawurldecode(ltrim(parse_url($seo_url, PHP_URL_PATH), '/'))) { $get[] = 'route'; $data = array_diff_key($this->request->get, array_flip($get)); if (count($data)) { $seo_url .= (strpos($seo_url, '?') === false) ? '?' : '&'; $seo_url .= urldecode(http_build_query($data)); } header($this->request->server['SERVER_PROTOCOL'] . ' 301 Moved Permanently'); $this->response->redirect($seo_url); } } }
    1 point
  2. видно задача "смутно просматривается" (недостаточно обрисована). а гадать, чтобы дать совет - не хорошо.
    1 point
  3. в файл .htaccess попробуй добавить строки # php 5 only, afaik. handy when your server isn't where YOU are. php_value date.timezone Europe/Moscowну, или другой город, с указанием региона и города.
    1 point
  4. оставил только цену и добавил использование токенов admin\controller\catalog\product.php добавить public function price() { if ($this->request->server['REQUEST_METHOD'] == 'POST') { $this->db->query("UPDATE " . DB_PREFIX . "product SET price = '" . (float)$this->request->post['price'] . "' WHERE product_id = '" . (int)$this->request->post['product_id'] . "'"); $this->cache->delete('product'); } } admin\view\template\catalog\product_list.tpl заменить: <td class="left"> <?php if ($product['special']) { ?> <span style="text-decoration:line-through"><?php echo $product['price']; ?></span><br/><span style="color:#b00;"><?php echo $product['special']; ?></span> <?php } else { ?> <?php echo $product['price']; ?> <?php } ?> </td> на <td> <input type="text" name="price" value="<?php echo $product['price']; ?>" size="10" id="price<?php echo $product['product_id']; ?>" /> <a onclick="updatePrice(<?php echo $product['product_id']; ?>);$(this).fadeTo(250, 0.2);$(this).fadeTo(150, 0.7);" class="save">Save</a> </td> в конце где скрипты добавил: <script type="text/javascript"><!-- function updatePrice(product_id) { var price = $('#price' + product_id).val(); $.post('index.php?route=catalog/product/price&token=<?php echo $token; ?>', 'price=' + price + '&product_id=' + product_id); } //--></script> к скрипту который описал SOOR добавил &token=<?php echo $token; ?> на версии 0.2.0 работает SOOR в очередной раз спасибо
    1 point
Guest
×
  • Create New...

Important Information

On our site, cookies are used and personal data is processed to improve the user interface. To find out what and what personal data we are processing, please go to the link. If you click "I agree," it means that you understand and accept all the conditions specified in this Privacy Notice.