Fórum OpenCart Brasil

Por um e-commerce livre, confiável e profissional

Suporte geral sobre problemas técnicos para OpenCart v2.x.
#73069
Se estiver comentando do link no topo do site acesse o arquivo catalog/controller/common/header.php e faça as modificações abaixo; Se estiver utilizando um tema customizado os passos podem não servir;

Localize:
Código: Selecionar todos
$data['checkout'] = $this->url->link('checkout/checkout', '', true);
Substitua por:
Código: Selecionar todos
$data['checkout'] = $this->url->link('checkout/cart', '', true);
#73139
meck escreveu:Boa tarde Ariel, muito obrigado pela ajuda mas eu efetuei a modificação mas não funcionou. Eu uso o thema Journal. Teria alguma outra maneira?
minha loja http://www.mayasoul.com.br
Ola, @meck

Edite o arquivo cart.tpl da pasta commom dentro do journal.
Na linha que existe os 2 botões sendo um carrinho e outro checkout remova o carrinho e copie chamada do texto para o botão do carrinho.
ficando algo como:
Código: Selecionar todos
<p class="checkout">
<a class="button btn-block btn-lg" href="<?php echo $cart; ?>"><?php echo $text_checkout; ?></a>
</p>
ou para botão inteiro
Código: Selecionar todos
<p class="checkout">
<a class="button btn-block btn-lg btn-block" href="<?php echo $cart; ?>"><?php echo $text_checkout; ?></a>
</p>
:ugeek:
#73141
reds escreveu:
meck escreveu:Boa tarde Ariel, muito obrigado pela ajuda mas eu efetuei a modificação mas não funcionou. Eu uso o thema Journal. Teria alguma outra maneira?
minha loja http://www.mayasoul.com.br
Ola, @meck

Edite o arquivo cart.tpl da pasta commom dentro do journal.
Na linha que existe os 2 botões sendo um carrinho e outro checkout remova o carrinho e copie chamada do texto para o botão do carrinho.
ficando algo como:
Código: Selecionar todos
<p class="checkout">
<a class="button btn-block btn-lg" href="<?php echo $cart; ?>"><?php echo $text_checkout; ?></a>
</p>
ou para botão inteiro
Código: Selecionar todos
<p class="checkout">
<a class="button btn-block btn-lg btn-block" href="<?php echo $cart; ?>"><?php echo $text_checkout; ?></a>
</p>
:ugeek:
Não entendi. Onde adiciono isso em meu código do arquivo cart.tpl

meu código atualmente esta assim

