Jump to content

i need some help on how to use a image instead of a text variable


thebluedrg

Recommended Posts

In Virtuemart (Joomla component) - shopping cart system

 

Here the code

 

http://virtuemart.net

*/

mm_showMyFileName( __FILE__ );

 

echo '<h2>'. $VM_LANG->_('PHPSHOP_CART_TITLE') .'<img src="http://www.mydomain.com/images/stories/carttitle.jpg"></h2>

<!-- Cart Begins here -->

';

include(PAGEPATH. 'basket.php');

echo $basket_html;

echo '<!-- End Cart --><br />

';

 

if ($cart["idx"]) {

    ?>

    <div align="center">

    <?php

    if( $continue_link != '') {

?>

<a href="<?php echo $continue_link ?>" class="continue_link">

<img src="http://www.mydomain.com/images/stories/addmore.jpg">

</a>

<?php

    }

       

  if (!defined('_MIN_POV_REACHED')) { ?>

 

      <span style="font-weight:bold;"><?php echo $VM_LANG->_('PHPSHOP_CHECKOUT_ERR_MIN_POV2') . " ".$CURRENCY_DISPLAY->getFullValue($_SESSION['minimum_pov']) ?></span>

      <?php

  }

  else {

  $href = $sess->url( $_SERVER['PHP_SELF'].'?page=checkout.index&ssl_redirect=1', true);

  $href2 = $sess->url( $mm_action_url . "/index2.php?page=checkout.index&ssl_redirect=1", true);

  $class_att = 'class="checkout_link"';

  $text = $VM_LANG->_('PHPSHOP_CHECKOUT_TITLE');

 

  if( $this->get_cfg('useGreyBoxOnCheckout', 1)) {

  echo vmCommonHTML::getGreyBoxPopupLink( $href2, $text, '', $text, $class_att, 500, 600, $href) ;

  }

  else {

  echo vmCommonHTML::hyperlink( $href, $text, '', $text, $class_att ) ;

  }

}

?>

</div>

 

<?php

// End if statement

}

?>

 

 

In the PHPSHOP_CHECKOUT_TITLE- >>  CHECKOUT (text field)

 

When I checked out, I see ADD MORE (addmore.jpg) and CHECKOUT (text field), I would like to replace PHPSHOP_CHECKOUT_TITLE with a picture (checkout.jpg) so I can have both pictures besides each other.

 

Any idea?

 

 

 

PHPSHOP_CHECKOUT_TITLE is being define in the english.php (common language file)

 

* http://virtuemart.net

*/

global $VM_LANG;

$langvars = array (

'CHARSET' => 'ISO-8859-1',

'PHPSHOP_ERROR' => 'ERROR',

'PHPSHOP_CHECKOUT_TITLE' => 'Checkout',

 

Can I replace it with a picture?

Not really..

 

        $text = $VM_LANG->_('PHPSHOP_CHECKOUT_TITLE');

     

        if( $this->get_cfg('useGreyBoxOnCheckout', 1)) {

            echo vmCommonHTML::getGreyBoxPopupLink( $href2, $text, '', $text, $class_att, 500, 600, $href) ;

        }

        else {

            echo vmCommonHTML::hyperlink( $href, $text, '', $text, $class_att ) ;

        }

 

if you replace it with a picture the hyperlink or PopupLink won't work.. you want the picture to be a link?

 

find in vmCommonHTML a function that makes picture links.. thats the proper way of fixing this the quickfix is deleting the code above and replacing it with a

echo '<a href="test.com"><img src="images/image.png" /></a>';

 

but thats the crappy way of fixing it.. i suggest looking for the function that does picture links in vmCommonHTML

well replace

 

  if( $this->get_cfg('useGreyBoxOnCheckout', 1)) {
            echo vmCommonHTML::getGreyBoxPopupLink( $href2, $text, '', $text, $class_att, 500, 600, $href) ;
         }
         else {
            echo vmCommonHTML::hyperlink( $href, $text, '', $text, $class_att ) ;
         }

 

with

 

//  if( $this->get_cfg('useGreyBoxOnCheckout', 1)) {
//            echo vmCommonHTML::getGreyBoxPopupLink( $href2, $text, '', $text, $class_att, 500, 600, $href) ;
//         }
//         else {
//            echo vmCommonHTML::hyperlink( $href, $text, '', $text, $class_att ) ;
//         }
echo '<a href=$href><img src="images/image.png" /></a>';

 

but yah its crappy and uhh no idea if it will work there is 2 href's one called $href other called $href2 so pick of from each whichever works.

Not too sure but, looking at the code he gave you, you could try to set the variable $href somewhere either at the top of your script, or where-ever your variables are being called from.

$href = "http://www.yourlink.com"

 

or replacing the $href from this part "echo '<a href=$href><img src="images/image.png" /></a>'" with the link.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.