Zen Cart Logo
Forums / Addon Sideboxes / CartSideboxWithButtonandFreeShipping - Multi language support?

CartSideboxWithButtonandFreeShipping - Multi language support?

Locked

Views: 4,193

Results 1 to 20 of 21
This thread is locked. New replies are disabled.
10 Dec 2009, 10:24 AM
#1
jeet_kune_do avatar

jeet_kune_do

Zen Follower

Join Date:
Nov 2008
Location:
Slovenija
Posts:
119
Plugin Contributions:
0

CartSideboxWithButtonandFreeShipping - Multi language support?

I' want to add multi language support to that addons.

The file is templates-> sidebox-> tpl_shopping_cart.php

Where is the english texst for shipping qualifayer I need to translate also to other language.

<?php
/**
 * Side Box Template
 *
 * @package templateSystem
 * @copyright Copyright 2003-2005 Zen Cartt Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version $Id: tpl_shopping_cart.php 4821 2006-10-23 10:54:15Z drbyte $
 * @installation instructions file provided by Judy Gunderson at http://zencart-ecommerce-website-design.com
 */
  $content ="";

  $content .= '<div id="' . str_replace('_', '-', $box_id . 'Content') . '" class="sideBoxContent">';
  if ($_SESSION['cart']->count_contents() > 0) {
  $content .= '<div id="cartBoxListWrapper">' . "\n" . '<ul>' . "\n";
    $products = $_SESSION['cart']->get_products();
    for ($i=0, $n=sizeof($products); $i<$n; $i++) {
      $content .= '<li>';

      if (($_SESSION['new_products_id_in_cart']) && ($_SESSION['new_products_id_in_cart'] == $products[$i]['id'])) {
        $content .= '<span class="cartNewItem">';
      } else {
        $content .= '<span class="cartOldItem">';
      }

      $content .= $products[$i]['quantity'] . BOX_SHOPPING_CART_DIVIDER . '</span><a href="' . zen_href_link(zen_get_info_page($products[$i]['id']), 'products_id=' . $products[$i]['id']) . '">';

      if (($_SESSION['new_products_id_in_cart']) && ($_SESSION['new_products_id_in_cart'] == $products[$i]['id'])) {
        $content .= '<span class="cartNewItem">';
      } else {
        $content .= '<span class="cartOldItem">';
      }

      $content .= $products[$i]['name'] . '</span></a></li>' . "\n";

      if (($_SESSION['new_products_id_in_cart']) && ($_SESSION['new_products_id_in_cart'] == $products[$i]['id'])) {
        $_SESSION['new_products_id_in_cart'] = '';
      }
    }
    $content .= '</ul>' . "\n" . '</div>';
  } else {
    $content .= '<div id="cartBoxEmpty">' . BOX_SHOPPING_CART_EMPTY . '</div>';
  }

  if ($_SESSION['cart']->count_contents() > 0) {
    $content .= '<hr />';
    $content .= '<div class="cartBoxTotal">' . $currencies->format($_SESSION['cart']->show_total()) . '</div>';
	
   $content .= '<div class="cartSidebox" />';
	
  }

$free_ship_on = MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING;

if ($free_ship_on == 'false') {
  $free_limit = MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER;
  if ($_SESSION['cart']->count_contents() > 0) { 
     $_SESSION['cart']->get_products(); 
     $basket_total = $_SESSION['cart']->show_total(); 
     if ($basket_total < $free_limit) { 
        $diff_to_free = ($free_limit - $basket_total); 
        $content .= 'Add '. $currencies->format($diff_to_free) .' to your order to qualify for<br />Free Shipping!'; 
     } else { 
        $content .='Your order qualifies for<br />Free Shipping!'; 
     } 
  } else { 
        $content .= 'Free Shipping for orders of<br />' . $currencies->format($free_limit) . ' or more.'; 
  }
  }
	$content .= '</div>';  

  if (isset($_SESSION['customer_id'])) {
    $gv_query = "select amount
                 from " . TABLE_COUPON_GV_CUSTOMER . "
                 where customer_id = '" . $_SESSION['customer_id'] . "'";
   $gv_result = $db->Execute($gv_query);

    if ($gv_result->RecordCount() && $gv_result->fields['amount'] > 0 ) {
      $content .= '<div id="cartBoxGVButton"><a href="' . zen_href_link(FILENAME_GV_SEND, '', 'SSL') . '">' . zen_image_button(BUTTON_IMAGE_SEND_A_GIFT_CERT , BUTTON_SEND_A_GIFT_CERT_ALT) . '</a></div>';
      $content .= '<div id="cartBoxVoucherBalance">' . VOUCHER_BALANCE . $currencies->format($gv_result->fields['amount']) . '</div>';
    }
  }
  $content .= '<br class="clearBoth" />';
  $content .= '<div class="cartSidebox"><a href="' . zen_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL') . '">' . zen_image_button(BUTTON_IMAGE_CHECKOUT, BUTTON_CHECKOUT_ALT) . '</a></div>';
  $content .= '</div>';
