Перейти до вмісту
Пошук в
  • Детальніше...
Шукати результати, які ...
Шукати результати в ...

[How-To] Установка ColorBox вместо стандартного ThickBox


Recommended Posts

Как аккуратнее написать- не знаю.

аккуратнее такой большой код писать в спойлере.

1. код менять нужно не только в header.tpl

2. смотрим внимательно как называется папка на хостинге (ColorBox должно быть - регистр имеет значение)

3. если не помогло - записываемся к хирургу и выпрямляем руки

  • +1 1
Надіслати
Поділитися на інших сайтах


Спасибо огромное за описание! Все работает, только не удается поставить эффект расширения картинки. Ставлю initialHeight: 50 и initialWidth: 50 но картинка по прежнему загружается в полный размер. Подскажите, где еще параметр можно подправить этот? Я уже переустанавливал все заново- без толку.

Надіслати
Поділитися на інших сайтах


  • 3 weeks later...
  • 4 weeks later...

В очередной раз низкий поклон автору темы.

Всё получилось с первого раза! (что не так часто, у меня бывает :))

От себя кое-что долепил.

так было:

<script src="catalog/view/javascript/jquery/ColorBox/jquery.colorbox.js"> </script>
так стало:

<script type="text/javascript" src="catalog/view/javascript/jquery/ColorBox/jquery.colorbox.js"> </script>
так было:

