Jump to content

Dirty Butter

Moderator
  • Posts

    6,634
  • Joined

  • Last visited

  • Days Won

    139

Posts posted by Dirty Butter

  1. I tried it on one of my test stores, and it worked, although it needs some cosmetic improvements.

    In main.php:

          <meta name="description" content="{if isset($META_DESCRIPTION)}{$META_DESCRIPTION}{/if}">
          <meta name="keywords" content="{if isset($META_KEYWORDS)}{$META_KEYWORDS}{/if}">
          <meta name="robots" content="index, follow">
          <meta name="generator" content="cubecart">
    <meta name="google-translate-customization" content="fbf7401f77452570-feb54b900254ef56-g54139a6ff8d778ad-1a"></meta>
         

    In box.session.php:

    <div class="right text-right show-for-medium-up" id="box-session">
      <!-- {if $IS_USER}
       <a href="#" data-dropdown="session" class="button small">{$CUSTOMER.first_name} {$CUSTOMER.last_name}'s Account Details <svg class="icon"><use xlink:href="#icon-caret-down"></use></svg></a><br>
       <ul id="session" data-dropdown-content class="f-dropdown">
          <li class="text-left"><a href="{$STORE_URL}/index.php?_a=profile" title="{$LANG.account.your_details}">{$LANG.account.your_details}</a></li>
          <li class="text-left"><a href="{$STORE_URL}/index.php?_a=vieworder" title="{$LANG.account.your_orders}">{$LANG.account.your_orders}</a></li>
          <li class="text-left"><a href="{$STORE_URL}/index.php?_a=addressbook" title="{$LANG.account.your_addressbook}">{$LANG.account.your_addressbook}</a></li>
          <li class="text-left"><a href="{$STORE_URL}/index.php?_a=downloads" title="{$LANG.account.your_downloads}">{$LANG.account.your_downloads}</a></li>
          <li class="text-left"><a href="{$STORE_URL}/index.php?_a=newsletter" title="{$LANG.account.your_subscription}">{$LANG.account.your_subscription}</a></li>
          {foreach from=$SESSION_LIST_HOOKS item=list_item}
          <li class="text-left"><a href="{$list_item.href}" title="{$list_item.title}">{$list_item.title}</a></li>
          {/foreach}
          <li class="text-left"><a href="{$STORE_URL}/index.php?_a=account" title="{$LANG.account.your_account}">{$LANG.common.more}&hellip;</a></li>
          <li class="text-left"><a href="{$STORE_URL}/index.php?_a=logout" title="{$LANG.account.logout}">{$LANG.account.logout}</a></li>
       </ul>
       {else}
       <a href="{$STORE_URL}/login.html" class="button white small nopad-sides">{$LANG.account.login}</a> / <a href="{$STORE_URL}/register.html" class="button white small nopad-sides">{$LANG.account.register}</a>
       {/if} -->
    
    {literal}
     <div id="translate">
    <div align="left">
    <div id="google_translate_element"></div><script type="text/javascript">
    
    function googleTranslateElementInit()
    {
    new google.translate.TranslateElement({pageLanguage: 'en', includedLanguages: 'de,en,es,fr,it,ja,ko,th,zh-CN,zh-TW', layout: google.translate.TranslateElement.InlineLayout.SIMPLE, autoDisplay: false}, 'google_translate_element');
    }
    </script><script type="text/javascript" src="//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>
    </div>
    </div> 
    {/literal}
    </div>

     

  2. Did you try with and without {literal}your Google script code{/literal} in your google_translate.php?

    {literal}
     <div id="translate">
    <div align="left">
    <div id="google_translate_element"></div><script type="text/javascript">
    
    function googleTranslateElementInit()
    {
    new google.translate.TranslateElement({pageLanguage: 'en', includedLanguages: 'de,en,es,fr,it,ja,ko,th,zh-CN,zh-TW', layout: google.translate.TranslateElement.InlineLayout.SIMPLE, autoDisplay: false}, 'google_translate_element');
    }
    </script><script type="text/javascript" src="//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>
    </div>
    </div> 
    {/literal}

     

  3. 3 minutes ago, violinman said:

    I wonder if there needs to be an entry somewhere for the file google_translate.php for cubecart to be aware of it?

    I don't see any reason why that would be needed, since it's not going to be saving any translations in your database.

    "Crashing" (white page??) sounds like you either didn't form your google_translate.php file properly, or it's that literal issue.

  4. I'm not going to be able to help, other than guessing. If I were doing it on my own site I would make a safe copy of box.session.php and then try editing my version, keeping the div arrangement in that file and put your Translate code in there. Then putting {include file='templates/box.session.php'} back in main.php.

  5. Ah! Something about what you said made me think it was a script, which requires the literal braces to work. The literal braces may be needed for the Google script part.

    But the meta part doesn't look like a script. Just add it to the rest of the meta lines in main, and see if it works.

    The space for the session/login box is now available - try using the same div's the session box had, and see if it looks right.

  6. The header in main.php would be for the meta name part. You likely will need to put it in {literal}script{/literal}.

    If you want it next to your search box, you will probably need to change the number of columns allotted to the search box and possibly the logo. Foundation uses 12 columns, so if you shave one off of search and one off of logo in the main.php, you have created a space for two columns for your translate box.

  7. There was a change in how tabs are created that causes some minor issues. This may be one of those. I think they've all been found by now, but not sure if it was in 61.8, or what will become 6.1.9.

    Backup your files for now by downloading via FTP.

    More importantly - please be sure the next time you show any of your install information that you take your admin_whatever naming and edit it to admin_XXX. Otherwise all these CC efforts to hide your admin folder and file naming is in vain. I've edited it for you.

  8. Ok. It probably needs to be in a sidebar box or your homepage document. You might be able to create a box file  (i I would try copying the feature box and modifying it) and use the code from the basket that has the estimate shipping in it. If the homepage document sounds better, you may run into trouble with Smarty working with the code.

    If you're not able to work it out for yourself, you may have to pay to have it created.

  9. It's still not clear to me what page you want this estimated shipping form to be available to the customer.

    I mentioned the Product page, because SFWS has an AskAbout plugin that perhaps could be customized to do what you want.

  10. Do you use more than one shipping plugin? If not, doesn't the stock estimate link on the cart give you what you want?

    What CC version are you using?

    The estimate is a choice on Admin>Store Settings>Features> near the bottom. I don't know which version this was added to, but it's fairly recent.

×
×
  • Create New...