<div id="cart" class="btn-group btn-block">
<button type="button" data-toggle="dropdown" class="btn btn-inverse btn-block btn-lg dropdown-toggle heading"><a><span id="cart-total" data-loading-text="<?php echo $text_loading; ?>&nbsp;&nbsp;"><?php echo $text_items; ?></span> <i></i></a></button>
<div class="content">
<ul class="cart-wrapper">
<?php if ($products || $vouchers) { ?>
<li class="mini-cart-info">
<table class="table table-striped">
<?php foreach ($products as $product) { ?>
<tr>
<td class="text-center image"><?php if ($product['thumb']) { ?>
<a href="<?php echo $product['href']; ?>"><img src="<?php echo $product['thumb']; ?>" alt="<?php echo $product['name']; ?>" title="<?php echo $product['name']; ?>" class="img-thumbnail" /></a>
<?php } ?></td>
<td class="text-left name"><a href="<?php echo $product['href']; ?>"><?php echo $product['name']; ?></a>
<div>
<?php if ($product['option']) { ?>
<?php foreach ($product['option'] as $option) { ?>
<br />
- <small><?php echo $option['name']; ?> <?php echo $option['value']; ?></small>
<?php } ?>
<?php } ?>
<?php if ($product['recurring']) { ?>
<br />
- <small><?php echo $text_recurring; ?> <?php echo $product['recurring']; ?></small>
<?php } ?></div>
</td>
<td class="text-right quantity">x <?php echo $product['quantity']; ?></td>
<td class="text-right total"><?php echo $product['total']; ?></td>
<td class="text-center remove"><button type="button" onclick="cart.remove('<?php echo $product[version_compare(VERSION, '2.1', '<') ? 'key' : 'cart_id']; ?>');" title="<?php echo $button_remove; ?>" class=""><i class=""></i></button></td>
</tr>
<?php } ?>
<?php foreach ($vouchers as $voucher) { ?>
<tr>
<td class="text-center"></td>
<td class="text-left name"><?php echo $voucher['description']; ?></td>
<td class="text-right quantity">x&nbsp;1</td>
<td class="text-right total"><?php echo $voucher['amount']; ?></td>
<td class="text-center remove"><button type="button" onclick="voucher.remove('<?php echo $voucher['key']; ?>');" title="<?php echo $button_remove; ?>" class=""><i class=""></i></button></td>
</tr>
<?php } ?>
</table>
</li>
<li>
<div class="mini-cart-total">
<table class="table table-bordered">
<?php foreach ($totals as $total) { ?>
<tr>
<td class="text-right right"><strong><?php echo $total['title']; ?></strong></td>
<td class="text-right right"><?php echo $total['text']; ?></td>
</tr>
<?php } ?>
</table>
<p class="text-right checkout"><a class="button" href="<?php echo $cart; ?>"><?php echo $text_cart; ?></a>&nbsp;<a class="button" href="<?php echo $checkout; ?>"><?php echo $text_checkout; ?></a></p>
</div>
</li>
<?php } else { ?>
<li>
<p class="text-center empty"><?php echo $text_empty; ?></p>
</li>
<?php } ?>
</ul>
</div>
</div>
#73142
Ola, na +- na linha 52 você tem o paragrafo que contem 2 botões, apenas troque pela sugestão acima, algo como abaixo.

Seu código:
Código: Selecionar todos
<div id="cart" class="btn-group btn-block">
	<button type="button" data-toggle="dropdown" class="btn btn-inverse btn-block btn-lg dropdown-toggle heading"><a><span id="cart-total" data-loading-text="<?php echo $text_loading; ?>&nbsp;&nbsp;"><?php echo $text_items; ?></span> <i></i></a></button>
	<div class="content">
		<ul class="cart-wrapper">
			<?php if ($products || $vouchers) { ?>
				<li class="mini-cart-info">
					<table class="table table-striped">
						<?php foreach ($products as $product) { ?>
							<tr>
								<td class="text-center image"><?php if ($product['thumb']) { ?>
									<a href="<?php echo $product['href']; ?>"><img src="<?php echo $product['thumb']; ?>" alt="<?php echo $product['name']; ?>" title="<?php echo $product['name']; ?>" class="img-thumbnail" /></a>
								<?php } ?></td>
								<td class="text-left name"><a href="<?php echo $product['href']; ?>"><?php echo $product['name']; ?></a>
									<div>
										<?php if ($product['option']) { ?>
											<?php foreach ($product['option'] as $option) { ?>
												<br />
												- <small><?php echo $option['name']; ?> <?php echo $option['value']; ?></small>
											<?php } ?>
										<?php } ?>
										<?php if ($product['recurring']) { ?>
											<br />
											- <small><?php echo $text_recurring; ?> <?php echo $product['recurring']; ?></small>
										<?php } ?></div>
								</td>
								<td class="text-right quantity">x <?php echo $product['quantity']; ?></td>
								<td class="text-right total"><?php echo $product['total']; ?></td>
								<td class="text-center remove"><button type="button" onclick="cart.remove('<?php echo $product[version_compare(VERSION, '2.1', '<') ? 'key' : 'cart_id']; ?>');" title="<?php echo $button_remove; ?>" class=""><i class=""></i></button></td>
							</tr>
						<?php } ?>
						<?php foreach ($vouchers as $voucher) { ?>
							<tr>
								<td class="text-center"></td>
								<td class="text-left name"><?php echo $voucher['description']; ?></td>
								<td class="text-right quantity">x&nbsp;1</td>
								<td class="text-right total"><?php echo $voucher['amount']; ?></td>
								<td class="text-center remove"><button type="button" onclick="voucher.remove('<?php echo $voucher['key']; ?>');" title="<?php echo $button_remove; ?>" class=""><i class=""></i></button></td>
							</tr>
						<?php } ?>
					</table>
				</li>
				<li>
					<div class="mini-cart-total">
						<table class="table table-bordered">
							<?php foreach ($totals as $total) { ?>
								<tr>
									<td class="text-right right"><strong><?php echo $total['title']; ?></strong></td>
									<td class="text-right right"><?php echo $total['text']; ?></td>
								</tr>
							<?php } ?>
						</table>
						<p class="text-right checkout"><a class="button" href="<?php echo $cart; ?>"><?php echo $text_cart; ?></a>&nbsp;<a class="button" href="<?php echo $checkout; ?>"><?php echo $text_checkout; ?></a></p>
					</div>
				</li>
				<?php } else { ?>
				<li>
					<p class="text-center empty"><?php echo $text_empty; ?></p>
				</li>
			<?php } ?>
		</ul>
	</div>
