Página 1 de 1

Aviso restante para atingir o necessário p/ FRETE Grátis

Enviado: 07 Nov 2013, 12:25
por linktraba
Olá!
Estou tentando utilizar este módulo: http://www.opencart.com/index.php?route ... ifier-v2-1

Quando atinge o valor X configurado por mim na área administrativa, executa a função correta referente ao frete grátis, porém o texto que aparece é a variável:
text_freeshippingyes
Imagem

Quando está faltando X para atingir o frete grátis:
Imagem

Segue o código do XML:
Código: Selecionar todos
<modification>
	<id><![CDATA[free shipping qualifier-test]]></id>
	<version><![CDATA[2.0]]></version>
	<vqmver><![CDATA[2.1.7]]></vqmver>
	<author><![CDATA[]]></author>
	<file name="catalog/view/theme/*/template/checkout/cart.tpl">
		<operation>
			<search position="after" error="log"><![CDATA[<div class="cart-info">]]></search>
			<add><![CDATA[<div class="<?php echo $div_class; ?>">
<?php if (isset($freeshippingnote)) {echo $freeshippingnote;} ?>
<img src="catalog/view/theme/*/image/close.png" alt="" class="close" />
</div> ]]></add>
		</operation>
	</file>
	<file name="catalog/language/english/checkout/cart.php">
		<operation>
			<search position="after" error="log"><![CDATA[$_['text_empty'] = 'Your shopping cart is empty!';]]></search>
			<add><![CDATA[$_['text_freeshippingno']  = 'The Sub-Total is <span style="color: #df1d2a;">%s</span>. Spend <span style="color: #df1d2a;">%s</span> more to be qualified for Free Shipping!';

$_['text_freeshippingyes'] = 'You are qualified for Free Shipping!';

]]></add>
		</operation>
		<operation>
			<search position="replace"><![CDATA[$_['text_success']  = 'Success: You have added <a href="%s">%s</a> to your <a href="%s">shopping cart</a>!';]]></search>
			<add><![CDATA[$_['text_success']  = 'Success: You have added <a href="%s">%s</a> to your <a href="%s">shopping cart</a>!&nbsp;&nbsp;%s';]]></add>
		</operation>
	</file>
	<file name="catalog/controller/checkout/cart.php">
		<operation>
			<search position="after" error="log"><![CDATA[$this->data['button_checkout'] = $this->language->get('button_checkout');]]></search>
			<add><![CDATA[if ($this->cart->getSubTotal() < $this->config->get('free_total')) {
			$this->data['div_class'] = 'attention';	
			$addmoney = $this->config->get('free_total') - $this->cart->getSubTotal();
			$this->data['freeshippingnote'] = sprintf($this->language->get('text_freeshippingno'),$this->currency->format($this->cart->getSubTotal()), $this->currency->format($addmoney));
		}
else  {	
			$this->data['div_class'] = 'success';	
			$this->data['freeshippingnote'] = $this->language->get('text_freeshippingyes');
		}

]]></add>
		</operation>
		<operation>
			<search position="replace"><![CDATA[$json['success'] = sprintf($this->language->get('text_success'), $this->url->link('product/product', 'product_id=' . $this->request->post['product_id']), $product_info['name'], $this->url->link('checkout/cart'));]]></search>
			<add><![CDATA[if ($this->cart->getSubTotal() < $this->config->get('free_total')) {
			$addmoney = $this->config->get('free_total') - $this->cart->getSubTotal();
			$freeshippingnote = sprintf($this->language->get('text_freeshippingno'),$this->currency->format($this->cart->getSubTotal()), $this->currency->format($addmoney));
		}
else  {	
			$freeshippingnote = $this->language->get('text_freeshippingyes');
		}



$json['success'] = sprintf($this->language->get('text_success'), $this->url->link('product/product', 'product_id=' . $this->request->post['product_id']), $product_info['name'], $this->url->link('checkout/cart'),$freeshippingnote);]]></add>
		</operation>
	</file>
