php - %s appearing along with product name -


i have following code in phtml file:

<div class="actions"> <?php $_productnamestripped = $this->striptags($_product->getname(), null, true); ?> <a href="<?php echo $_product->getproducturl() ?>" title="<?php echo $this->__(" view details %s "), $_productnamestripped ?>" class="button"><?php echo $this->__('view details') ?> </a> </div> 

while hovering details button of product has show view details (product name) (%s replaced $_productnamestripped).

actual result: view details %sproductname

expected result: view details productname

try this

<div class="actions"> <?php $_productnamestripped = $this->striptags($_product->getname(), null, true); ?> <a href="<?php echo $_product->getproducturl() ?>" title="<?php echo sprintf("view details %s ",$_productnamestripped) ?>" class="button"><?php echo $this->__('view details') ?> </a> </div> 

Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

jquery - javascript onscroll fade same class but with different div -