<script>
 $(document).ready(function(){ - ну и понеслось дальше . . .
так стало:

<script type="text/javascript">
 $(document).ready(function(){- ну и понеслось дальше . . .

Эти изменения помогли сделать код валидным (все изменения делал своим любимым методом "тыка").

Мыли вслух: Жалко вот только, что автор пропал.

Надіслати
Поділитися на інших сайтах


Товарищ Автор, подскажите, что можно сделать (кроме выпрямления рук у хирурга) если все указанные способы установки не приносят результата? Распаковал архив как в инструкции, изменил регистр папки ColorBox. В итоге в ней у меня три фаила:

jquery.colorbox.js

colorbox.css

и папка images

Потом я исправил код в product.tpl и конечно же поставил все в header.tpl ошибок быть не должно, но есть. Картинка открывается в новой вкладке.

Надеюсь на Вашу помощь.

Надіслати
Поділитися на інших сайтах


...Картинка открывается в новой вкладке....

Если это происходит, значит что то Вы пропустили...

Обратите внимание на строки:

<script src="catalog/view/javascript/jquery/ColorBox/jquery.colorbox.js"> </script>
 <link media="screen" rel="stylesheet" href="catalog/view/javascript/jquery/ColorBox/colorbox.css" />

И, было бы вообще замечательно, если бы Вы прикрепляли файлы (которые редактировали) к своему посту...

Надіслати
Поділитися на інших сайтах

Так все и есть

Вот мой header.tpl

<?php if (isset($_SERVER['HTTP_USER_AGENT']) && !strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE 6')) echo '<?xml version="1.0" encoding="UTF-8"?>'. "\n"; ?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" dir="<?php echo $direction; ?>" lang="<?php echo $lang; ?>" xml:lang="<?php echo $lang; ?>">

<head>

<title><?php echo $title; ?></title>

<?php if ($keywords) { ?>

<meta name="keywords" content="<?php echo $keywords; ?>" />

<?php } ?>

<?php if ($description) { ?>

<meta name="description" content="<?php echo $description; ?>" />

<?php } ?>

<base href="<?php echo $base; ?>" />

<?php if ($icon) { ?>

<link href="<?php echo $icon; ?>" rel="icon" />

<?php } ?>

<?php foreach ($links as $link) { ?>

<link href="<?php echo str_replace('&', '&', $link['href']); ?>" rel="<?php echo $link['rel']; ?>" />

<?php } ?>

<link rel="stylesheet" type="text/css" href="catalog/view/theme/<?php echo $template; ?>/stylesheet/stylesheet.css" />

<link href='http://fonts.googleapis.com/css?family=Yanone+Kaffeesatz:light,regular' rel='stylesheet' type='text/css'>

<link href='http://fonts.googleapis.com/css?family=Philosopher' rel='stylesheet' type='text/css'>

<!--[if lt IE 7]>

<link rel="stylesheet" type="text/css" href="catalog/view/theme/default/stylesheet/ie6.css" />

<script type="text/javascript" src="catalog/view/javascript/DD_belatedPNG_0.0.8a-min.js"></script>

<script type="text/javascript" src="catalog/view/javascript/jquery/ColorBox/jquery.colorbox.js"> </script>

<link media="screen" rel="stylesheet" href="catalog/view/javascript/jquery/ColorBox/colorbox.css" />

<script>

DD_belatedPNG.fix('img, #header .div3 a, #content .left, #content .right, .box .top');

</script>

<![endif]-->

<?php foreach ($styles as $style) { ?>

<link rel="<?php echo $style['rel']; ?>" type="text/css" href="<?php echo $style['href']; ?>" media="<?php echo $style['media']; ?>" />

<?php } ?>

<script type="text/javascript" src="catalog/view/javascript/jquery/jquery-1.3.2.min.js"></script>

<script type="text/javascript" src="catalog/view/javascript/jquery/thickbox/thickbox-compressed.js"></script>

<link rel="stylesheet" type="text/css" href="catalog/view/javascript/jquery/thickbox/thickbox.css" />

<script type="text/javascript" src="catalog/view/javascript/jquery/tab.js"></script>

<?php foreach ($scripts as $script) { ?>

<script type="text/javascript" src="<?php echo $script; ?>"></script>

<?php } ?>

<script type="text/javascript"><!--

function bookmark(url, title) {

if (window.sidebar) { // firefox

window.sidebar.addPanel(title, url, "");

} else if(window.opera && window.print) { // opera

var elem = document.createElement('a');

elem.setAttribute('href',url);

elem.setAttribute('title',title);

elem.setAttribute('rel','sidebar');

elem.click();

} else if(document.all) {// ie

window.external.AddFavorite(url, title);

}

}

//--></script>

<script>

$(document).ready(function(){

$("a[rel=slideshow]").colorbox({

title: false, //Показывать наименование Товара

slideshow:true, //Включаем СлайдШоу. Включен по умолчанию (если надо выключить - ставим true)

slideshowSpeed: 2500, //Скорость смены картинки

speed:1000, // Скорость эффекта "масштабирование"

preloading: true, //Значек загрузки

current: "Изображение {current} из {total}", //Выводим номер текущей и общее число картинок на русском

previous: "Назад", //Подсказки к кнопкам (для некоторых тем)

next: "Вперёд", //Подсказки к кнопкам (для некоторых тем)

close: "Закрыть", //Подсказки к кнопкам (для некоторых тем)

slideshowStart: "Продолжить", //Русифицируем кнопку Start для СлайдШоу

slideshowStop: "Пауза", //Русифицируем кнопку Stop для СлайдШоу

opacity: 0.7, //Сила затемнения, (допустимые значения от 0.1 до 1) 0.1 - самое слабое, 1 - самое сильное

});

//Example of preserving a JavaScript event for inline calls.

$("#click").click(function(){

$('#click').css({"background-color":"#f00", "color":"#fff", "cursor":"inherit"}).text("Open this window again and this message will still be here.");

return false;

});

});

</script>

<link rel="stylesheet" type="text/css" href="catalog/view/theme/default/stylesheet/footerslider.css" />

<script type="text/javascript" src="catalog/view/javascript/jquery/jcarousel-lite.js"></script>

<script type="text/javascript" src="catalog/view/javascript/jquery/footerslider.js"></script>

</head>

<body>

<?php if (isset($common_error)) { ?>

<div class="warning"><?php echo $common_error; ?></div>

<?php } ?>

<div id="container">

<div id="container-inner">

<div id="header">

<div id="logo">

<?php if ($logo) { ?>

<a href="<?php echo str_replace('&', '&', $home); ?>"><img src="<?php echo $logo; ?>" title="<?php echo $store; ?>" alt="<?php echo $store; ?>" /></a>

<?php } ?>

</div>

<!-- /logo -->

<ul id="nav">

<li><a href="<?php echo str_replace('&', '&', $home); ?>" id="tab_home"><?php echo $text_home; ?></a></li>

<?php if (!$logged) { ?>

<li><a href="<?php echo str_replace('&', '&', $login); ?>" id="tab_login"><?php echo $text_login; ?></a></li>

<?php } else { ?>

<li><a href="<?php echo str_replace('&', '&', $logout); ?>" id="tab_logout"><?php echo $text_logout; ?></a></li>

<?php } ?>

<li><a href="<?php echo str_replace('&', '&', $account); ?>" id="tab_account"><?php echo $text_account; ?></a></li>

<li><a href="<?php echo str_replace('&', '&', $cart); ?>" id="tab_cart"><?php echo $text_cart; ?></a></li>

<li class="last"><a href="<?php echo str_replace('&', '&', $checkout); ?>" id="tab_checkout"><?php echo $text_checkout; ?></a></li>

</ul>

<!-- /nav -->

<!-- /search -->

<div id="local">

<?php if ($currencies) { ?>

<form action="<?php echo str_replace('&', '&', $action); ?>" method="post" enctype="multipart/form-data" id="currency_form">

<div class="switcher">

<?php foreach ($currencies as $currency) { ?>

<?php if ($currency['code'] == $currency_code) { ?>

<div class="selected"><a><?php echo $currency['title']; ?></a></div>

<?php } ?>

<?php } ?>

<div class="option">

<?php foreach ($currencies as $currency) { ?>

<a onclick="$('input[name=\'currency_code\']').attr('value', '<?php echo $currency['code']; ?>'); $('#currency_form').submit();"><?php echo $currency['title']; ?></a>

<?php } ?>

</div>

</div>

<div style="display: inline;">

<input type="hidden" name="currency_code" value="" />

<input type="hidden" name="redirect" value="<?php echo $redirect; ?>" />

</div>

</form>

<?php } ?>

<?php if ($languages) { ?>

<form action="<?php echo str_replace('&', '&', $action); ?>" method="post" enctype="multipart/form-data" id="language_form">

<div class="switcher">

<?php foreach ($languages as $language) { ?>

<?php if ($language['code'] == $language_code) { ?>

<div class="selected"><a><img src="image/flags/<?php echo $language['image']; ?>" alt="<?php echo $language['name']; ?>" />  <?php echo $language['name']; ?></a></div>

<?php } ?>

<?php } ?>

<div class="option">

<?php foreach ($languages as $language) { ?>

<a onclick="$('input[name=\'language_code\']').attr('value', '<?php echo $language['code']; ?>'); $('#language_form').submit();"><img src="image/flags/<?php echo $language['image']; ?>" alt="<?php echo $language['name']; ?>" />  <?php echo $language['name']; ?></a>

<?php } ?>

</div>

</div>

<div>

<input type="hidden" name="language_code" value="" />

<input type="hidden" name="redirect" value="<?php echo $redirect; ?>" />

</div>

</form>

<?php } ?>

</div>

<!-- /local -->

<div id="breadcrumb">

<?php foreach ($breadcrumbs as $breadcrumb) { ?>

<?php echo str_replace(">","»",$breadcrumb['separator']); ?><a href="<?php echo str_replace('&', '&', $breadcrumb['href']); ?>"><?php echo $breadcrumb['text']; ?></a>

<?php } ?>

</div>

<!-- /breadcrumb -->

</div>

<script type="text/javascript"><!--

function getURLVar(urlVarName) {

var urlHalves = String(document.location).toLowerCase().split('?');

var urlVarValue = '';

if (urlHalves[1]) {

var urlVars = urlHalves[1].split('&');

for (var i = 0; i <= (urlVars.length); i++) {

if (urlVars) {

var urlVarPair = urlVars.split('=');

if (urlVarPair[0] && urlVarPair[0] == urlVarName.toLowerCase()) {

urlVarValue = urlVarPair[1];

}

}

}

}

return urlVarValue;

}

$(document).ready(function() {

route = getURLVar('route');

if (!route) {

$('#tab_home').addClass('selected');

} else {

part = route.split('/');

if (route == 'common/home') {

$('#tab_home').addClass('selected');

} else if (route == 'account/login') {

$('#tab_login').addClass('selected');

} else if (part[0] == 'account') {

$('#tab_account').addClass('selected');

} else if (route == 'checkout/cart') {

$('#tab_cart').addClass('selected');

} else if (part[0] == 'checkout') {

$('#tab_checkout').addClass('selected');

} else {

$('#tab_home').addClass('selected');

}

}

});

//--></script>

<script type="text/javascript"><!--

$('#search input').keydown(function(e) {

if (e.keyCode == 13) {

moduleSearch();

}

});

function moduleSearch() {

url = 'index.php?route=product/search';

var filter_keyword = $('#filter_keyword').attr('value')

if (filter_keyword) {

url += '&keyword=' + encodeURIComponent(filter_keyword);

}

var filter_category_id = $('#filter_category_id').attr('value');

if (filter_category_id) {

url += '&category_id=' + filter_category_id;

}

location = url;

}

//--></script>

<script type="text/javascript"><!--

$('.switcher').bind('click', function() {

$(this).find('.option').slideToggle('fast');

});

$('.switcher').bind('mouseleave', function() {

$(this).find('.option').slideUp('fast');

});

//--></script>

Может, этот скрипт как то конфрантирует с другими модулями? Я все делал по инструкции.

Вот на всякий случай и product.tpl

<?php echo $header; ?><?php echo $column_left; ?><?php echo $column_right; ?>

<div id="content">

<div class="top">

<div class="left"></div>

<div class="right"></div>

<div class="center">

<h1><?php echo $heading_title; ?></h1>

</div>

</div>

<div class="middle">

<div style="width: 100%; margin-bottom: 30px;">

<table style="width: 100%; border-collapse: collapse;">

<tr>

<td style="text-align: center; width: 250px; vertical-align: top;"><a href="<?php echo $popup; ?>" title="<?php echo $heading_title; ?>" rel="slideshow" rel="gallery"><img src="<?php echo $thumb; ?>" title="<?php echo $heading_title; ?>" alt="<?php echo $heading_title; ?>" id="image" style="margin-bottom: 3px;" /></a><br />

<span style="font-size: 11px;"><?php echo $text_enlarge; ?></span></td>

<td style="padding-left: 15px; width: 296px; vertical-align: top;"><table width="100%">

<?php if ($display_price) { ?>

<tr>

<td><b><?php echo $text_price; ?></b></td>

<td><?php if (!$special) { ?>

<?php echo $price; ?>

<?php } else { ?>

<span style="text-decoration: line-through;"><?php echo $price; ?></span> <span style="color: #F00;"><?php echo $special; ?></span>

<?php } ?></td>

</tr>

<?php } ?>

<tr>

<td><b><?php echo $text_availability; ?></b></td>

<td><?php echo $stock; ?></td>

</tr>

<?php if ($manufacturer) { ?>

<tr>

<td><b><?php echo $text_manufacturer; ?></b></td>

<td><a href="<?php echo str_replace('&', '&', $manufacturers); ?>"><?php echo $manufacturer; ?></a></td>

</tr>

<?php } ?>

<?php if ($review_status) { ?>

<tr>

<td><b><?php echo $text_average; ?></b></td>

<td><?php if ($average) { ?>

<img src="catalog/view/theme/default/image/stars_<?php echo $average . '.png'; ?>" alt="<?php echo $text_stars; ?>" style="margin-top: 2px;" />

<?php } else { ?>

<?php echo $text_no_rating; ?>

<?php } ?></td>

</tr>

<?php } ?>

</table>

<br />

<?php if ($display_price) { ?>

<form action="<?php echo str_replace('&', '&', $action); ?>" method="post" enctype="multipart/form-data" id="product">

<?php if ($options) { ?>

<b><?php echo $text_options; ?></b><br />

<div style="background: #FFFFCC; border: 1px solid #FFCC33; padding: 10px; margin-top: 2px; margin-bottom: 15px;">

<table style="width: 100%;">

<?php foreach ($options as $option) { ?>

<tr>

<td><?php echo $option['name']; ?>:<br />

<select name="option[<?php echo $option['option_id']; ?>]">

<?php foreach ($option['option_value'] as $option_value) { ?>

<option value="<?php echo $option_value['option_value_id']; ?>"><?php echo $option_value['name']; ?>

<?php if ($option_value['price']) { ?>

<?php echo $option_value['prefix']; ?><?php echo $option_value['price']; ?>

<?php } ?>

</option>

<?php } ?>

</select></td>

</tr>

<?php } ?>

</table>

</div>

<?php } ?>

<?php if ($display_price) { ?>

<?php if ($discounts) { ?>

<b><?php echo $text_discount; ?></b><br />

<div style="background: #DBDACC; border: 1px solid #C1C4AC; padding: 10px; margin-top: 2px; margin-bottom: 15px;">

<table style="width: 100%;">

<tr>

<td style="text-align: right;"><b><?php echo $text_order_quantity; ?></b></td>

<td style="text-align: right;"><b><?php echo $text_price_per_item; ?></b></td>

</tr>

<?php foreach ($discounts as $discount) { ?>

<tr>

<td style="text-align: right;"><?php echo $discount['quantity']; ?></td>

<td style="text-align: right;"><?php echo $discount['price']; ?></td>

</tr>

<?php } ?>

</table>

</div>

<?php } ?>

<?php } ?>

<div class="content">

<?php echo $text_qty; ?>

<input type="text" name="quantity" size="3" value="<?php echo $minimum; ?>" />

<a onclick="$('#product').submit();" id="add_to_cart" class="button"><span><?php echo $button_add_to_cart; ?></span></a>

<?php if ($minimum > 1) { ?><br/><small><?php echo $text_minimum; ?></small><?php } ?>

</div>

<div>

<input type="hidden" name="product_id" value="<?php echo $product_id; ?>" />

<input type="hidden" name="redirect" value="<?php echo str_replace('&', '&', $redirect); ?>" />

</div>

</form>

<?php } ?></td>

</tr>

</table>

</div>

<div class="tabs">

<a tab="#tab_image"><?php echo $tab_image; ?> (<?php echo count($images); ?>)</a>

<? if ($this->config->get('wp_vkcomment_status')==1)

echo "<a tab=\"#tab_vkcomment\">Комментарии</a>"; ?>

<a tab="#tab_description"><?php echo $tab_description; ?></a>

<?php if ($review_status) { ?><a tab="#tab_review"><?php echo $tab_review; ?></a><?php } ?>

<!--<a tab="#tab_related"><?php echo $tab_related; ?> (<?php echo count($products); ?>)</a>-->

</div>

<div id="tab_description" class="tab_page"><?php echo $description; ?></div>

<?php if ($review_status) { ?>

<div id="tab_vkcomment" class="tab_page">

<script type="text/javascript" src="http://userapi.com/js/api/openapi.js?29"></script>

<script type="text/javascript">

VK.init({apiId: <?=$this->config->get('wp_vkcomment_apiid');?>, onlyWidgets: true});

</script>

<div id="tab_review" class="tab_page">

<div id="review"></div>

<div class="heading" id="review_title"><?php echo $text_write; ?></div>

<div class="content"><b><?php echo $entry_name; ?></b><br />

<input type="text" name="name" value="" />

<br />

<br />

<b><?php echo $entry_review; ?></b>

<textarea name="text" style="width: 98%;" rows="8"></textarea>

<span style="font-size: 11px;"><?php echo $text_note; ?></span><br />

<br />

<b><?php echo $entry_rating; ?></b> <span><?php echo $entry_bad; ?></span> 

<input type="radio" name="rating" value="1" style="margin: 0;" />

 

<input type="radio" name="rating" value="2" style="margin: 0;" />

 

<input type="radio" name="rating" value="3" style="margin: 0;" />

 

<input type="radio" name="rating" value="4" style="margin: 0;" />

 

<input type="radio" name="rating" value="5" style="margin: 0;" />

  <span><?php echo $entry_good; ?></span><br />

<br />

<b><?php echo $entry_captcha; ?></b><br />

<input type="text" name="captcha" value="" autocomplete="off" />

<br />

<img src="index.php?route=product/product/captcha" id="captcha" /></div>

<div class="buttons">

<table>

<tr>

<td align="right"><a onclick="review();" class="button"><span><?php echo $button_continue; ?></span></a></td>

</tr>

</table>

</div>

</div>

<?php } ?>

<div id="tab_vkcomment" class="tab_page">

<script type="text/javascript" src="http://userapi.com/js/api/openapi.js?29"></script>

<script type="text/javascript">

VK.init({apiId: <?=$this->config->get('wp_vkcomment_apiid');?>, onlyWidgets: true});

</script>

<div id="vk_comments"></div>

<script type="text/javascript">

VK.Widgets.Comments("vk_comments", {limit: <? if ($this->config->get('wp_vkcomment_kolvo')>=5) echo $this->config->get('wp_vkcomment_kolvo'); else echo "5"; ?>, width: "<? if ($this->config->get('wp_vkcomment_shir')>=300) echo $this->config->get('wp_vkcomment_shir'); else echo "300"; ?>", autoPublish:<?=$this->config->get('wp_vkcomment_autpub');?>, attach: <?php

if ($this->config->get('wp_vkcomment_graff')==1 && $this->config->get('wp_vkcomment_photo')==1 && $this->config->get('wp_vkcomment_video')==1 && $this->config->get('wp_vkcomment_audio')==1 && $this->config->get('wp_vkcomment_silki')==1) echo "\"*\"";

else

{

$wpvkcommtmp=0;

if ($this->config->get('wp_vkcomment_graff')==1) { echo "\"graffiti"; $wpvkcommtmp=1;}

if ($this->config->get('wp_vkcomment_photo')==1) { if ($wpvkcommtmp==1) echo ",photo"; else { echo "\"photo"; $wpvkcommtmp=1;} }

if ($this->config->get('wp_vkcomment_video')==1) { if ($wpvkcommtmp==1) echo ",video"; else { echo "\"video"; $wpvkcommtmp=1;} }

if ($this->config->get('wp_vkcomment_audio')==1) { if ($wpvkcommtmp==1) echo ",audio"; else { echo "\"audio"; $wpvkcommtmp=1;} }

if ($this->config->get('wp_vkcomment_silki')==1) { if ($wpvkcommtmp==1) echo ",link"; else { echo "\"link"; $wpvkcommtmp=1;} }

if ($wpvkcommtmp==1) echo "\""; else echo "false";

}

?>},<?=$product_id;?>);

</script></div>

<div id="tab_image" class="tab_page">

<?php if ($images) { ?>

<div style="display: inline-block;">

<?php foreach ($images as $image) { ?>

<div style="display: inline-block; float: left; text-align: center; margin-left: 5px; margin-right: 5px; margin-bottom: 10px;"><a href="<?php echo $image['popup']; ?>" title="<?php echo $heading_title; ?>" rel="slideshow" rel="gallery"><img src="<?php echo $image['thumb']; ?>" title="<?php echo $heading_title; ?>" alt="<?php echo $heading_title; ?>" style="border: 1px solid #C1C4AC; margin-bottom: 3px;" /></a><br />

<span style="font-size: 11px;"><?php echo $text_enlarge; ?></span></div>

<?php } ?>

</div>

<?php } else { ?>

<div style="background: #DBDACC; border: 1px solid #C1C4AC; padding: 10px; margin-bottom: 10px;"><?php echo $text_no_images; ?></div>

<?php } ?>

</div>

<!--<div id="tab_related" class="tab_page">

<?php if ($products) { ?>

<table class="list">

<?php for ($i = 0; $i < sizeof($products); $i = $i + 4) { ?>

<tr>

<?php for ($j = $i; $j < ($i + 4); $j++) { ?>

<td width="25%"><?php if (isset($products[$j])) { ?>

<a href="<?php echo str_replace('&', '&', $products[$j]['href']); ?>"><img src="<?php echo $products[$j]['thumb']; ?>" title="<?php echo $products[$j]['name']; ?>" alt="<?php echo $products[$j]['name']; ?>" /></a><br />

<a href="<?php echo str_replace('&', '&', $products[$j]['href']); ?>"><?php echo $products[$j]['name']; ?></a><br />

<span style="color: #999; font-size: 11px;"><?php echo $products[$j]['model']; ?></span><br />

<?php if ($display_price) { ?>

<?php if (!$products[$j]['special']) { ?>

<span style="color: #900; font-weight: bold;"><?php echo $products[$j]['price']; ?></span>

<?php } else { ?>

<span style="color: #900; font-weight: bold; text-decoration: line-through;"><?php echo $products[$j]['price']; ?></span> <span style="color: #F00;"><?php echo $products[$j]['special']; ?></span>

<?php } ?>

<a class="button_add_small" href="<?php echo $products[$j]['add']; ?>" title="<?php echo $button_add_to_cart; ?>" > </a>

<?php } ?>

<br />

<?php if ($products[$j]['rating']) { ?>

<img src="catalog/view/theme/default/image/stars_<?php echo $products[$j]['rating'] . '.png'; ?>" alt="<?php echo $products[$j]['stars']; ?>" />

<?php } ?>

<?php } ?></td>

<?php } ?>

</tr> */

<?php } ?>

</table>

<?php } else { ?>

<div style="background: #DBDACC; border: 1px solid #C1C4AC; padding: 10px; margin-bottom: 10px;"><?php echo $text_no_related; ?></div>

<?php } ?>

</div>

</div>-->

<div class="bottom">

<div class="left"></div>

<div class="right"></div>

<div class="center"></div>

</div>

<?php if ($tags) { ?>

<div class="tags"><?php echo $text_tags; ?>

<?php foreach ($tags as $tag) { ?>

<a href="<?php echo $tag['href']; ?>"><?php echo $tag['tag']; ?></a>,

<?php } ?>

</div>

<?php } ?>

</div>

<script type="text/javascript"><!--

$('#review .pagination a').live('click', function() {

$('#review').slideUp('slow');

$('#review').load(this.href);

$('#review').slideDown('slow');

return false;

});

$('#review').load('index.php?route=product/product/review&product_id=<?php echo $product_id; ?>');

function review() {

$.ajax({

type: 'POST',

url: 'index.php?route=product/product/write&product_id=<?php echo $product_id; ?>',

dataType: 'json',

data: 'name=' + encodeURIComponent($('input[name=\'name\']').val()) + '&text=' + encodeURIComponent($('textarea[name=\'text\']').val()) + '&rating=' + encodeURIComponent($('input[name=\'rating\']:checked').val() ? $('input[name=\'rating\']:checked').val() : '') + '&captcha=' + encodeURIComponent($('input[name=\'captcha\']').val()),

beforeSend: function() {

$('.success, .warning').remove();

$('#review_button').attr('disabled', 'disabled');

$('#review_title').after('<div class="wait"><img src="catalog/view/theme/default/image/loading_1.gif" alt="" /> <?php echo $text_wait; ?></div>');

},

complete: function() {

$('#review_button').attr('disabled', '');

$('.wait').remove();

},

success: function(data) {

if (data.error) {

$('#review_title').after('<div class="warning">' + data.error + '</div>');

}

if (data.success) {

$('#review_title').after('<div class="success">' + data.success + '</div>');

$('input[name=\'name\']').val('');

$('textarea[name=\'text\']').val('');

$('input[name=\'rating\']:checked').attr('checked', '');

$('input[name=\'captcha\']').val('');

}

}

});

}

//--></script>

<script type="text/javascript"><!--

$.tabs('.tabs a');

//--></script>

<?php echo $footer; ?>

Жду помощи.

Надіслати
Поділитися на інших сайтах


samsonio, Вы забыли указать версию Вашей сборки, так как в них, файлы header.tpl - незначительно отличаются...

Что бы не быть многословным, мой - Вам совет:

1. Зайдите на эту страницу www.realcode.ru

2. Откройте файл header.tpl, который идёт в архиве (ВАШЕЙ СБОРКИ) OC (по умолчанию). Выделите весь текст и вставьте в левое окно.

3. Содержимое Вашего (который Вы правили) header.tpl скопируйте в правое.

4. Увидите разницу, и найдёте где ошибка.

Изображение

Скрин - так, для примера.

Надіслати
Поділитися на інших сайтах

samsonio, Вы забыли указать версию Вашей сборки, так как в них, файлы header.tpl - незначительно отличаются...

Что бы не быть многословным, мой - Вам совет:

1. Зайдите на эту страницу www.realcode.ru

2. Откройте файл header.tpl, который идёт в архиве (ВАШЕЙ СБОРКИ) OC (по умолчанию). Выделите весь текст и вставьте в левое окно.

3. Содержимое Вашего (который Вы правили) header.tpl скопируйте в правое.

4. Увидите разницу, и найдёте где ошибка.

Изображение

Скрин - так, для примера.

Спасибо за попытку и классный сайт. Но исходный фаил и тот который я слепил отличается только тем (что нужно) что перед /head у него находится

56 <script>

57 $(document).ready(function(){

58 $("a[rel=slideshow]").colorbox({

59 title: false, //Показывать наименование Товара

60 slideshow:true, //Включаем СлайдШоу. Включен по умолчанию (если надо выключить - ставим true)

61 slideshowSpeed: 2500, //Скорость смены картинки

62 speed:1000, // Скорость эффекта "масштабирование"

63 preloading: true, //Значек загрузки

64 current: "Изображение {current} из {total}", //Выводим номер текущей и общее число картинок на русском

65 previous: "Назад", //Подсказки к кнопкам (для некоторых тем)

66 next: "Вперёд", //Подсказки к кнопкам (для некоторых тем)

67 close: "Закрыть", //Подсказки к кнопкам (для некоторых тем)

68 slideshowStart: "Продолжить", //Русифицируем кнопку Start для СлайдШоу

69 slideshowStop: "Пауза", //Русифицируем кнопку Stop для СлайдШоу

70 opacity: 0.7, //Сила затемнения, (допустимые значения от 0.1 до 1) 0.1 - самое слабое, 1 - самое сильное

71 });

72 //Example of preserving a JavaScript event for inline calls.

73 $("#click").click(function(){

74 $('#click').css({"background-color":"#f00", "color":"#fff", "cursor":"inherit"}).text("Open this window again and this message will still be here.");

75 return false;

76 });

77 });

78 </script>

79 <link rel="stylesheet" type="text/css" href="catalog/view/theme/default/stylesheet/footerslider.css" />

80 <script type="text/javascript" src="catalog/view/javascript/jquery/jcarousel-lite.js"></script>

81 <script type="text/javascript" src="catalog/view/javascript/jquery/footerslider.js"></script>

и немного выше две вот эти строчки

25 <script type="text/javascript" src="catalog/view/javascript/jquery/ColorBox/jquery.colorbox.js"> </script>

26 <link media="screen" rel="stylesheet" href="catalog/view/javascript/jquery/ColorBox/colorbox.css" />

Сборка Version 0.2.0

Только у меня тема установлена, которая естественно изменила этот фаил. Следовательно, по сравнению с исходным фаилом в теме- вышеописанные расхождения, а если сравнивать все таки с исходным в сборке то достаточно много различий.

Надіслати
Поділитися на інших сайтах


  • 2 months later...

Ставил на стоковый ocstore_v0.2.2 - при просмотре фото товара открывается фотка на этой же странице (просто изображение на белом фоне и все). Чтоб вернуться обратно, нужно нажимать "назад" в самом браузере. Не фурычит короче((

Почему бы не выложить уже готовые header и product?

fancybox , кстати, работает отлично.

Надіслати
Поділитися на інших сайтах


  • 2 weeks later...

Заработало только когда переименовал папку colorbox в ColorBox.

Да, в IE не работает вообще.

это /САМАЯ лучшая подсказка по поводу установки!!! а я мучался!!!

спасибо вам!!! +100

Надіслати
Поділитися на інших сайтах


Установил ColorBox, не знал проблем и был всем доволен до ныне. Сейчас столкнулся с такой проблемой. ColorBox не работает на статистических страницах (то бишь страницы дефолтные "О нас" и т.д.). Как эту проблему решить? Спасибо. С Уважением.

Надіслати
Поділитися на інших сайтах


1319140165[/url]' post='32227']

Ответьте пожалуйста!

Внимание: Отображение "Privacy Policy" и "Terms & Conditions" будеи происходить в ThickBox`е.

Тоже самое и "О нас".
Надіслати
Поділитися на інших сайтах

  • 3 weeks later...

скажите а для версии ocstore_v1.0.1 как сделать для каждого изображения, свой размер!?

вот файл /catalog/controller/product/product.php

<?php  
class ControllerProductProduct extends Controller {
	private $error = array(); 
	
	public function index() { 
		$this->language->load('product/product');
	
		$this->data['breadcrumbs'] = array();

		$this->data['breadcrumbs'][] = array(
			'text'      => $this->language->get('text_home'),
			'href'      => $this->url->link('common/home'),			
			'separator' => false
		);
		
		$this->load->model('catalog/category');	
		
		if (isset($this->request->get['path'])) {
			$path = '';
				
			foreach (explode('_', $this->request->get['path']) as $path_id) {
				if (!$path) {
					$path = $path_id;
				} else {
					$path .= '_' . $path_id;
				}
				
				$category_info = $this->model_catalog_category->getCategory($path_id);
				
				if ($category_info) {
					$this->data['breadcrumbs'][] = array(
						'text'      => $category_info['name'],
						'href'      => $this->url->link('product/category', 'path=' . $path),
						'separator' => $this->language->get('text_separator')
					);
				}
			}
		}
		
		$this->load->model('catalog/manufacturer');	
		
		if (isset($this->request->get['manufacturer_id'])) {
			$this->data['breadcrumbs'][] = array( 
				'text'      => $this->language->get('text_brand'),
				'href'      => $this->url->link('product/manufacturer'),
				'separator' => $this->language->get('text_separator')
			);	
				
			$manufacturer_info = $this->model_catalog_manufacturer->getManufacturer($this->request->get['manufacturer_id']);

			if ($manufacturer_info) {	
				$this->data['breadcrumbs'][] = array(
					'text'	    => $manufacturer_info['name'],
					'href'	    => $this->url->link('product/manufacturer/product', 'manufacturer_id=' . $this->request->get['manufacturer_id']),					
					'separator' => $this->language->get('text_separator')
				);
			}
		}
		
		if (isset($this->request->get['filter_name']) || isset($this->request->get['filter_tag'])) {
			$url = '';
			
			if (isset($this->request->get['filter_name'])) {
				$url .= '&filter_name=' . $this->request->get['filter_name'];
			}
						
			if (isset($this->request->get['filter_tag'])) {
				$url .= '&filter_tag=' . $this->request->get['filter_tag'];
			}
						
			if (isset($this->request->get['filter_description'])) {
				$url .= '&filter_description=' . $this->request->get['filter_description'];
			}
			
			if (isset($this->request->get['filter_category_id'])) {
				$url .= '&filter_category_id=' . $this->request->get['filter_category_id'];
			}	
						
			$this->data['breadcrumbs'][] = array(
				'text'      => $this->language->get('text_search'),
				'href'      => $this->url->link('product/search', $url),
				'separator' => $this->language->get('text_separator')
			);	
		}
		
		if (isset($this->request->get['product_id'])) {
			$product_id = $this->request->get['product_id'];
		} else {
			$product_id = 0;
		}
		
		$this->load->model('catalog/product');
		
		$product_info = $this->model_catalog_product->getProduct($product_id);
		
		$this->data['product_info'] = $product_info;
		
		if ($product_info) {
			$url = '';
			
			if (isset($this->request->get['path'])) {
				$url .= '&path=' . $this->request->get['path'];
			}
			
			if (isset($this->request->get['manufacturer_id'])) {
				$url .= '&manufacturer_id=' . $this->request->get['manufacturer_id'];
			}			

			if (isset($this->request->get['filter_name'])) {
				$url .= '&filter_name=' . $this->request->get['filter_name'];
			}
						
			if (isset($this->request->get['filter_tag'])) {
				$url .= '&filter_tag=' . $this->request->get['filter_tag'];
			}
			
			if (isset($this->request->get['filter_description'])) {
				$url .= '&filter_description=' . $this->request->get['filter_description'];
			}	
						
			if (isset($this->request->get['filter_category_id'])) {
				$url .= '&filter_category_id=' . $this->request->get['filter_category_id'];
			}
												
			$this->data['breadcrumbs'][] = array(
				'text'      => $product_info['name'],
				'href'      => $this->url->link('product/product', $url . '&product_id=' . $this->request->get['product_id']),
				'separator' => $this->language->get('text_separator')
			);			
			
			$this->document->setTitle($product_info['name']);
			$this->document->setDescription($product_info['meta_description']);
			$this->document->setKeywords($product_info['meta_keyword']);
			$this->document->addLink($this->url->link('product/product', 'product_id=' . $this->request->get['product_id']), 'canonical');
			
			$this->data['heading_title'] = $product_info['name'];
			
			$this->data['text_select'] = $this->language->get('text_select');
			$this->data['text_manufacturer'] = $this->language->get('text_manufacturer');
			$this->data['text_model'] = $this->language->get('text_model');
			$this->data['text_reward'] = $this->language->get('text_reward');
			$this->data['text_points'] = $this->language->get('text_points');	
			$this->data['text_discount'] = $this->language->get('text_discount');
			$this->data['text_stock'] = $this->language->get('text_stock');
			$this->data['text_price'] = $this->language->get('text_price');
			$this->data['text_tax'] = $this->language->get('text_tax');
			$this->data['text_discount'] = $this->language->get('text_discount');
			$this->data['text_option'] = $this->language->get('text_option');
			$this->data['text_qty'] = $this->language->get('text_qty');
			$this->data['text_minimum'] = sprintf($this->language->get('text_minimum'), $product_info['minimum']);
			$this->data['text_or'] = $this->language->get('text_or');
			$this->data['text_write'] = $this->language->get('text_write');
			$this->data['text_note'] = $this->language->get('text_note');
			$this->data['text_share'] = $this->language->get('text_share');
			$this->data['text_wait'] = $this->language->get('text_wait');
			$this->data['text_tags'] = $this->language->get('text_tags');
			
			$this->data['entry_name'] = $this->language->get('entry_name');
			$this->data['entry_review'] = $this->language->get('entry_review');
			$this->data['entry_rating'] = $this->language->get('entry_rating');
			$this->data['entry_good'] = $this->language->get('entry_good');
			$this->data['entry_bad'] = $this->language->get('entry_bad');
			$this->data['entry_captcha'] = $this->language->get('entry_captcha');
			
			$this->data['button_cart'] = $this->language->get('button_cart');
			$this->data['button_wishlist'] = $this->language->get('button_wishlist');
			$this->data['button_compare'] = $this->language->get('button_compare');			
			$this->data['button_upload'] = $this->language->get('button_upload');
			$this->data['button_continue'] = $this->language->get('button_continue');
			
			$this->load->model('catalog/review');

			$this->data['tab_description'] = $this->language->get('tab_description');
			$this->data['tab_attribute'] = $this->language->get('tab_attribute');
			$this->data['tab_review'] = sprintf($this->language->get('tab_review'), $this->model_catalog_review->getTotalReviewsByProductId($this->request->get['product_id']));
			$this->data['tab_related'] = $this->language->get('tab_related');
			
			$this->data['product_id'] = $this->request->get['product_id'];
			$this->data['manufacturer'] = $product_info['manufacturer'];
			$this->data['manufacturers'] = $this->url->link('product/manufacturer/product', 'manufacturer_id=' . $product_info['manufacturer_id']);
			$this->data['model'] = $product_info['model'];
			$this->data['reward'] = $product_info['reward'];
			$this->data['points'] = $product_info['points'];
			
			if ($product_info['quantity'] <= 0) {
				$this->data['stock'] = $product_info['stock_status'];
			} elseif ($this->config->get('config_stock_display')) {
				$this->data['stock'] = $product_info['quantity'];
			} else {
				$this->data['stock'] = $this->language->get('text_instock');
			}
			
			$this->load->model('tool/image');

			if ($product_info['image']) {
				$this->data['popup'] = $this->model_tool_image->resize($product_info['image'], $this->config->get('config_image_popup_width'), $this->config->get('config_image_popup_height'));
			} else {
				$this->data['popup'] = '';
			}
			
			if ($product_info['image']) {
				$this->data['thumb'] = $this->model_tool_image->resize($product_info['image'], $this->config->get('config_image_thumb_width'), $this->config->get('config_image_thumb_height'));
			} else {
				$this->data['thumb'] = '';
			}
			
			$this->data['images'] = array();
			
			$results = $this->model_catalog_product->getProductImages($this->request->get['product_id']);
			
			foreach ($results as $result) {
				$this->data['images'][] = array(
					'popup' => $this->model_tool_image->resize($result['image'] , $this->config->get('config_image_popup_width'), $this->config->get('config_image_popup_height')),
					'thumb' => $this->model_tool_image->resize($result['image'], $this->config->get('config_image_additional_width'), $this->config->get('config_image_additional_height'))
				);
			}	
						
			if (($this->config->get('config_customer_price') && $this->customer->isLogged()) || !$this->config->get('config_customer_price')) {
				$this->data['price'] = $this->currency->format($this->tax->calculate($product_info['price'], $product_info['tax_class_id'], $this->config->get('config_tax')));
			} else {
				$this->data['price'] = false;
			}
						
			if ((float)$product_info['special']) {
				$this->data['special'] = $this->currency->format($this->tax->calculate($product_info['special'], $product_info['tax_class_id'], $this->config->get('config_tax')));
			} else {
				$this->data['special'] = false;
			}
			
			if ($this->config->get('config_tax')) {
				$this->data['tax'] = $this->currency->format((float)$product_info['special'] ? $product_info['special'] : $product_info['price']);
			} else {
				$this->data['tax'] = false;
			}
			
			$discounts = $this->model_catalog_product->getProductDiscounts($this->request->get['product_id']);
			
			$this->data['discounts'] = array(); 
			
			foreach ($discounts as $discount) {
				$this->data['discounts'][] = array(
					'quantity' => $discount['quantity'],
					'price'    => $this->currency->format($this->tax->calculate($discount['price'], $product_info['tax_class_id'], $this->config->get('config_tax')))
				);
			}
			
			$this->data['options'] = array();
			
			foreach ($this->model_catalog_product->getProductOptions($this->request->get['product_id']) as $option) { 
				if ($option['type'] == 'select' || $option['type'] == 'radio' || $option['type'] == 'checkbox') { 
					$option_value_data = array();
					
					foreach ($option['option_value'] as $option_value) {
						if (!$option_value['subtract'] || ($option_value['quantity'] > 0)) {
							$option_value_data[] = array(
								'product_option_value_id' => $option_value['product_option_value_id'],
								'option_value_id'         => $option_value['option_value_id'],
								'name'                    => $option_value['name'],
								'price'                   => (float)$option_value['price'] ? $this->currency->format($this->tax->calculate($option_value['price'], $product_info['tax_class_id'], $this->config->get('config_tax'))) : false,
								'price_prefix'            => $option_value['price_prefix']
							);
						}
					}
					
					$this->data['options'][] = array(
						'product_option_id' => $option['product_option_id'],
						'option_id'         => $option['option_id'],
						'name'              => $option['name'],
						'type'              => $option['type'],
						'option_value'      => $option_value_data,
						'required'          => $option['required']
					);					
				} elseif ($option['type'] == 'text' || $option['type'] == 'textarea' || $option['type'] == 'file' || $option['type'] == 'date' || $option['type'] == 'datetime' || $option['type'] == 'time') {
					$this->data['options'][] = array(
						'product_option_id' => $option['product_option_id'],
						'option_id'         => $option['option_id'],
						'name'              => $option['name'],
						'type'              => $option['type'],
						'option_value'      => $option['option_value'],
						'required'          => $option['required']
					);						
				}
			}
							
			if ($product_info['minimum']) {
				$this->data['minimum'] = $product_info['minimum'];
			} else {
				$this->data['minimum'] = 1;
			}
			
			$this->data['review_status'] = $this->config->get('config_review_status');
			$this->data['reviews'] = sprintf($this->language->get('text_reviews'), (int)$product_info['reviews']);
			$this->data['rating'] = (int)$product_info['rating'];
			$this->data['description'] = html_entity_decode($product_info['description'], ENT_QUOTES, 'UTF-8');
			$this->data['attribute_groups'] = $this->model_catalog_product->getProductAttributes($this->request->get['product_id']);
			
			$this->data['products'] = array();
			
			$results = $this->model_catalog_product->getProductRelated($this->request->get['product_id']);
			
			foreach ($results as $result) {
				if ($result['image']) {
					$image = $this->model_tool_image->resize($result['image'], $this->config->get('config_image_related_width'), $this->config->get('config_image_related_height'));
				} else {
					$image = false;
				}
				
				if (($this->config->get('config_customer_price') && $this->customer->isLogged()) || !$this->config->get('config_customer_price')) {
					$price = $this->currency->format($this->tax->calculate($result['price'], $result['tax_class_id'], $this->config->get('config_tax')));
				} else {
					$price = false;
				}
						
				if ((float)$result['special']) {
					$special = $this->currency->format($this->tax->calculate($result['special'], $result['tax_class_id'], $this->config->get('config_tax')));
				} else {
					$special = false;
				}
				
				if ($this->config->get('config_review_status')) {
					$rating = (int)$result['rating'];
				} else {
					$rating = false;
				}
							
				$this->data['products'][] = array(
					'product_id' => $result['product_id'],
					'thumb'   	 => $image,
					'name'    	 => $result['name'],
					'price'   	 => $price,
					'special' 	 => $special,
					'rating'     => $rating,
					'reviews'    => sprintf($this->language->get('text_reviews'), (int)$result['reviews']),
					'href'    	 => $this->url->link('product/product', 'product_id=' . $result['product_id']),
				);
			}	
			
			$this->data['tags'] = array();
					
			$results = $this->model_catalog_product->getProductTags($this->request->get['product_id']);
			
			foreach ($results as $result) {
				$this->data['tags'][] = array(
					'tag'  => $result['tag'],
					'href' => $this->url->link('product/search', 'filter_tag=' . $result['tag'])
				);
			}
			
			$this->model_catalog_product->updateViewed($this->request->get['product_id']);
			
			if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/product/product.tpl')) {
				$this->template = $this->config->get('config_template') . '/template/product/product.tpl';
			} else {
				$this->template = 'default/template/product/product.tpl';
			}
			
			$this->children = array(
				'common/column_left',
				'common/column_right',
				'common/content_top',
				'common/content_bottom',
				'common/footer',
				'common/header'
			);
						
			$this->response->setOutput($this->render());
		} else {
			$url = '';
			
			if (isset($this->request->get['path'])) {
				$url .= '&path=' . $this->request->get['path'];
			}
			
			if (isset($this->request->get['manufacturer_id'])) {
				$url .= '&manufacturer_id=' . $this->request->get['manufacturer_id'];
			}			

			if (isset($this->request->get['filter_name'])) {
				$url .= '&filter_name=' . $this->request->get['filter_name'];
			}	
					
			if (isset($this->request->get['filter_tag'])) {
				$url .= '&filter_tag=' . $this->request->get['filter_tag'];
			}
							
			if (isset($this->request->get['filter_description'])) {
				$url .= '&filter_description=' . $this->request->get['filter_description'];
			}
					
			if (isset($this->request->get['filter_category_id'])) {
				$url .= '&filter_category_id=' . $this->request->get['filter_category_id'];
			}
								
      		$this->data['breadcrumbs'][] = array(
        		'text'      => $this->language->get('text_error'),
				'href'      => $this->url->link('product/product', $url . '&product_id=' . $product_id),
        		'separator' => $this->language->get('text_separator')
      		);			
		
      		$this->document->setTitle($this->language->get('text_error'));

      		$this->data['heading_title'] = $this->language->get('text_error');

      		$this->data['text_error'] = $this->language->get('text_error');

      		$this->data['button_continue'] = $this->language->get('button_continue');

      		$this->data['continue'] = $this->url->link('common/home');

			if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/error/not_found.tpl')) {
				$this->template = $this->config->get('config_template') . '/template/error/not_found.tpl';
			} else {
				$this->template = 'default/template/error/not_found.tpl';
			}
			
			$this->children = array(
				'common/column_left',
				'common/column_right',
				'common/content_top',
				'common/content_bottom',
				'common/footer',
				'common/header'
			);
						
			$this->response->setOutput($this->render());
    	}
  	}
	
	public function review() {
    	$this->language->load('product/product');
		
		$this->load->model('catalog/review');

		$this->data['text_no_reviews'] = $this->language->get('text_no_reviews');

		if (isset($this->request->get['page'])) {
			$page = $this->request->get['page'];
		} else {
			$page = 1;
		}  
		
		$this->data['reviews'] = array();
		
		$review_total = $this->model_catalog_review->getTotalReviewsByProductId($this->request->get['product_id']);
			
		$results = $this->model_catalog_review->getReviewsByProductId($this->request->get['product_id'], ($page - 1) * 5, 5);
      		
		foreach ($results as $result) {
        	$this->data['reviews'][] = array(
        		'author'     => $result['author'],
				'text'       => strip_tags($result['text']),
				'rating'     => (int)$result['rating'],
        		'reviews'    => sprintf($this->language->get('text_reviews'), (int)$review_total),
        		'date_added' => date($this->language->get('date_format_short'), strtotime($result['date_added']))
        	);
      	}			
			
		$pagination = new Pagination();
		$pagination->total = $review_total;
		$pagination->page = $page;
		$pagination->limit = 5; 
		$pagination->text = $this->language->get('text_pagination');
		$pagination->url = $this->url->link('product/product/review', 'product_id=' . $this->request->get['product_id'] . '&page={page}');
			
		$this->data['pagination'] = $pagination->render();
		
		if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/product/review.tpl')) {
			$this->template = $this->config->get('config_template') . '/template/product/review.tpl';
		} else {
			$this->template = 'default/template/product/review.tpl';
		}
		
		$this->response->setOutput($this->render());
	}
	
	public function write() {
		$this->language->load('product/product');
		
		$this->load->model('catalog/review');
		
		$json = array();
		
		if ((strlen(utf8_decode($this->request->post['name'])) < 3) || (strlen(utf8_decode($this->request->post['name'])) > 25)) {
			$json['error'] = $this->language->get('error_name');
		}
		
		if ((strlen(utf8_decode($this->request->post['text'])) < 25) || (strlen(utf8_decode($this->request->post['text'])) > 1000)) {
			$json['error'] = $this->language->get('error_text');
		}

		if (!$this->request->post['rating']) {
			$json['error'] = $this->language->get('error_rating');
		}

		if (!isset($this->session->data['captcha']) || ($this->session->data['captcha'] != $this->request->post['captcha'])) {
			$json['error'] = $this->language->get('error_captcha');
		}
				
		if (($this->request->server['REQUEST_METHOD'] == 'POST') && !isset($json['error'])) {
			$this->model_catalog_review->addReview($this->request->get['product_id'], $this->request->post);
			
			$json['success'] = $this->language->get('text_success');
		}
		
		$this->load->library('json');
		
		$this->response->setOutput(Json::encode($json));
	}
	
	public function captcha() {
		$this->load->library('captcha');
		
		$captcha = new Captcha();
		
		$this->session->data['captcha'] = $captcha->getCode();
		
		$captcha->showImage();
	}
	
	public function upload() {
		$this->language->load('product/product');
		
		$json = array();
		
		if (isset($this->request->files['file']['name']) && $this->request->files['file']['name']) {
			if ((strlen(utf8_decode($this->request->files['file']['name'])) < 3) || (strlen(utf8_decode($this->request->files['file']['name'])) > 128)) {
        		$json['error'] = $this->language->get('error_filename');
	  		}	  	
			
			$allowed = array();
			
			$filetypes = explode(',', $this->config->get('config_upload_allowed'));
			
			foreach ($filetypes as $filetype) {
				$allowed[] = trim($filetype);
			}
			
			if (!in_array(substr(strrchr($this->request->files['file']['name'], '.'), 1), $allowed)) {
				$json['error'] = $this->language->get('error_filetype');
       		}	
						
			if ($this->request->files['file']['error'] != UPLOAD_ERR_OK) {
				$json['error'] = $this->language->get('error_upload_' . $this->request->files['file']['error']);
			}
		} else {
			$json['error'] = $this->language->get('error_upload');
		}
		
		if (($this->request->server['REQUEST_METHOD'] == 'POST') && !isset($json['error'])) {
			if (is_uploaded_file($this->request->files['file']['tmp_name']) && file_exists($this->request->files['file']['tmp_name'])) {
				$file = basename($this->request->files['file']['name']) . '.' . md5(rand());
				
				// Hide the uploaded file name sop people can not link to it directly.
				$this->load->library('encryption');
				
				$encryption = new Encryption($this->config->get('config_encryption'));
				
				$json['file'] = $encryption->encrypt($file);
				
				move_uploaded_file($this->request->files['file']['tmp_name'], DIR_DOWNLOAD . $file);
			}
						
			$json['success'] = $this->language->get('text_upload');
		}	
		
		$this->load->library('json');
		
		$this->response->setOutput(Json::encode($json));		
	}
}
?>
Надіслати
Поділитися на інших сайтах


  • 5 weeks later...

Доброго времени суток!

Установил себе colorbox, в результате изображения товара стали открываться на весь экран браузера как и было нужно.

Подскажите как реализовать чтоб изображения открывались на новой вкладке.

Получается посетитель после просмотра изображения закрывает картинку, вместе с тем и сайт((

Сайт: http://respect-shop.com.ua

Движок: opencart 0.1.7

Спасибо!

Надіслати
Поділитися на інших сайтах


Пытался поставить эту http://www.mind-projects.it/projects/jqzoom/demos.php вместо стандартной никак не выходит((

Может кто пробовал реализовывать? Очень хочется чтобы получилось. Смотрится хорошо и выгодно.

Надіслати
Поділитися на інших сайтах


Пытался поставить эту http://www.mind-proj...qzoom/demos.php вместо стандартной никак не выходит((

Может кто пробовал реализовывать? Очень хочется чтобы получилось. Смотрится хорошо и выгодно.

Смотрится ужасно :D (ИМХО) Собираем голоса: "Собрать такую штуку для Опена, или не надо?" ))))
Надіслати
Поділитися на інших сайтах

Смотрится ужасно :D (ИМХО) Собираем голоса: "Собрать такую штуку для Опена, или не надо?" ))))

Конечно надо!)) буду оч признателен) А то прям ну никак)) не получается. И хочется реализовать.

да zoom как-то не очень, а вот thumbnails, которые замещаю главную при клике пару раз делал на заказ.

Ну не знаю. Для большинства инет магазов одежды просто незаменимая вещь)

Надіслати
Поділитися на інших сайтах


  • 1 month later...

Смотрится ужасно Изображение (ИМХО) Собираем голоса: "Собрать такую штуку для Опена, или не надо?" ))))

очень ищу рабочий zoom модуль, никак не могу найти :(

может кто либо поделится ссылочкой? буду очень признателен

Надіслати
Поділитися на інших сайтах


Створіть аккаунт або увійдіть для коментування

Ви повинні бути користувачем, щоб залишити коментар

Створити обліковий запис

Зареєструйтеся для отримання облікового запису. Це просто!

Зареєструвати аккаунт

Вхід

Уже зареєстровані? Увійдіть тут.

Вхід зараз

×
×
  • Створити...

Important Information

На нашому сайті використовуються файли cookie і відбувається обробка деяких персональних даних користувачів, щоб поліпшити користувальницький інтерфейс. Щоб дізнатися для чого і які персональні дані ми обробляємо перейдіть за посиланням . Якщо Ви натиснете «Я даю згоду», це означає, що Ви розумієте і приймаєте всі умови, зазначені в цьому Повідомленні про конфіденційність.