</div>
Código modelo 1
Código: Selecionar todos
<div id="cart" class="btn-group btn-block">
	<button type="button" data-toggle="dropdown" class="btn btn-inverse btn-block btn-lg dropdown-toggle heading"><a><span id="cart-total" data-loading-text="<?php echo $text_loading; ?>&nbsp;&nbsp;"><?php echo $text_items; ?></span> <i></i></a></button>
	<div class="content">
		<ul class="cart-wrapper">
			<?php if ($products || $vouchers) { ?>
				<li class="mini-cart-info">
					<table class="table table-striped">
						<?php foreach ($products as $product) { ?>
							<tr>
								<td class="text-center image"><?php if ($product['thumb']) { ?>
									<a href="<?php echo $product['href']; ?>"><img src="<?php echo $product['thumb']; ?>" alt="<?php echo $product['name']; ?>" title="<?php echo $product['name']; ?>" class="img-thumbnail" /></a>
								<?php } ?></td>
								<td class="text-left name"><a href="<?php echo $product['href']; ?>"><?php echo $product['name']; ?></a>
									<div>
										<?php if ($product['option']) { ?>
											<?php foreach ($product['option'] as $option) { ?>
												<br />
												- <small><?php echo $option['name']; ?> <?php echo $option['value']; ?></small>
											<?php } ?>
										<?php } ?>
										<?php if ($product['recurring']) { ?>
											<br />
											- <small><?php echo $text_recurring; ?> <?php echo $product['recurring']; ?></small>
										<?php } ?></div>
								</td>
								<td class="text-right quantity">x <?php echo $product['quantity']; ?></td>
								<td class="text-right total"><?php echo $product['total']; ?></td>
								<td class="text-center remove"><button type="button" onclick="cart.remove('<?php echo $product[version_compare(VERSION, '2.1', '<') ? 'key' : 'cart_id']; ?>');" title="<?php echo $button_remove; ?>" class=""><i class=""></i></button></td>
							</tr>
						<?php } ?>
						<?php foreach ($vouchers as $voucher) { ?>
							<tr>
								<td class="text-center"></td>
								<td class="text-left name"><?php echo $voucher['description']; ?></td>
								<td class="text-right quantity">x&nbsp;1</td>
								<td class="text-right total"><?php echo $voucher['amount']; ?></td>
								<td class="text-center remove"><button type="button" onclick="voucher.remove('<?php echo $voucher['key']; ?>');" title="<?php echo $button_remove; ?>" class=""><i class=""></i></button></td>
							</tr>
						<?php } ?>
					</table>
				</li>
				<li>
					<div class="mini-cart-total">
						<table class="table table-bordered">
							<?php foreach ($totals as $total) { ?>
								<tr>
									<td class="text-right right"><strong><?php echo $total['title']; ?></strong></td>
									<td class="text-right right"><?php echo $total['text']; ?></td>
								</tr>
							<?php } ?>
						</table>
						<p class="checkout">
							<a class="button btn-block btn-lg" href="<?php echo $cart; ?>"><?php echo $text_checkout; ?></a>
						</p>
					</div>
				</li>
				<?php } else { ?>
				<li>
					<p class="text-center empty"><?php echo $text_empty; ?></p>
				</li>
			<?php } ?>
		</ul>
	</div>