?>

Can someone help me?

Thank's!

24 Dec 2009, 4:28 PM
#2
jeet_kune_do avatar

jeet_kune_do

Zen Follower

Join Date:
Nov 2008
Location:
Slovenija
Posts:
119
Plugin Contributions:
0

Re: CartSideboxWithButtonandFreeShipping - Multi language support?

Anybody?

24 Dec 2009, 5:07 PM
#3
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: CartSideboxWithButtonandFreeShipping - Multi language support?

I didn't see this when you first posted it. This mod has hard-coded English text in parts, and will need to have more text constants created to allow it to be multilingual.

Search in Tools > Developers Toolkit for BOX_SHOPPING_CART_EMPTY to find the file where some text is correctly defined; other defines can be added there.

The Shoppingcart/Freeship in Header mod has done those define tasks already, and it may serve as a guide for you. It is not yet active in Free Addons, but you can get the zip from the support thread.

5 Jan 2010, 1:25 PM
#4
jeet_kune_do avatar

jeet_kune_do

Zen Follower

Join Date:
Nov 2008
Location:
Slovenija
Posts:
119
Plugin Contributions:
0

Re: CartSideboxWithButtonandFreeShipping - Multi language support?

Sweet!

I will use this addon.

How can I change the table position in css?

Now it' is on the top of the page in the right corner.

5 Jan 2010, 1:48 PM
#5
jeet_kune_do avatar

jeet_kune_do

Zen Follower

Join Date:
Nov 2008
Location:
Slovenija
Posts:
119
Plugin Contributions:
0

Re: CartSideboxWithButtonandFreeShipping - Multi language support?

I finded.

Position must be set to fixed.

:lamo:

5 Jan 2010, 1:59 PM
#6
jeet_kune_do avatar

jeet_kune_do

Zen Follower

Join Date:
Nov 2008
Location:
Slovenija
Posts:
119
Plugin Contributions:
0

Re: CartSideboxWithButtonandFreeShipping - Multi language support?

I mean to: absolute

:blush:

5 Jan 2010, 2:38 PM
#7
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: CartSideboxWithButtonandFreeShipping - Multi language support?

Since everybody will want the header cart box in a different place or different shape, I didn't try to make it fit any particular place. Post a link to your site and I will help you position and style it as you like.

5 Jan 2010, 11:13 PM
#8
jeet_kune_do avatar

jeet_kune_do

Zen Follower

Join Date:
Nov 2008
Location:
Slovenija
Posts:
119
Plugin Contributions:
0

Re: CartSideboxWithButtonandFreeShipping - Multi language support?

Thank you so much! I really appreciated.

I sended the link to pm.

5 Jan 2010, 11:49 PM
#9
jeet_kune_do avatar

jeet_kune_do

Zen Follower

Join Date:
Nov 2008
Location:
Slovenija
Posts:
119
Plugin Contributions:
0

Re: CartSideboxWithButtonandFreeShipping - Multi language support?

I notice when I select different languages the table move a little bit.
For english is in one position, for italian it's more to the right.

I need that the table don't move.

I really appreciate your help!

6 Jan 2010, 4:01 AM
#10
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: CartSideboxWithButtonandFreeShipping - Multi language support?

The  is called the "byte order marker" or BOM. It happens when there is incorrect translation between an English-type character set and bigger character sets like UTF-8. I don't know myself how to get rid of it, but the question has been asked and answered many times here - just search.

You are still using the stock shopping cart header box, except that the Template Monster template has put it in a whole tangle of custom table code. I don't know how right now to fix that, and am not interested in trying. Can you install the Shoppingcart/Freeship in Header? You will need to delete the tpl_header.php that comes with the mod, because the TM one is very customized. Just add the call to the mod to the existing tpl_header.php, as described in the readme.

6 Jan 2010, 2:41 PM
#11
jeet_kune_do avatar

jeet_kune_do

Zen Follower

