Redirection direct au panier après achat.
9 messages
• Page 1 sur 1
Redirection direct au panier après achat.
Bonjour,
Voici mon problème, je souhaite rediriger le client directement au panier après avoir appuyer sur le bouton d'achat sur la page du produit (index.php?route=product/product)
J'utilise OP v1.5.1.3 avec un template custom, je peux garantir que les lignes de codes pour l'option du button sont les même ainsi que pour le code Ajax.
Par contre ma problématique étant que j'ai la moitié du problèm de réglé. Quand je clique sur le bouton oui ca me redirige bien au panier mais la quantité du produit est de 2 et non de 1 comme il se devrait.
Mais dès que je change la valeur minimum dans le form pour qu'elle soit toujours de 1 le script arrête de fonctionner tout simplement...
Voilà le script que j'utilise pour tenter de faire ce que je veux: http://forum.opencart.com/viewtopic.php?t=33154#p182116
Par contre peut-être serait-il possible de faire un lien direct du genre index.php?route=checkout/cart&addtocart=XX&quantity=1 ??? serait-ce possible si oui comment l'implémenter?
merci de votre temps c'est extrêmement urgent.
Voici mon problème, je souhaite rediriger le client directement au panier après avoir appuyer sur le bouton d'achat sur la page du produit (index.php?route=product/product)
J'utilise OP v1.5.1.3 avec un template custom, je peux garantir que les lignes de codes pour l'option du button sont les même ainsi que pour le code Ajax.
Par contre ma problématique étant que j'ai la moitié du problèm de réglé. Quand je clique sur le bouton oui ca me redirige bien au panier mais la quantité du produit est de 2 et non de 1 comme il se devrait.
Mais dès que je change la valeur minimum dans le form pour qu'elle soit toujours de 1 le script arrête de fonctionner tout simplement...
Voilà le script que j'utilise pour tenter de faire ce que je veux: http://forum.opencart.com/viewtopic.php?t=33154#p182116
Par contre peut-être serait-il possible de faire un lien direct du genre index.php?route=checkout/cart&addtocart=XX&quantity=1 ??? serait-ce possible si oui comment l'implémenter?
merci de votre temps c'est extrêmement urgent.
Dernière édition par 3lb34st le 24 Nov 2011, 01:56, édité 2 fois au total.
OpenCart v1.5.1.3 US + traduction francaise
Thèmes: ZetaShop = http://themeforest.net/item/zeta-shop/470766
Thèmes: ZetaShop = http://themeforest.net/item/zeta-shop/470766
- 3lb34st
- Messages: 4
- Inscrit le: 23 Nov 2011, 23:28
Re: Redirection direct au panier apres achat.
Bonjour à toi,
Je t'en remercie.
La seule urgence dans ces forums est de remplir sa signature [Lire la mienne], cela est essentiel pour résoudre les problèmes. Tout le reste n'a aucun caractère d'urgence.3lb34st a écrit:merci de votre temps c'est extrêmement urgent.
Je t'en remercie.
1 - A lire avant de poster un sujet
2 - Politique sur la signature.

Il vaut mieux poser une question et paraître idiot cinq minutes que de ne pas la poser et être idiot toute sa vie.
Cool Boutik
2 - Politique sur la signature.

Il vaut mieux poser une question et paraître idiot cinq minutes que de ne pas la poser et être idiot toute sa vie.
Cool Boutik
-

