Post by sopedro » Sat Jan 21, 2012 5:49 pm

Hi,

I did a little modifications to the \catalog\view\theme\default\template\product\product.tpl . basically this modification shows to the users the pecentage saved in quantity buy.

When the store is in English Language, the calculation it's fine, but when i change to Portuguese something happens because it shows a wrong value.

Please help, i'm very newbie to php

Here is the code:

Code: Select all

          <?php if ($price && $discounts): ?>

          <div id="product_discounts">
            <!--<h3><?php echo $this->document->shoppica_text_discount; ?></h3>-->
            <table width="100%" border="0" cellpadding="0" cellspacing="0">
             <!-- <tr>
                <th><?php echo $this->document->shoppica_text_order_quantity; ?></th>
                <th><?php echo $this->document->shoppica_text_price_per_item; ?></th>
              </tr> -->
              <?php foreach ($discounts as $discount): 
              $saving_value = $price - $discount['price'];
		      $saving = round(($saving_value/$price)*100, 0);
              ?>
              <tr>
                <td><?php echo $this->document->shoppica_text_buy; ?> <b><?php echo sprintf($this->document->shoppica_text_discount_items, $discount['quantity']); ?></b> <?php echo $this->document->shoppica_text_for; ?> <b><?php echo $discount['price']; ?></b> <?php echo $this->document->shoppica_text_each; ?> <b><?php echo $saving; ?>%</b></td>
              </tr>
              <?php endforeach; ?>
            </table>
          </div>
          <?php endif; ?>
Thanks,

Pedro

Newbie

Posts

Joined
Sat Jan 21, 2012 5:38 pm

Post by sopedro » Sat Jan 21, 2012 6:11 pm

solved! the problem is in the portuguese language file...i just chage the deciamal and the thousand points...:)

Newbie

Posts

Joined
Sat Jan 21, 2012 5:38 pm
Who is online

Users browsing this forum: No registered users and 7 guests