</modification>
Testei este também: http://www.opencart.com/index.php?route ... ifier-v2-1
Código: Selecionar todos
<modification>
    <id>Add Free Shipping Alert</id>
    <version>1</version>
    <vqmver>2.3.2</vqmver>
    <author>Andrei Bogdan (andrei.opencart@yahoo.com)</author>
	<!-- template -->
	<file name="catalog/view/theme/*/template/checkout/shipping_method.tpl">
		<operation>
			<search position="before"><![CDATA[<b><?php echo $text_comments; ?></b>]]></search>
			<add><![CDATA[
				<?php if ($alert) { ?>
				<div class="attention">
					<?php echo $alert; ?>
				</div>
				<?php } ?>
				<?php if ($notify) { ?>
				<div class="success">
					<?php echo $notify; ?>
				</div>
				<?php } ?>
				<br />
			]]></add>
		</operation>
	</file>
	<file name="catalog/view/theme/*/template/checkout/cart.tpl">
		<operation>
			<search position="before"><![CDATA[<div class="cart-total">]]></search>
			<add><![CDATA[
				<?php if ($alert) { ?>
				<div class="attention">
					<?php echo $alert; ?>
				</div>
				<?php } ?>
				<?php if ($notify) { ?>
				<div class="success">
					<?php echo $notify; ?>
				</div>
				<?php } ?>
				<br />
			]]></add>
		</operation>
	</file>
	<!-- language -->
	<file name="catalog/language/english/checkout/checkout.php">
		<operation>
			<search position="after"><![CDATA[$_['text_checkout_shipping_method']  = 'Step 4: Delivery Method';]]></search>
			<add><![CDATA[
				$_['text_alert']                     = 'You can enjoy Free Shipping for an ordered amount of at least <strong>%s</strong>.<br />You only need to order for <strong>%s</strong> more and you will qualify for Free Shipping!';
				$_['text_notify']					 = 'Your ordered amount is larger than <strong>%s</strong>.<br /> You are qualified for Free Shipping.';
			]]></add>
		</operation>
	</file>
	<file name="catalog/language/english/checkout/cart.php">
		<operation>
			<search position="after"><![CDATA[$_['heading_title']          = 'Shopping Cart';]]></search>
			<add><![CDATA[
				$_['text_alert']                     = 'You can enjoy Free Shipping for an ordered amount of at least <strong>%s</strong>.<br />You only need to order for <strong>%s</strong> more and you will qualify for Free Shipping!';
				$_['text_notify']					 = 'Your ordered amount is larger than <strong>%s</strong>.<br /> You are qualified for Free Shipping.';
			]]></add>
		</operation>
	</file>
	<!-- controller -->
    <file name="catalog/controller/checkout/cart.php">
        <operation>
            <search position="after"><![CDATA[
				$this->data['totals'] = $total_data;
            ]]></search>
            <add><![CDATA[
				if( $this->cart->getSubTotal() < $this->config->get('free_total') ) {
					$diff = (float)($this->config->get('free_total') - $this->cart->getSubTotal());
				} else {
					$diff = (float)($this->cart->getSubTotal() - $this->config->get('free_total'));
				}
				if ($this->cart->getSubTotal() < $this->config->get('free_total')) {
					$this->data['notify'] = false;
					$this->data['alert'] = sprintf( $this->language->get('text_alert'), $this->currency->format($this->config->get('free_total'),false,false), $this->currency->format($diff,false,false) );
					
				} else {
					$this->data['alert'] = false;
					$this->data['notify'] = sprintf(  $this->language->get('text_notify'), $this->currency->format($this->config->get('free_total'),false,false) );
				}
            ]]></add>
        </operation>
    </file>
	<file name="catalog/controller/checkout/shipping_method.php">
		<operation>
			<search position="before"><![CDATA[
				$this->data['button_continue'] = $this->language->get('button_continue');
			]]></search>
			<add><![CDATA[
				if( $this->cart->getSubTotal() < $this->config->get('free_total') ) {
					$diff = (float)($this->config->get('free_total') - $this->cart->getSubTotal());
				} else {
					$diff = (float)($this->cart->getSubTotal() - $this->config->get('free_total'));
				}
				if ($this->cart->getSubTotal() < $this->config->get('free_total')) {
					$this->data['notify'] = false;
					$this->data['alert'] = sprintf( $this->language->get('text_alert'), $this->currency->format($this->config->get('free_total'),false,false), $this->currency->format($diff,false,false) );
					
				} else {
					$this->data['alert'] = false;
					$this->data['notify'] = sprintf(  $this->language->get('text_notify'), $this->currency->format($this->config->get('free_total'),false,false) );
				}
			]]></add>
		</operation>
	</file>