</div>
Código modelo 2:
Código: Selecionar todos
<div id="cart" class="btn-group btn-block">
	<button type="button" data-toggle="dropdown" class="btn btn-inverse btn-block btn-lg dropdown-toggle heading"><a><span id="cart-total" data-loading-text="<?php echo $text_loading; ?>&nbsp;&nbsp;"><?php echo $text_items; ?></span> <i></i></a></button>
	<div class="content">
		<ul class="cart-wrapper">
			<?php if ($products || $vouchers) { ?>
				<li class="mini-cart-info">
					<table class="table table-striped">
						<?php foreach ($products as $product) { ?>
							<tr>
								<td class="text-center image"><?php if ($product['thumb']) { ?>
									<a href="<?php echo $product['href']; ?>"><img src="<?php echo $product['thumb']; ?>" alt="<?php echo $product['name']; ?>" title="<?php echo $product['name']; ?>" class="img-thumbnail" /></a>
								<?php } ?></td>
								<td class="text-left name"><a href="<?php echo $product['href']; ?>"><?php echo $product['name']; ?></a>
									<div>
										<?php if ($product['option']) { ?>
											<?php foreach ($product['option'] as $option) { ?>
												<br />
												- <small><?php echo $option['name']; ?> <?php echo $option['value']; ?></small>
											<?php } ?>
										<?php } ?>
										<?php if ($product['recurring']) { ?>
											<br />
											- <small><?php echo $text_recurring; ?> <?php echo $product['recurring']; ?></small>
										<?php } ?></div>
								</td>
								<td class="text-right quantity">x <?php echo $product['quantity']; ?></td>
								<td class="text-right total"><?php echo $product['total']; ?></td>
								<td class="text-center remove"><button type="button" onclick="cart.remove('<?php echo $product[version_compare(VERSION, '2.1', '<') ? 'key' : 'cart_id']; ?>');" title="<?php echo $button_remove; ?>" class=""><i class=""></i></button></td>
							</tr>
						<?php } ?>
						<?php foreach ($vouchers as $voucher) { ?>
							<tr>
								<td class="text-center"></td>
								<td class="text-left name"><?php echo $voucher['description']; ?></td>
								<td class="text-right quantity">x&nbsp;1</td>
								<td class="text-right total"><?php echo $voucher['amount']; ?></td>
								<td class="text-center remove"><button type="button" onclick="voucher.remove('<?php echo $voucher['key']; ?>');" title="<?php echo $button_remove; ?>" class=""><i class=""></i></button></td>
							</tr>
						<?php } ?>
					</table>
				</li>
				<li>
					<div class="mini-cart-total">
						<table class="table table-bordered">
							<?php foreach ($totals as $total) { ?>
								<tr>
									<td class="text-right right"><strong><?php echo $total['title']; ?></strong></td>
									<td class="text-right right"><?php echo $total['text']; ?></td>
								</tr>
							<?php } ?>
						</table>
						<p class="checkout">
							<a class="button btn-block btn-lg btn-block" href="<?php echo $cart; ?>"><?php echo $text_checkout; ?></a>
						</p>
					</div>
				</li>
				<?php } else { ?>
				<li>
					<p class="text-center empty"><?php echo $text_empty; ?></p>
				</li>
			<?php } ?>
		</ul>
	</div>
</div>
:ugeek:
#85804
Boa tarde a todos.

Tenho uma Opencart 2.032 (gabypresentes.com.br), li vários tutoriais e dicas, mas estou apanhando muito, achei a extensão http://gaby.ml/extension que me ajudou em partes.

Gostaria que o cliente fosse direto para o Checkout ao clicar no botão comprar, mas não estou conseguindo, abre uma janelinha e é necessário clicar nela para finalizar, já estando dentro do produto ao clicar em comprar a janela abre mas redireciona para o Checkout como desejo.

Alguém pode me dar uma luz ?

Obrigado.

Gente preciso de ajuda urgente. Na migraç&a[…]

Caro @reds , muito obrigado pela resposta.

PHP 8+ incompatibilidade

Toda tradução para a versão 3[…]

Ola @alex3257 Se você precisa apenas ver […]