after click on Add to Basket

apa

No avatar

2008-07-22 16:48

Hello !
every time costumer click on "add to basket" button, the basket page displayed and for continue buying he should back to the main page and search for product again.
I wonder, is there any way that if customer choose a product,the basket page doesn't go up and only the the basket logo on corner of page changes?
Thanks in advance

» Quick.Cart v3.x

Makaron

Avatar: Makaron

2008-07-23 09:22

This is not so simple.. You can redirect user to another page after adding product to basket but total number of products in basket (which is also displayed on the top of page near basket ico) is counting on basket page so if You want to correctly count this value it have to be like now.

gwmbox

Avatar: gwmbox

2008-08-07 09:41

Then what about a continue shopping button that the shopper can use after they have got to the cart and updated quantity, the continue shopping button can be set via a cookie I suspect so that the shopper is taken back to where the left.

Anyone got a quick bit of code to do this?

Cheers

apa

No avatar

2008-08-09 06:34

I find a way!you can open the basket page in new windows by adding this code to pages_default.tpl line 67 after $aData[sBasketPage]&iProductAdd=$aData[iProduct]&iQuantity=1" rel="nofollow"

<?  target="top"     ?>



after you do that,if user click on add to cart,for the first time new pages open (like pop up) and user can continue buying without any distraction.if select another product and click on add to cart ,the windows that open in first time, changed and no new page opened.

gwmbox

Avatar: gwmbox

2008-08-12 08:21

My work around :) may not be bug free any edits welcome

in orders.basket.tpl file change;


<td colspan="2" class="nextStep">
              <
input type="submit" name="sNext" value="$lang[Basket_next]&nbsp;&nbsp;>>" class="submit" />
            </
td>



to

<td colspan="2" class="continue"><script type="text/javascript">
;(function(){
if(
readCookie('storedURL')){
var 
stored unescape(readCookie('storedURL')).split('::');
var 
URL stored[0].split('?');
if(
URL[1] && URL[1].length 0)
URL[1] = '?' escape(URL[1]);
else
URL[1] = '';
document.write('<a href="' URL[0] + URL[1] + '" class="cont"><<&nbsp;&nbsp;Continue Shopping<\/a>');
}})();
</script></td>
         <td colspan="2" class="nextStep">
              <input type="submit" name="sNext" value="$lang[Basket_next]&nbsp;&nbsp;>>" class="submit" />
            </td>



Define a class in your default.css file for cont e.g.


#orderedProducts .continue a.cont {
border:1px solid #d01c02;
backgroundurl('img/basket_button_fw.png'repeat-x;
background-color:inherit;
text-decorationnone;
padding:3px 7px;
color:#fff;
font-size:0.9em;
font-weight:bold;
}



open core/common.js and add the following functions


function readCookie(sName) {
    var 
sNameEQ sName "=";
    var 
ca document.cookie.split(';');
    for(var 
i=0;ca.length;i++) {
        var 
ca[i];
        while (
c.charAt(0)==' 'c.substring(1,c.length);
        if (
c.indexOf(sNameEQ) == 0) return c.substring(sNameEQ.length,c.length);
    }
    return 
null;
}

function 
eraseCookie(sName) {
    
createCookie(sName,"",-1);
}



Upload and you should have a continue button on your basket form.

Hope that helps and I hope the code above comes out OK

Cheers

Back to top
about us | contact