Buongiorno,
magento 2.2.3 avrei bisogno di modificare il link del pulsante "Continua gli acquisti" dopo l'ordine. Attualmente si viene reindirizzati alla homepage che prevede il reinserimento dei dati di login. Ho copiato il file success.phtml nel tema che uso e provato a modificare il link ma senza successo
<div class="primary"> <a class="action primary continue" href="<?= /* @escapeNotVerified */ $block->getContinueUrl('https://lacommerciale.biz/start') ?>"><span><?= /* @escapeNotVerified */ __('Continue Shopping') ?></span></a> </div>
potreste aiutarmi? grazie.
First try with this:
rm -r var/cache/* var/generation/* var/log/* var/view_preprocessed/* pub/static/_requirejs/* pub/static/adminhtml/* pub/static/frontend/* '
php bin/magento setup:di:compile
after this: php bin/magento setup:upgrade and php bin/magento setup:static-content:deploy
If this not worked then try below code
Override template
Create the file app/code/Vendor/Module/view/frontend/layout/checkout_onepage_success.xml and add the following:
<?xml version="1.0"?> <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="checkout.success" template="Your_Module::checkout/success.phtml"/> </body> </page>
Create the file app/code/Vendor/Module/view/frontend/templates/checkout/success.phtmland add the following:
<?php /** @var $block \Vendor\Module\Block\Success */ ?> <div class="checkout-success"> <?php if ($block->getOrderId()):?> <?php if ($block->getCanViewOrder()) :?> <p><?php echo __('Your order number is: %1.', sprintf('<a href="%s" class="order-number"><strong>%s</strong></a>', $block->escapeHtml($block->getViewOrderUrl()), $block->escapeHtml($block->getOrderId()))) ?></p> <?php else: ?> <p><?php echo __('Your order # is: <span>%1</span>.', $block->escapeHtml($block->getOrderId())) ?></p> <?php endif; ?> <!-- BEGIN VENDOR_MODULE CUSTOM --> <p><?php echo __('You ordered %1 items.', (int) $block->getOrder()->getTotalQtyOrdered()) ?></p> <!-- END VENDOR_MODULE CUSTOM --> <p><?php /* @escapeNotVerified */ echo __('We\'ll email you an order confirmation with details and tracking info.') ?></p> <?php endif; ?> <?php echo $block->getAdditionalInfoHtml() ?> <div class="actions-toolbar"> <div class="primary"> <a class="action primary continue" href="<?php /* @escapeNotVerified */ echo $block->getUrl() ?>"><span><?php /* @escapeNotVerified */ echo __('Continue Shopping') ?></span></a> </div> </div> </div>
rm -r var/cache/* var/generation/* var/log/* var/view_preprocessed/* pub/static/_requirejs/* pub/static/adminhtml/* pub/static/frontend/* '
php bin/magento setup:di:compile
after this: php bin/magento setup:upgrade and php bin/magento setup:static-content:deploy
Hi, thanks. Tried but not working.
Hello @zdelete.
After place an order customer login is not expired. Make sure you haven't place an order with guest customer.
--
If my answer is useful, please Accept as Solution & give Kudos
sorry for late response. guest are not allowed...
I think Suggested solution in the previous post should be helpful. if not working can you please share error if there any.