Announcement

Collapse
No announcement yet.

SHOW or HIDE Shopping Cart Translation

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    SHOW or HIDE Shopping Cart Translation

    Hi !
    Because my site is in French, I want to translate the SHOW or HIDE function in my shopping cart page !
    In Design Mode, I can see the command is in Checkout Page 2.
    Where can I translate the words :
    - « HIDE » for « CACHER »
    - « SHOW » for « AFFICHER »
    without affecting the code ?
    Thank You !
    Bernard Morin

    #2
    It's hard-coded in actinicextras.js. Look for:
    Code:
    function SetShoppingCartVisibility()
    	{
    	var elemShowHide = document.getElementById("idShowHide");
    	if (!elemShowHide)
    		{
    		return;
    		}
    
    	var spanShoppingCart = document.getElementById("idShoppingCartGrid");
    	if (!spanShoppingCart)
    		{
    		return;
    		}
    	var elemCartHeadingTotal = document.getElementById("idCartHeadingTotal");
    	var elemCartChangeCell = document.getElementById("idCartChangeCell");
    	if (spanShoppingCart.style.display == "none")
    		{
    		setCookie('cartDisplayPreference', 'show');
    		spanShoppingCart.style.display = "";
    		elemShowHide.innerHTML = 'hide';
    		elemCartHeadingTotal.style.display = 'none';
    		if (elemCartChangeCell)
    			{
    			document.getElementById("idCartChangeCell").style.display = '';
    			}
    		}
    	else
    		{
    		setCookie('cartDisplayPreference', 'hide');
    		spanShoppingCart.style.display = "none";
    		elemShowHide.innerHTML = 'show';
    		elemCartHeadingTotal.style.display = '';
    		if (elemCartChangeCell)
    			{
    			document.getElementById("idCartChangeCell").style.display = 'none';
    			}
    		}
    	}
    Just change the bits in red.
    Norman - www.drillpine.biz
    Edinburgh, U K / Bitez, Turkey

    Comment


      #3
      Thank you ! Thank you ! Thank you !

      Thank you for the fast response !
      Bernard Morin

      Comment


        #4
        You're welcome.

        Just for fun here is the SellerDeck code in post #2 above rewritten to use jQuery (which is now loaded as standard since SD V11).

        Only 9 lines needed instead of 37 - and I've added in a nice smooth 1/3 second animation for the hiding and showing:
        Code:
        function SetShoppingCartVisibility(status) {
        	var delay = status === true ? 0 : 333;
        	$( "#idShoppingCartGrid" ).toggle(delay, function(){
        		var iscartvisble = $(this).is(":visible");
        		setCookie('cartDisplayPreference', iscartvisble ? 'show' : 'hide');
        		$ ( "#idShowHide" ).html(iscartvisble ? 'hide' : 'show');
        		iscartvisble ? $( "#idCartHeadingTotal" ).hide(delay) : $( "#idCartHeadingTotal" ).show(delay);
        		});
        }
        The line containing the words to change for French usage is "$ ( "#idShowHide" ).html(iscartvisble ? 'hide' : 'show');"

        And to get an initial fast animation when the checkout first loads, change function HideCartDetailsOnCheckoutPages to:
        Code:
        function HideCartDetailsOnCheckoutPages(){
        	if (getCookie('cartDisplayPreference') !== 'show')
        		{
        		SetShoppingCartVisibility(true);
        		}
        }
        Norman - www.drillpine.biz
        Edinburgh, U K / Bitez, Turkey

        Comment

        Working...
        X