Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8928525
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T08:27:27+00:00 2026-06-15T08:27:27+00:00

I am looking for some advice on how best to link to a CMS

  • 0

I am looking for some advice on how best to link to a CMS product page from a template phtml file. I need to generate a link using ‘foreach’ as each product will have its own CMS product page. For example I have six products currently being displayed on the homepage I would like to have an ‘order now’ button that will take the user to the ‘add to cart’ page (view.phtml) and a ‘more info?’ button that will take the user to the CMS page for that product… is there a way to achieve this?

Here’s the code from new.phtml

<div class="new-product-content">
<?php if (($_products = $this->getProductCollection()) && $_products->getSize()): ?>
    <h3 class="subtitle new-products"><?php echo $this->__('HOT PRODUCTS') ?></h3>
    <?php $_columnCount = $this->getColumnCount(); ?>
    <?php $i=0; foreach ($_products->getItems() as $_product): ?>
    <?php if ($i++%$_columnCount==0): ?>

    <ul>
    <?php endif ?>
    <li class="thumb<?php if(($i-1)%$_columnCount==0): ?> first<?php elseif($i%$_columnCount==0): ?> last<?php endif; ?>">
            <a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->htmlEscape($_product->getName()) ?>" ><img src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->resize(175) ?>" width="175" height="175" alt="<?php echo $this->htmlEscape($_product->getName()) ?>" />
            </a>
               <div class="caption">    
                  <h4 class="product-name"> <?php $_productName = $this->helper('core/string')->truncate($this->htmlEscape($_product->getName()),20,'...', $_remainder, true); ?>
                   <a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $_productName ?>">
                    <?php echo $_productName ?><?php echo $this->__('&#8482;'); ?></a></h4>
                     <?php echo $this->getPriceHtml($_product, true, '-new') ?>
                      <div class="clearfix"></div>
                  <div class="desc">                  
                    <?php $sdesc = $_product->getShortDescription();
                    $sdesc = trim($sdesc);
                    $limit = 180;
                    if (strlen($sdesc) > $limit) {
                        $sdesc = substr($sdesc, 0, strrpos(substr($sdesc, 0, $limit), ' '));
                    } ?>
                    <?php echo $sdesc."..."; ?>
                  </div>
                <div class="clearfix"></div> 
<div class="btn-group">
  <button class="btn" type="button" title="<?php echo $this->__('Add to Cart') ?>" onclick="setLocation('<?php echo $this->getProductUrl($_product) ?>')"><?php echo $this->__('Order now...') ?></button>

<!--I NEED TO CHANGE THE DESTINATION OF THIS LINK  <button class="btn" type="button" title="<?php echo $this->__('More info') ?>" onclick="setLocation('<?php echo $this->getProductUrl($_product) ?>')"><?php echo $this->__('More info?') ?></button> --->
</div>
      </li>
      <?php if ($i%$_columnCount==0 || $i==count($_products)): ?>
  </ul>
  <div class="clearfix"></div>  
<?php endif ?>
<script type="text/javascript">
$j('.thumb li').last().css('border-right', 'none');
</script>
<script type="text/javascript">decorateGeneric($$('ul.products-grid'), ['odd','even','first','last'])</script>
<?php endforeach; ?>
<?php endif; ?>
<div class="clearfix"></div>
</div> 
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T08:27:28+00:00Added an answer on June 15, 2026 at 8:27 am

    Try something like, you need to get the ‘url key’ for the cms pages

    <button class="btn" type="button" title="<?php echo $this->__('More info') ?>" onclick="setLocation('<?php echo $this->getUrl('url key'); ?>')"><?php echo $this->__('More info?') ?></button> 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am looking for some advice on the best way to retrieve information from
I am looking for some advice as to the best way to generate a
Looking for some advice on the best way to implement localization along with client
I'm looking for some advice on the best way to provide a single place
Just looking for some advice on the best to approach a profile picture system
I'm looking for some advice on the best approach to synchronising access to properties
looking for some advice on what is the best way to deliver an HTML/CSS
Just looking for some advice. What is the best way to present a full
I'm looking for some advice on dynamic variables. Particularly if I'm making the best
I'm looking for some advice on best practice when writing a web app that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.