Join Date:
Nov 2008
Location:
Slovenija
Posts:
119
Plugin Contributions:
0

Re: CartSideboxWithButtonandFreeShipping - Multi language support?

Ok.

I instaled it on header.

Can you please take a look.

Thank's one more time for your support!

6 Jan 2010, 5:10 PM
#12
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: CartSideboxWithButtonandFreeShipping - Multi language support?

I have done a bit of preliminary styling on the cartHeader. I need to know exactly what you want before doing more.
Replace the existing stylesheet code with this (some changes are highlighted in red):```
/Shoppingcart/Freeship in Header/
#logo {position: relative;}

#cartHeader {
width: 17em;
position: absolute;
top: 35.5em;
left: 36.5em;
background: #ffffff;
color: #000000;
border: 0px solid #888888;
}

#cartHeader h3 {
text-align: left;
font-size: 1.3em;
color: #ff6699;

}
#cartCount {
border-top: 1px solid #999999;
text-align: center;
}
#cartCount a {)
#cartTotal {}
#cartFreeShip {
margin: 0 0.3em;
}
#cartCheckout {
float: right;
margin: 0.3em;
}

6 Jan 2010, 11:59 PM
#13
jeet_kune_do avatar

jeet_kune_do

Zen Follower

Join Date:
Nov 2008
Location:
Slovenija
Posts:
119
Plugin Contributions:
0

Re: CartSideboxWithButtonandFreeShipping - Multi language support?

Great!

I liked.

I wish also that the text "Add €8.51 to your order
to qualify for Free Shipping!" to be in red and in one line, like the following:

Add €8.51 to your order to qualify for Free Shipping!

When I change languages, the table move. Can we correct that?

7 Jan 2010, 4:11 AM
#14
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: CartSideboxWithButtonandFreeShipping - Multi language support?

The box width is set at 17em; increase that to let the text fit on one line.```
#cartHeader {
width: 17em;

Add a color here:```
#cartFreeShip {
    margin: 0 0.3em;
    color: #ff0000;
    }

I will look at the language/shift issue later when I get back to my home computer.

7 Jan 2010, 4:16 AM
#15
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: CartSideboxWithButtonandFreeShipping - Multi language support?

You may need to remove a <br /> from the define for this text.

8 Jan 2010, 1:05 AM
#16
jeet_kune_do avatar

jeet_kune_do

Zen Follower

Join Date:
Nov 2008
Location:
Slovenija
Posts:
119
Plugin Contributions:
0

Re: CartSideboxWithButtonandFreeShipping - Multi language support?

I have also the slovenian language, wich don't have only singular and plurar.

Should be like that:

1 item in card- Izdelek
2 items in card- Izdelka
3 items in card- Izdelki
4 items in card- Izdelki
5 items in card- Izdelkov
6 items in card- Izdelkov
7 items in card- Izdelkov.......( and so on, the same)
.......................................
.......................................

I know I'm asking the moon, it's possible?

8 Jan 2010, 7:49 AM
#17
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: CartSideboxWithButtonandFreeShipping - Multi language support?

Yes, it would be possible to change the code in tpl_cart_header.php to account for all those different numbers (and then in English many of the different versions would have the same wording). I can look into that tomorrow. This would be a good time to move this discussion into the support thread for Shoppingcart/Freeship in Header.

5 Jun 2010, 3:52 PM
#18
doodlebuckets avatar

doodlebuckets

Totally Zenned

Join Date:
Jul 2005
Posts:
497
Plugin Contributions:
0

Re: CartSideboxWithButtonandFreeShipping - Multi language support?

I am using the cart sidebox with checkout button/free shipping here http://www.babygiftbasketstores.com/ The checkout button displays on the outside of the box when nothing is in the cart and messes up the boxes below it. My template designer says there must be a missing <div>. Can you take a look and see what might be wrong? Thanks!

7 Jun 2010, 1:44 PM
#19
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: CartSideboxWithButtonandFreeShipping - Multi language support?

Looks fine in Firefox and IE8. There is no missing div in that sidebox either.

7 Jun 2010, 1:58 PM
#20
doodlebuckets avatar

doodlebuckets

Totally Zenned

Join Date:
Jul 2005
Posts:
497
Plugin Contributions:
0

Re: CartSideboxWithButtonandFreeShipping - Multi language support?

gjh42:

Looks fine in Firefox and IE8. There is no missing div in that sidebox either.

Clyde Jones the magnificent found a /div in the wrong place and fixed it for me. So it does look fine now because of that... Thanks for the response though :)