</modification>
E deu o mesmo erro.

Alguém sabe como resolver?
Aparecer as mensagens corretamente.

Obrigado pela atenção

Re: Aviso restante para atingir o necessário p/ FRETE Grátis

Enviado: 07 Nov 2013, 19:55
por AllexWesley
Eu estou usando esse módulo e aqui não deu erro nenhum você usa algum tema qual se usar? e coloque os erros que estão dando na sua loja para ficar mais fácil.

Re: Aviso restante para atingir o necessário p/ FRETE Grátis

Enviado: 07 Nov 2013, 20:15
por linktraba
Olá AllexWesley, agradeço por responder, estou mexendo no segundo código, achei mais interessante.
Acontece assim, se utilizo a versão padrão em english aparecem as variáveis em vez das mensagens:
Quando atinge o valor que aprova o frete grátis:
text_notify
Quando não atinge o valor de aprovação:
text_alert

Quando configurei a loja com o tema padrão english o código funcionou normalmente.

No tema default acontece a mesma coisa.

Você modificou algo em seu arquivo?

Modifiquei o código romana, com a linguagem em portuguese-br para tentar adequar, mas nem o erro apareceu, ficou em branco como se estivesse sem o módulo, fiz o mesmo com os outros códigos: english e italian, também sem sucesso.
Código: Selecionar todos
modification>
    <id>Add Free Shipping Alert</id>
    <version>1</version>
    <vqmver>2.3.2</vqmver>
    <author>Andrei Bogdan (andrei.opencart@yahoo.com)</author>
	<!-- template -->
	<file name="catalog/view/theme/*/template/checkout/shipping_method.tpl">
		<operation>
			<search position="before"><![CDATA[<b><?php echo $text_comments; ?></b>]]></search>
			<add><![CDATA[
				<?php if ($alert) { ?>
				<div class="attention">
					<?php echo $alert; ?>
				</div>
				<?php } ?>
				<?php if ($notify) { ?>
				<div class="success">
					<?php echo $notify; ?>
				</div>
				<?php } ?>
				<br />
			]]></add>
		</operation>
	</file>
	<file name="catalog/view/theme/*/template/checkout/cart.tpl">
		<operation>
			<search position="before"><![CDATA[<div class="cart-total">]]></search>
			<add><![CDATA[
				<?php if ($alert) { ?>
				<div class="attention">
					<?php echo $alert; ?>
				</div>
				<?php } ?>
				<?php if ($notify) { ?>
				<div class="success">
					<?php echo $notify; ?>
				</div>
				<?php } ?>
				<br />
			]]></add>
		</operation>
	</file>
	<!-- language -->
	<file name="catalog/language/portuguese-br/checkout/checkout.php">
		<operation>
			<search position="after"><![CDATA[$_['text_checkout_shipping_method']  = 'Step 4: Delivery Method';]]></search>
			<add><![CDATA[
				$_['text_alert']                     = 'Puteti beneficia de transport gratuit pentru sume mai mari de <strong>%s</strong>. <br />Mai trebuie sa comandati de <strong>%s</strong> pentru a beneficia de transport gratuit.';
				$_['text_notify']					 = 'Comanda dvs este mai mare de <strong>%s</strong>. Veti beneficia de transport gratuit.';
			]]></add>
		</operation>
	</file>
	<file name="catalog/language/portuguese-br/checkout/cart.php">
		<operation>
			<search position="after"><![CDATA[$_['heading_title']          = 'Shopping Cart';]]></search>
			<add><![CDATA[
				$_['text_alert']                     = 'You can enjoy Free Shipping for an ordered amount of at least <strong>%s</strong>.<br />You only need to order for <strong>%s</strong> more and you will qualify for Free Shipping!';
				$_['text_notify']					 = 'Your ordered amount is larger than <strong>%s</strong>.<br /> You are qualified for Free Shipping.';
			]]></add>
		</operation>
	</file>
	<!-- controller -->
    <file name="catalog/controller/checkout/cart.php">
        <operation>
            <search position="after"><![CDATA[
				$this->data['totals'] = $total_data;
            ]]></search>
            <add><![CDATA[
				if( $this->cart->getSubTotal() < $this->config->get('free_total') ) {
					$diff = (float)($this->config->get('free_total') - $this->cart->getSubTotal());
				} else {
					$diff = (float)($this->cart->getSubTotal() - $this->config->get('free_total'));
				}
				if ($this->cart->getSubTotal() < $this->config->get('free_total')) {
					$this->data['notify'] = false;
					$this->data['alert'] = sprintf( $this->language->get('text_alert'), $this->currency->format($this->config->get('free_total'),false,false), $this->currency->format($diff,false,false) );
					
				} else {
					$this->data['alert'] = false;
					$this->data['notify'] = sprintf(  $this->language->get('text_notify'), $this->currency->format($this->config->get('free_total'),false,false) );
				}
            ]]></add>
        </operation>
    </file>
	<file name="catalog/controller/checkout/shipping_method.php">
		<operation>
			<search position="before"><![CDATA[
				$this->data['button_continue'] = $this->language->get('button_continue');
			]]></search>
			<add><![CDATA[
				if( $this->cart->getSubTotal() < $this->config->get('free_total') ) {
					$diff = (float)($this->config->get('free_total') - $this->cart->getSubTotal());
				} else {
					$diff = (float)($this->cart->getSubTotal() - $this->config->get('free_total'));
				}
				if ($this->cart->getSubTotal() < $this->config->get('free_total')) {
					$this->data['notify'] = false;
					$this->data['alert'] = sprintf( $this->language->get('text_alert'), $this->currency->format($this->config->get('free_total'),false,false), $this->currency->format($diff,false,false) );
					
				} else {
					$this->data['alert'] = false;
					$this->data['notify'] = sprintf(  $this->language->get('text_notify'), $this->currency->format($this->config->get('free_total'),false,false) );
				}
			]]></add>
		</operation>
	</file>
