Jump to content

 

deepxtz

Member Since 18 Feb 2015
Offline Last Active Nov 25 2019 03:25 PM
-----

Posts I've Made

In Topic: Change Font Size After Decimal Point

16 December 2018 - 10:04 PM

Everything works perfectly now 

 

 

Thank you very much for everything!!!!


In Topic: Change Font Size After Decimal Point

15 December 2018 - 02:50 PM

error_log

PHP Fatal error:  Uncaught Error: Class 'Registry' not found in /app/addons/my_changes/func.php:21
Stack trace:
#0 /app/lib/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatebase.php(157) : eval()'d code(70): my_format_price('169.00', Array, ' id="sec_list_p...', ' class="ty-list...', true, NULL, NULL)
#1 /app/lib/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatebase.php(188): content_5c151242d39aa9_78620175(Object(Smarty_Internal_Template))
#2 /app/lib/vendor/smarty/smarty/libs/sysplugins/smarty_internal_template.php(304): Smarty_Internal_TemplateBase->fetch(Object(Smarty_Internal_Template), NULL, NULL, NULL, false, false, true)
#3 /app/lib/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatebase.php(157) : eval()'d code(1674): Smarty_Internal_Template->getSubTemplate('common/price.tp...', NULL, NULL, 0, NULL, Array, 0)
#4 /app/addons/my_changes/func.php on line 21

Inspecting gives me the same error

 

func.php:21

if( registry::get('runtime.customization_mode.live_editor') && !empty($live_editor_name) ) {
    $live_editor_attrs = 'data-ca-live-editor-obj="' . $live_editor_name . '"';
  }

Thank you very very much !


In Topic: Change Font Size After Decimal Point

14 December 2018 - 02:24 PM

I have overridden the common/price.tpl in:

 

design/themes/energot/templates/addons/my_changes/overrides/common/price.tpl

and

design/backend/templates/addons/my_changes/overrides/common/price.tpl

 

I have added

<!-- override price.tpl -->

And I see it when I`m inspecting.

 

Next, I made 

 

app/addons/my_changes/func.php and then added:

<?php

function my_format_price($price, $currency, $span_id='', $class='', $is_secondary=false, $live_editor_name='') {
 
  $value = fn_format_rate_value($price, 'F', $currency['decimals'], $currency['decimals_separator'],
  $currency['thousands_separator'], $currency['coefficient']);
  /* Set this to the class name you want to use to format numbers to the right of the decimal */
  $decimal_class = 'my-decimal-class';
  $pieces = explode($currency['decimals_separator'], $value);
  // This is the real modification to the code
  if( count($pieces) == 2 ) {
    $value = $pieces[0] . '<span class="' . $decimal_class . '">' . $pieces[1] . '</span>';
  }
 
  if( !empty($span_id) && $is_secondary ) {
    $span_id = 'sec_'.$span_id;
  }
  $span_id = !empty($span_id) ? (' id="' . $span_id . '"') : '';
  $class = !empty($class) ? (' class="' . $class . '"') : '';
  $live_editor_attrs = '';
  if( Registry::get('runtime.customization_mode.live_editor') && !empty($live_editor_name) ) {
    $live_editor_attrs = 'data-ca-live-editor-obj="' . $live_editor_name . '"';
  }
  if( $class ) {
    $currency['symbol'] = '<span ' . $class . '>' . $currency['symbol'] . '</span>';
  }
  $data = array( '<span' . $span_id . $class . $live_editor_attrs . '>',
     $value,
    '</span>'
    );
  if( $currency['after'] == 'Y' ) {
    array_push($data, '&nbsp;' . $currency['symbol']);
  } else {
    array_unshift($data, $currency['symbol']);
  }
  return implode('', $data);
}

Then I go again to the overridden price.tpl in:

 

design/themes/energot/templates/addons/my_changes/overrides/common/price.tpl

and

design/backend/templates/addons/my_changes/overrides/common/price.tpl

 

and changed format_price with my_format_prices like this:

<!-- override price.tpl -->
{strip}
{if $settings.General.alternative_currency == "use_selected_and_alternative"}
    {$value|my_format_price:$currencies.$primary_currency:$span_id:$class:false:$live_editor_name:$live_editor_phrase nofilter}
    {if $secondary_currency != $primary_currency}
        &nbsp;
        {if $class}<span class="{$class}">{/if}
        (
        {if $class}</span>{/if}
            <bdi>{$value|my_format_price:$currencies.$secondary_currency:$span_id:$class:true:$is_integer:$live_editor_name:$live_editor_phrase nofilter}</bdi>
        {if $class}<span class="{$class}">{/if}
        )
        {if $class}</span>{/if}
    {/if}
{else}
    <bdi>{$value|my_format_price:$currencies.$secondary_currency:$span_id:$class:true:$live_editor_name:$live_editor_phrase nofilter}</bdi>
{/if}
{/strip}

I added the css:

  .my-decimal-class { font-size: 70%; vertical-align: top; color:red;}

I have cleared the cache, manually and with ?cc&ctpl

And The Problem is that on the storefront I receive Service unavailable, sorry services is temporarily unavailable.

 

 

What am I doing wrong?

 

 

Thank you very much for the help!

 

 


In Topic: Change Font Size After Decimal Point

12 December 2018 - 07:51 PM

Attach

 

thank you


In Topic: Meet Cs-Cart And Multi-Vendor 4.8.1

17 July 2018 - 10:33 AM

v.4.8.2 ?

 

maybe let it out.