LeorLindel - Messages: 1987
- Inscrit le: 19 Fév 2010, 13:44
- Localisation: Lutéce
Re: Redirection direct au panier apres achat.
C'est fait et oui c'est une urgence car c'est pour un client et jdois réussir à régler ce problème d'ici demain :S (Heure du québec)
Donc je suis un peu débouté par ce problème :S
Donc je suis un peu débouté par ce problème :S
OpenCart v1.5.1.3 US + traduction francaise
Thèmes: ZetaShop = http://themeforest.net/item/zeta-shop/470766
Thèmes: ZetaShop = http://themeforest.net/item/zeta-shop/470766
- 3lb34st
- Messages: 4
- Inscrit le: 23 Nov 2011, 23:28
Re: Redirection direct au panier apres achat.
Je viens de faire l'essai, aussi bien en cliquant sur le bouton "Ajouter au panier" de la liste des produits situés dans la page "Catégorie" qu'en cliquant sur ce même bouton de la "Fiche produit" et le résultat est identique, je suis dirigé vers le panier et la quantité est bien de "1".
Revoies tes modifications, car la modification que tu cites, fonctionne très bien sur une v1.5.1.3.1 vierge.
Voici les deux fichiers modifiés que tu peux comparer avec les tiens :
catalog/view/javascript/common.js
Tu n'as qu'à remplacer tes fichiers par ceux-ci.
Revoies tes modifications, car la modification que tu cites, fonctionne très bien sur une v1.5.1.3.1 vierge.
Voici les deux fichiers modifiés que tu peux comparer avec les tiens :
catalog/view/javascript/common.js
- Code: Tout sélectionner
$(document).ready(function() {
/* Search */
$('.button-search').bind('click', function() {
url = $('base').attr('href') + 'index.php?route=product/search';
var filter_name = $('input[name=\'filter_name\']').attr('value')
if (filter_name) {
url += '&filter_name=' + encodeURIComponent(filter_name);
}
location = url;
});
$('#header input[name=\'filter_name\']').keydown(function(e) {
if (e.keyCode == 13) {
url = $('base').attr('href') + 'index.php?route=product/search';
var filter_name = $('input[name=\'filter_name\']').attr('value')
if (filter_name) {
url += '&filter_name=' + encodeURIComponent(filter_name);
}
location = url;
}
});
/* Ajax Cart */
$('#cart > .heading a').bind('click', function() {
$('#cart').addClass('active');
$.ajax({
url: 'index.php?route=checkout/cart/update',
dataType: 'json',
success: function(json) {
if (json['output']) {
$('#cart .content').html(json['output']);
}
}
});
$('#cart').bind('mouseleave', function() {
$(this).removeClass('active');
});
});
/* Mega Menu */
$('#menu ul > li > a + div').each(function(index, element) {
// IE6 & IE7 Fixes
if ($.browser.msie && ($.browser.version == 7 || $.browser.version == 6)) {
var category = $(element).find('a');
var columns = $(element).find('ul').length;
$(element).css('width', (columns * 143) + 'px');
$(element).find('ul').css('float', 'left');
}
var menu = $('#menu').offset();
var dropdown = $(this).parent().offset();
i = (dropdown.left + $(this).outerWidth()) - (menu.left + $('#menu').outerWidth());
if (i > 0) {
$(this).css('margin-left', '-' + (i + 5) + 'px');
}
});
// IE6 & IE7 Fixes
if ($.browser.msie) {
if ($.browser.version <= 6) {
$('#column-left + #column-right + #content, #column-left + #content').css('margin-left', '195px');
$('#column-right + #content').css('margin-right', '195px');
$('.box-category ul li a.active + ul').css('display', 'block');
}
if ($.browser.version <= 7) {
$('#menu > ul > li').bind('mouseover', function() {
$(this).addClass('active');
});
$('#menu > ul > li').bind('mouseout', function() {
$(this).removeClass('active');
});
}
}
$('.success img, .warning img, .attention img, .information img').live('click', function() {
$(this).parent().fadeOut('slow', function() {
$(this).remove();
});
});
});
function addToCart(product_id) {
$.ajax({
url: 'index.php?route=checkout/cart/update',
type: 'post',
data: 'product_id=' + product_id,
dataType: 'json',
success: function(json) {
$('.success, .warning, .attention, .information, .error').remove();
if (json['redirect']) {
location = json['redirect'];
}
if (json['error']) {
if (json['error']['warning']) {
$('#notification').html('<div class="warning" style="display: none;">' + json['error']['warning'] + '<img src="catalog/view/theme/default/image/close.png" alt="" class="close" /></div>');
$('.warning').fadeIn('slow');
$('html, body').animate({ scrollTop: 0 }, 'slow');
}
}
if (json['success']) {
$('#notification').html('<div class="success" style="display: none;">' + json['success'] + '<img src="catalog/view/theme/default/image/close.png" alt="" class="close" /></div>');
$('.success').fadeIn('slow');
$('#cart_total').html(json['total']);
$('html, body').animate({ scrollTop: 0 }, 'slow');
window.location.href = 'index.php?route=checkout/cart';
}
}
});
}
function removeCart(key) {
$.ajax({
url: 'index.php?route=checkout/cart/update',
type: 'post',
data: 'remove=' + key,
dataType: 'json',
success: function(json) {
$('.success, .warning, .attention, .information').remove();
if (json['output']) {
$('#cart_total').html(json['total']);
$('#cart .content').html(json['output']);
}
}
});
}
function removeVoucher(key) {
$.ajax({
url: 'index.php?route=checkout/cart/update',
type: 'post',
data: 'voucher=' + key,
dataType: 'json',
success: function(json) {
$('.success, .warning, .attention, .information').remove();
if (json['output']) {
$('#cart_total').html(json['total']);
$('#cart .content').html(json['output']);
}
}
});
}
function addToWishList(product_id) {
$.ajax({
url: 'index.php?route=account/wishlist/update',
type: 'post',
data: 'product_id=' + product_id,
dataType: 'json',
success: function(json) {
$('.success, .warning, .attention, .information').remove();
if (json['success']) {
$('#notification').html('<div class="success" style="display: none;">' + json['success'] + '<img src="catalog/view/theme/default/image/close.png" alt="" class="close" /></div>');
$('.success').fadeIn('slow');
$('#wishlist_total').html(json['total']);
$('html, body').animate({ scrollTop: 0 }, 'slow');
}
}
});
}
function addToCompare(product_id) {
$.ajax({
url: 'index.php?route=product/compare/update',
type: 'post',
data: 'product_id=' + product_id,
dataType: 'json',
success: function(json) {
$('.success, .warning, .attention, .information').remove();
if (json['success']) {
$('#notification').html('<div class="success" style="display: none;">' + json['success'] + '<img src="catalog/view/theme/default/image/close.png" alt="" class="close" /></div>');
$('.success').fadeIn('slow');
$('#compare_total').html(json['total']);
$('html, body').animate({ scrollTop: 0 }, 'slow');
}
}
});
}
- Code: Tout sélectionner
<?php echo $header; ?><?php echo $column_left; ?><?php echo $column_right; ?>
<div id="content"><?php echo $content_top; ?>
<div class="breadcrumb">
<?php foreach ($breadcrumbs as $breadcrumb) { ?>
<?php echo $breadcrumb['separator']; ?><a href="<?php echo $breadcrumb['href']; ?>"><?php echo $breadcrumb['text']; ?></a>
<?php } ?>
</div>
<h1><?php echo $heading_title; ?></h1>
<div class="product-info">
<?php if ($thumb || $images) { ?>
<div class="left">
<?php if ($thumb) { ?>
<div class="image"><a href="<?php echo $popup; ?>" title="<?php echo $heading_title; ?>" class="fancybox" rel="fancybox"><img src="<?php echo $thumb; ?>" title="<?php echo $heading_title; ?>" alt="<?php echo $heading_title; ?>" id="image" /></a></div>
<?php } ?>
<?php if ($images) { ?>
<div class="image-additional">
<?php foreach ($images as $image) { ?>
<a href="<?php echo $image['popup']; ?>" title="<?php echo $heading_title; ?>" class="fancybox" rel="fancybox"><img src="<?php echo $image['thumb']; ?>" title="<?php echo $heading_title; ?>" alt="<?php echo $heading_title; ?>" /></a>
<?php } ?>
</div>
<?php } ?>
</div>
<?php } ?>
<div class="right">
<div class="description">
<?php if ($manufacturer) { ?>
<span><?php echo $text_manufacturer; ?></span> <a href="<?php echo $manufacturers; ?>"><?php echo $manufacturer; ?></a><br />
<?php } ?>
<span><?php echo $text_model; ?></span> <?php echo $model; ?><br />
<span><?php echo $text_reward; ?></span> <?php echo $reward; ?><br />
<span><?php echo $text_stock; ?></span> <?php echo $stock; ?></div>
<?php if ($price) { ?>
<div class="price"><?php echo $text_price; ?>
<?php if (!$special) { ?>
<?php echo $price; ?>
<?php } else { ?>
<span class="price-old"><?php echo $price; ?></span> <span class="price-new"><?php echo $special; ?></span>
<?php } ?>
<br />
<?php if ($tax) { ?>
<span class="price-tax"><?php echo $text_tax; ?> <?php echo $tax; ?></span><br />
<?php } ?>
<?php if ($points) { ?>
<span class="reward"><small><?php echo $text_points; ?> <?php echo $points; ?></small></span> <br />
<?php } ?>
<?php if ($discounts) { ?>
<br />
<div class="discount">
<?php foreach ($discounts as $discount) { ?>
<?php echo sprintf($text_discount, $discount['quantity'], $discount['price']); ?><br />
<?php } ?>
</div>
<?php } ?>
</div>
<?php } ?>
<?php if ($options) { ?>
<div class="options">
<h2><?php echo $text_option; ?></h2>
<br />
<?php foreach ($options as $option) { ?>
<?php if ($option['type'] == 'select') { ?>
<div id="option-<?php echo $option['product_option_id']; ?>" class="option">
<?php if ($option['required']) { ?>
<span class="required">*</span>
<?php } ?>
<b><?php echo $option['name']; ?>:</b><br />
<select name="option[<?php echo $option['product_option_id']; ?>]">
<option value=""><?php echo $text_select; ?></option>
<?php foreach ($option['option_value'] as $option_value) { ?>
<option value="<?php echo $option_value['product_option_value_id']; ?>"><?php echo $option_value['name']; ?>
<?php if ($option_value['price']) { ?>
(<?php echo $option_value['price_prefix']; ?><?php echo $option_value['price']; ?>)
<?php } ?>
</option>
<?php } ?>
</select>
</div>
<br />
<?php } ?>
<?php if ($option['type'] == 'radio') { ?>
<div id="option-<?php echo $option['product_option_id']; ?>" class="option">
<?php if ($option['required']) { ?>
<span class="required">*</span>
<?php } ?>
<b><?php echo $option['name']; ?>:</b><br />
<?php foreach ($option['option_value'] as $option_value) { ?>
<input type="radio" name="option[<?php echo $option['product_option_id']; ?>]" value="<?php echo $option_value['product_option_value_id']; ?>" id="option-value-<?php echo $option_value['product_option_value_id']; ?>" />
<label for="option-value-<?php echo $option_value['product_option_value_id']; ?>"><?php echo $option_value['name']; ?>
<?php if ($option_value['price']) { ?>
(<?php echo $option_value['price_prefix']; ?><?php echo $option_value['price']; ?>)
<?php } ?>
</label>
<br />
<?php } ?>
</div>
<br />
<?php } ?>
<?php if ($option['type'] == 'checkbox') { ?>
<div id="option-<?php echo $option['product_option_id']; ?>" class="option">
<?php if ($option['required']) { ?>
<span class="required">*</span>
<?php } ?>
<b><?php echo $option['name']; ?>:</b><br />
<?php foreach ($option['option_value'] as $option_value) { ?>
<input type="checkbox" name="option[<?php echo $option['product_option_id']; ?>][]" value="<?php echo $option_value['product_option_value_id']; ?>" id="option-value-<?php echo $option_value['product_option_value_id']; ?>" />
<label for="option-value-<?php echo $option_value['product_option_value_id']; ?>"><?php echo $option_value['name']; ?>
<?php if ($option_value['price']) { ?>
(<?php echo $option_value['price_prefix']; ?><?php echo $option_value['price']; ?>)
<?php } ?>
</label>
<br />
<?php } ?>
</div>
<br />
<?php } ?>
<?php if ($option['type'] == 'image') { ?>
<div id="option-<?php echo $option['product_option_id']; ?>" class="option">
<?php if ($option['required']) { ?>
<span class="required">*</span>
<?php } ?>
<b><?php echo $option['name']; ?>:</b><br />
<table class="option-image">
<?php foreach ($option['option_value'] as $option_value) { ?>
<tr>
<td style="width: 1px;"><input type="radio" name="option[<?php echo $option['product_option_id']; ?>]" value="<?php echo $option_value['product_option_value_id']; ?>" id="option-value-<?php echo $option_value['product_option_value_id']; ?>" /></td>
<td><label for="option-value-<?php echo $option_value['product_option_value_id']; ?>"><img src="<?php echo $option_value['image']; ?>" alt="<?php echo $option_value['name'] . ($option_value['price'] ? ' ' . $option_value['price_prefix'] . $option_value['price'] : ''); ?>" /></label></td>
<td><label for="option-value-<?php echo $option_value['product_option_value_id']; ?>"><?php echo $option_value['name']; ?>
<?php if ($option_value['price']) { ?>
(<?php echo $option_value['price_prefix']; ?><?php echo $option_value['price']; ?>)
<?php } ?>
</label></td>
</tr>
<?php } ?>
</table>
</div>
<br />
<?php } ?>
<?php if ($option['type'] == 'text') { ?>
<div id="option-<?php echo $option['product_option_id']; ?>" class="option">
<?php if ($option['required']) { ?>
<span class="required">*</span>
<?php } ?>
<b><?php echo $option['name']; ?>:</b><br />
<input type="text" name="option[<?php echo $option['product_option_id']; ?>]" value="<?php echo $option['option_value']; ?>" />
</div>
<br />
<?php } ?>
<?php if ($option['type'] == 'textarea') { ?>
<div id="option-<?php echo $option['product_option_id']; ?>" class="option">
<?php if ($option['required']) { ?>
<span class="required">*</span>
<?php } ?>
<b><?php echo $option['name']; ?>:</b><br />
<textarea name="option[<?php echo $option['product_option_id']; ?>]" cols="40" rows="5"><?php echo $option['option_value']; ?></textarea>
</div>
<br />
<?php } ?>
<?php if ($option['type'] == 'file') { ?>
<div id="option-<?php echo $option['product_option_id']; ?>" class="option">
<?php if ($option['required']) { ?>
<span class="required">*</span>
<?php } ?>
<b><?php echo $option['name']; ?>:</b><br />
<a id="button-option-<?php echo $option['product_option_id']; ?>" class="button"><span><?php echo $button_upload; ?></span></a>
<input type="hidden" name="option[<?php echo $option['product_option_id']; ?>]" value="" />
</div>
<br />
<?php } ?>
<?php if ($option['type'] == 'date') { ?>
<div id="option-<?php echo $option['product_option_id']; ?>" class="option">
<?php if ($option['required']) { ?>
<span class="required">*</span>
<?php } ?>
<b><?php echo $option['name']; ?>:</b><br />
<input type="text" name="option[<?php echo $option['product_option_id']; ?>]" value="<?php echo $option['option_value']; ?>" class="date" />
</div>
<br />
<?php } ?>
<?php if ($option['type'] == 'datetime') { ?>
<div id="option-<?php echo $option['product_option_id']; ?>" class="option">
<?php if ($option['required']) { ?>
<span class="required">*</span>
<?php } ?>
<b><?php echo $option['name']; ?>:</b><br />
<input type="text" name="option[<?php echo $option['product_option_id']; ?>]" value="<?php echo $option['option_value']; ?>" class="datetime" />
</div>
<br />
<?php } ?>
<?php if ($option['type'] == 'time') { ?>
<div id="option-<?php echo $option['product_option_id']; ?>" class="option">
<?php if ($option['required']) { ?>
<span class="required">*</span>
<?php } ?>
<b><?php echo $option['name']; ?>:</b><br />
<input type="text" name="option[<?php echo $option['product_option_id']; ?>]" value="<?php echo $option['option_value']; ?>" class="time" />
</div>
<br />
<?php } ?>
<?php } ?>
</div>
<?php } ?>
<div class="cart">
<div><?php echo $text_qty; ?>
<input type="text" name="quantity" size="2" value="<?php echo $minimum; ?>" />
<input type="hidden" name="product_id" size="2" value="<?php echo $product_id; ?>" />
<a id="button-cart" class="button"><span><?php echo $button_cart; ?></span></a></div>
<div><span> <?php echo $text_or; ?> </span></div>
<div><a onclick="addToWishList('<?php echo $product_id; ?>');"><?php echo $button_wishlist; ?></a><br />
<a onclick="addToCompare('<?php echo $product_id; ?>');"><?php echo $button_compare; ?></a></div>
<?php if ($minimum > 1) { ?>
<div class="minimum"><?php echo $text_minimum; ?></div>
<?php } ?>
</div>
<?php if ($review_status) { ?>
<div class="review">
<div><img src="catalog/view/theme/default/image/stars-<?php echo $rating; ?>.png" alt="<?php echo $reviews; ?>" /> <a onclick="$('a[href=\'#tab-review\']').trigger('click');"><?php echo $reviews; ?></a> | <a onclick="$('a[href=\'#tab-review\']').trigger('click');"><?php echo $text_write; ?></a></div>
<div class="share"><!-- AddThis Button BEGIN -->
<div class="addthis_default_style"><a class="addthis_button_compact"><?php echo $text_share; ?></a> <a class="addthis_button_email"></a><a class="addthis_button_print"></a> <a class="addthis_button_facebook"></a> <a class="addthis_button_twitter"></a></div>
<script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js"></script>
<!-- AddThis Button END -->
</div>
</div>
<?php } ?>
</div>
</div>
<div id="tabs" class="htabs"><a href="#tab-description"><?php echo $tab_description; ?></a>
<?php if ($attribute_groups) { ?>
<a href="#tab-attribute"><?php echo $tab_attribute; ?></a>
<?php } ?>
<?php if ($review_status) { ?>
<a href="#tab-review"><?php echo $tab_review; ?></a>
<?php } ?>
<?php if ($products) { ?>
<a href="#tab-related"><?php echo $tab_related; ?> (<?php echo count($products); ?>)</a>
<?php } ?>
</div>
<div id="tab-description" class="tab-content"><?php echo $description; ?></div>
<?php if ($attribute_groups) { ?>
<div id="tab-attribute" class="tab-content">
<table class="attribute">
<?php foreach ($attribute_groups as $attribute_group) { ?>
<thead>
<tr>
<td colspan="2"><?php echo $attribute_group['name']; ?></td>
</tr>
</thead>
<tbody>
<?php foreach ($attribute_group['attribute'] as $attribute) { ?>
<tr>
<td><?php echo $attribute['name']; ?></td>
<td><?php echo $attribute['text']; ?></td>
</tr>
<?php } ?>
</tbody>
<?php } ?>
</table>
</div>
<?php } ?>
<?php if ($review_status) { ?>
<div id="tab-review" class="tab-content">
<div id="review"></div>
<h2 id="review-title"><?php echo $text_write; ?></h2>
<b><?php echo $entry_name; ?></b><br />
<input type="text" name="name" value="" />
<br />
<br />
<b><?php echo $entry_review; ?></b>
<textarea name="text" cols="40" rows="8" style="width: 98%;"></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" />
<input type="radio" name="rating" value="2" />
<input type="radio" name="rating" value="3" />
<input type="radio" name="rating" value="4" />
<input type="radio" name="rating" value="5" />
<span><?php echo $entry_good; ?></span><br />
<br />
<b><?php echo $entry_captcha; ?></b><br />
<input type="text" name="captcha" value="" />
<br />
<img src="index.php?route=product/product/captcha" alt="" id="captcha" /><br />
<br />
<div class="buttons">
<div class="right"><a id="button-review" class="button"><span><?php echo $button_continue; ?></span></a></div>
</div>
</div>
<?php } ?>
<?php if ($products) { ?>
<div id="tab-related" class="tab-content">
<div class="box-product">
<?php foreach ($products as $product) { ?>
<div>
<?php if ($product['thumb']) { ?>
<div class="image"><a href="<?php echo $product['href']; ?>"><img src="<?php echo $product['thumb']; ?>" alt="<?php echo $product['name']; ?>" /></a></div>
<?php } ?>
<div class="name"><a href="<?php echo $product['href']; ?>"><?php echo $product['name']; ?></a></div>
<?php if ($product['price']) { ?>
<div class="price">
<?php if (!$product['special']) { ?>
<?php echo $product['price']; ?>
<?php } else { ?>
<span class="price-old"><?php echo $product['price']; ?></span> <span class="price-new"><?php echo $product['special']; ?></span>
<?php } ?>
</div>
<?php } ?>
<?php if ($product['rating']) { ?>
<div class="rating"><img src="catalog/view/theme/default/image/stars-<?php echo $product['rating']; ?>.png" alt="<?php echo $product['reviews']; ?>" /></div>
<?php } ?>
<a onclick="addToCart('<?php echo $product['product_id']; ?>');" class="button"><span><?php echo $button_cart; ?></span></a></div>
<?php } ?>
</div>
</div>
<?php } ?>
<?php if ($tags) { ?>
<div class="tags"><b><?php echo $text_tags; ?></b>
<?php foreach ($tags as $tag) { ?>
<a href="<?php echo $tag['href']; ?>"><?php echo $tag['tag']; ?></a>,
<?php } ?>
</div>
<?php } ?>
<?php echo $content_bottom; ?></div>
<script type="text/javascript"><!--
$('.fancybox').fancybox({cyclic: true});
//--></script>
<script type="text/javascript"><!--
$('#button-cart').bind('click', function() {
$.ajax({
url: 'index.php?route=checkout/cart/update',
type: 'post',
data: $('.product-info input[type=\'text\'], .product-info input[type=\'hidden\'], .product-info input[type=\'radio\']:checked, .product-info input[type=\'checkbox\']:checked, .product-info select, .product-info textarea'),
dataType: 'json',
success: function(json) {
$('.success, .warning, .attention, information, .error').remove();
if (json['error']) {
if (json['error']['warning']) {
$('#notification').html('<div class="warning" style="display: none;">' + json['error']['warning'] + '<img src="catalog/view/theme/default/image/close.png" alt="" class="close" /></div>');
$('.warning').fadeIn('slow');
}
for (i in json['error']) {
$('#option-' + i).after('<span class="error">' + json['error'][i] + '</span>');
}
}
if (json['success']) {
$('#notification').html('<div class="success" style="display: none;">' + json['success'] + '<img src="catalog/view/theme/default/image/close.png" alt="" class="close" /></div>');
$('.success').fadeIn('slow');
$('#cart_total').html(json['total']);
$('html, body').animate({ scrollTop: 0 }, 'slow');
window.location.href = 'index.php?route=checkout/cart';
}
}
});
});
//--></script>
<?php if ($options) { ?>
<script type="text/javascript" src="catalog/view/javascript/jquery/ajaxupload.js"></script>
<?php foreach ($options as $option) { ?>
<?php if ($option['type'] == 'file') { ?>
<script type="text/javascript"><!--
new AjaxUpload('#button-option-<?php echo $option['product_option_id']; ?>', {
action: 'index.php?route=product/product/upload',
name: 'file',
autoSubmit: true,
responseType: 'json',
onSubmit: function(file, extension) {
$('#button-option-<?php echo $option['product_option_id']; ?>').after('<img src="catalog/view/theme/default/image/loading.gif" class="loading" style="padding-left: 5px;" />');
},
onComplete: function(file, json) {
$('.error').remove();
if (json.success) {
alert(json.success);
$('input[name=\'option[<?php echo $option['product_option_id']; ?>]\']').attr('value', json.file);
}
if (json.error) {
$('#option-<?php echo $option['product_option_id']; ?>').after('<span class="error">' + json.error + '</span>');
}
$('.loading').remove();
}
});
//--></script>
<?php } ?>
<?php } ?>
<?php } ?>
<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; ?>');
$('#button-review').bind('click', function() {
$.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();
$('#button-review').attr('disabled', true);
$('#review-title').after('<div class="attention"><img src="catalog/view/theme/default/image/loading.gif" alt="" /> <?php echo $text_wait; ?></div>');
},
complete: function() {
$('#button-review').attr('disabled', false);
$('.attention').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 a').tabs();
//--></script>
<script type="text/javascript" src="catalog/view/javascript/jquery/ui/jquery-ui-timepicker-addon.js"></script>
<script type="text/javascript"><!--
if ($.browser.msie && $.browser.version == 6) {
$('.date, .datetime, .time').bgIframe();
}
$('.date').datepicker({dateFormat: 'yy-mm-dd'});
$('.datetime').datetimepicker({
dateFormat: 'yy-mm-dd',
timeFormat: 'h:m'
});
$('.time').timepicker({timeFormat: 'h:m'});
//--></script>
<?php echo $footer; ?>
Tu n'as qu'à remplacer tes fichiers par ceux-ci.
1 - A lire avant de poster un sujet
2 - Politique sur la signature.

Il vaut mieux poser une question et paraître idiot cinq minutes que de ne pas la poser et être idiot toute sa vie.
Cool Boutik
2 - Politique sur la signature.

Il vaut mieux poser une question et paraître idiot cinq minutes que de ne pas la poser et être idiot toute sa vie.
Cool Boutik
-

LeorLindel - Messages: 1987
- Inscrit le: 19 Fév 2010, 13:44
- Localisation: Lutéce
Re: Redirection direct au panier apres achat.
Je pense que tu as un doublon dans tes fichiers.
1 - A lire avant de poster un sujet
2 - Politique sur la signature.

Il vaut mieux poser une question et paraître idiot cinq minutes que de ne pas la poser et être idiot toute sa vie.
Cool Boutik
2 - Politique sur la signature.

Il vaut mieux poser une question et paraître idiot cinq minutes que de ne pas la poser et être idiot toute sa vie.
Cool Boutik
-

LeorLindel - Messages: 1987
- Inscrit le: 19 Fév 2010, 13:44
- Localisation: Lutéce
Re: Redirection direct au panier apres achat.
Merci! Oui j'avais bien un doublon car je faisais appel une seconde fois à la fonction addtocart du button en question, le pourquoi cela rajoutais un deuxième item!
Merci beaucoup!
Merci beaucoup!
OpenCart v1.5.1.3 US + traduction francaise
Thèmes: ZetaShop = http://themeforest.net/item/zeta-shop/470766
Thèmes: ZetaShop = http://themeforest.net/item/zeta-shop/470766
- 3lb34st
- Messages: 4
- Inscrit le: 23 Nov 2011, 23:28
Re: Redirection direct au panier apres achat.
Tu vois quand il n'y a pas urgence, on avance bien mieux et surement plus vite !
1 - A lire avant de poster un sujet
2 - Politique sur la signature.

Il vaut mieux poser une question et paraître idiot cinq minutes que de ne pas la poser et être idiot toute sa vie.
Cool Boutik
2 - Politique sur la signature.

Il vaut mieux poser une question et paraître idiot cinq minutes que de ne pas la poser et être idiot toute sa vie.
Cool Boutik
-

LeorLindel - Messages: 1987
- Inscrit le: 19 Fév 2010, 13:44
- Localisation: Lutéce
Re: Redirection direct au panier apres achat.
Oui il y avait bien urgence mais c'est aussi le fait que depuis ce matin que je ne focussait que cela.
Il me manque seulement un coup d'oeil externe a la situation pour m'aider
Il me manque seulement un coup d'oeil externe a la situation pour m'aider
OpenCart v1.5.1.3 US + traduction francaise
Thèmes: ZetaShop = http://themeforest.net/item/zeta-shop/470766
Thèmes: ZetaShop = http://themeforest.net/item/zeta-shop/470766
- 3lb34st
- Messages: 4
- Inscrit le: 23 Nov 2011, 23:28
Re: Redirection direct au panier apres achat.
Comme je te l'ai dit, si tu utilises le mot "Urgence" dans ces forums, tu auras beaucoup plus de chance d'obtenir aucune réponse. Alors essaye de bannir ce mot de ton vocabulaire, ici.
1 - A lire avant de poster un sujet
2 - Politique sur la signature.

Il vaut mieux poser une question et paraître idiot cinq minutes que de ne pas la poser et être idiot toute sa vie.
Cool Boutik
2 - Politique sur la signature.

Il vaut mieux poser une question et paraître idiot cinq minutes que de ne pas la poser et être idiot toute sa vie.
Cool Boutik
-

LeorLindel - Messages: 1987
- Inscrit le: 19 Fév 2010, 13:44
- Localisation: Lutéce
9 messages
• Page 1 sur 1
Qui est en ligne ?
Utilisateur(s) parcourant actuellement ce forum : Exabot [Bot] et 1 invité