</modification>

Re: Aviso restante para atingir o necessário p/ FRETE Grátis

Enviado: 07 Nov 2013, 22:36
por AllexWesley
Mudei sim coloquei para o VQmod procurar em as tag da tradução em pt-br.
Código: Selecionar todos
<modification>
    <id>Add Free Shipping Alert</id>
    <version>1</version>
    <vqmver>2.3.2</vqmver>
    <author>Andrei Bogdan (andrei.opencart@yahoo.com)</author>
   <!-- template -->
   <file name="catalog/view/theme/*/template/checkout/shipping_method.tpl">
      <operation>
         <search position="before"><![CDATA[<b><?php echo $text_comments; ?></b>]]></search>
         <add><![CDATA[
            <?php if ($alert) { ?>
            <div class="attention">
               <?php echo $alert; ?>
            </div>
            <?php } ?>
            <?php if ($notify) { ?>
            <div class="success">
               <?php echo $notify; ?>
            </div>
            <?php } ?>
            <br />
         ]]></add>
      </operation>
   </file>
   <file name="catalog/view/theme/*/template/checkout/cart.tpl">
      <operation>
         <search position="before"><![CDATA[<div class="cart-total">]]></search>
         <add><![CDATA[
            <?php if ($alert) { ?>
            <div class="attention">
               <?php echo $alert; ?>
            </div>
            <?php } ?>
            <?php if ($notify) { ?>
            <div class="success">
               <?php echo $notify; ?>
            </div>
            <?php } ?>
            <br />
         ]]></add>
      </operation>
   </file>
   <!-- language -->
   <file name="catalog/language/*/checkout/checkout.php">
      <operation>
         <search position="after"><![CDATA[$_['text_shipping_method']   = 'Escolha o método de entrega que deseja para este pedido.';]]></search>
         <add><![CDATA[
            $_['text_alert']                     = 'Puteti beneficia de transport gratuit pentru sume mai mari de <strong>%s</strong>. <br />Mai trebuie sa comandati de <strong>%s</strong> pentru a beneficia de transport gratuit.';
            $_['text_notify']                = 'Comanda dvs este mai mare de <strong>%s</strong>. Veti beneficia de transport gratuit.';
         ]]></add>
      </operation>
   </file>
   <file name="catalog/language/*/checkout/cart.php">
      <operation>
         <search position="after"><![CDATA[$_['heading_title']          = 'Meu Carrinho';]]></search>
         <add><![CDATA[
            $_['text_alert']                     = 'You can enjoy Free Shipping for an ordered amount of at least <strong>%s</strong>.<br />You only need to order for <strong>%s</strong> more and you will qualify for Free Shipping!';
            $_['text_notify']                = 'Your ordered amount is larger than <strong>%s</strong>.<br /> You are qualified for Free Shipping.';
         ]]></add>
      </operation>
   </file>
   <!-- controller -->
    <file name="catalog/controller/checkout/cart.php">
        <operation>
            <search position="after"><![CDATA[
            $this->data['totals'] = $total_data;
            ]]></search>
            <add><![CDATA[
            if( $this->cart->getSubTotal() < $this->config->get('free_total') ) {
               $diff = (float)($this->config->get('free_total') - $this->cart->getSubTotal());
            } else {
               $diff = (float)($this->cart->getSubTotal() - $this->config->get('free_total'));
            }
            if ($this->cart->getSubTotal() < $this->config->get('free_total')) {
               $this->data['notify'] = false;
               $this->data['alert'] = sprintf( $this->language->get('text_alert'), $this->currency->format($this->config->get('free_total'),false,false), $this->currency->format($diff,false,false) );
               
            } else {
               $this->data['alert'] = false;
               $this->data['notify'] = sprintf(  $this->language->get('text_notify'), $this->currency->format($this->config->get('free_total'),false,false) );
            }
            ]]></add>
        </operation>
    </file>
   <file name="catalog/controller/checkout/shipping_method.php">
      <operation>
         <search position="before"><![CDATA[
            $this->data['button_continue'] = $this->language->get('button_continue');
         ]]></search>
         <add><![CDATA[
            if( $this->cart->getSubTotal() < $this->config->get('free_total') ) {
               $diff = (float)($this->config->get('free_total') - $this->cart->getSubTotal());
            } else {
               $diff = (float)($this->cart->getSubTotal() - $this->config->get('free_total'));
            }
            if ($this->cart->getSubTotal() < $this->config->get('free_total')) {
               $this->data['notify'] = false;
               $this->data['alert'] = sprintf( $this->language->get('text_alert'), $this->currency->format($this->config->get('free_total'),false,false), $this->currency->format($diff,false,false) );
               
            } else {
               $this->data['alert'] = false;
               $this->data['notify'] = sprintf(  $this->language->get('text_notify'), $this->currency->format($this->config->get('free_total'),false,false) );
            }
         ]]></add>
      </operation>
   </file>
</modification>

Re: Aviso restante para atingir o necessário p/ FRETE Grátis

Enviado: 07 Nov 2013, 23:04
por linktraba
Simplesmente perfeito, obrigado pela dica, funcionou certinho, abraço e boa sorte