i know this question has been asked on other posts but i believe Porto theme uses different files/layouts.

I'm trying to change the "add to cart/basket" button to "View" and take you to the product page in my Porto theme. i have read on other stack posts to change list.phtml however the code people refer to are not in Porto Theme.

our page is https://www.redbanduk.co.uk/construction-groundwork/hand-held-cutters/husqvarna-disc-cutters/petrol

i'm hoping someone is able to help as this is driving me mad.

Thank you in advance


This is not best practice but I just used translate line and change it from "Add to basket" to "buy now" as a client wanted it that way.

Might be a work around for now

  • Thanks for the quick response. i did play with this option and yes it works but still adds items to the cart rather than redirects to the product page.
    – redband
    Jul 13 at 7:55

I thought it may be wise to share the form section of my list.phtml.

<form data-role="tocart-form" action="<?php echo $postParams['action']; ?>" method="post">
                                        <input type="hidden" name="product" value="<?php echo $postParams['data']['product']; ?>">
                                        <input type="hidden" name="<?php echo Action::PARAM_NAME_URL_ENCODED; ?>" value="<?php echo $postParams['data'][Action::PARAM_NAME_URL_ENCODED]; ?>">
                                        <?php if(isset($_category_config['qty_field']) && $_category_config['qty_field']):?>
                                            <div class="qty-box">
                                                <a href="javascript:void(0)" class="qtyminus"><i class="porto-icon-minus"></i></a>
                                                <input type="text" name="qty" id="qty" maxlength="12" value="<?php /* @escapeNotVerified */ echo $block->getProductDefaultQty() * 1 ?>" title="<?php /* @escapeNotVerified */ echo __('Qty') ?>" class="input-text qty" data-validate="<?php echo $block->escapeHtml(json_encode($block->getQuantityValidators())) ?>"/>
                                                <a href="javascript:void(0)" class="qtyplus"><i class="porto-icon-plus"></i></a>
                                        <?php endif;?>
                                        <?php echo $block->getBlockHtml('formkey')?>
                                        <button type="submit"
                                                title="<?php echo $block->escapeHtml(__('Add to Cart')); ?>"
                                                class="action tocart primary">
                                            <span><?php echo __('Add to Cart') ?></span>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.