thebluedrg Posted June 21, 2009 Share Posted June 21, 2009 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? Link to comment https://forums.phpfreaks.com/topic/163161-i-need-some-help-on-how-to-use-a-image-instead-of-a-text-variable/ Share on other sites More sharing options...
pkedpker Posted June 21, 2009 Share Posted June 21, 2009 PHPSHOP_CHECKOUT_TITLE is a constant defined somewhere in another file.. thats where you do the changes you can't really mess around by deleting the PHP_SHOP_CHECKOUT_TITLE overthere as the $text is linked to another function.. Link to comment https://forums.phpfreaks.com/topic/163161-i-need-some-help-on-how-to-use-a-image-instead-of-a-text-variable/#findComment-860833 Share on other sites More sharing options...
thebluedrg Posted June 21, 2009 Author Share Posted June 21, 2009 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? Link to comment https://forums.phpfreaks.com/topic/163161-i-need-some-help-on-how-to-use-a-image-instead-of-a-text-variable/#findComment-860836 Share on other sites More sharing options...
pkedpker Posted June 21, 2009 Share Posted June 21, 2009 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 Link to comment https://forums.phpfreaks.com/topic/163161-i-need-some-help-on-how-to-use-a-image-instead-of-a-text-variable/#findComment-860840 Share on other sites More sharing options...
thebluedrg Posted June 21, 2009 Author Share Posted June 21, 2009 Yes I want the picture to be a link to the $html link (shopping cart checkout page) I'll take the crappy way for now So the code would be what exactly? thx Link to comment https://forums.phpfreaks.com/topic/163161-i-need-some-help-on-how-to-use-a-image-instead-of-a-text-variable/#findComment-860848 Share on other sites More sharing options...
pkedpker Posted June 21, 2009 Share Posted June 21, 2009 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. Link to comment https://forums.phpfreaks.com/topic/163161-i-need-some-help-on-how-to-use-a-image-instead-of-a-text-variable/#findComment-860858 Share on other sites More sharing options...
thebluedrg Posted June 22, 2009 Author Share Posted June 22, 2009 good and bad news! your code is working.. I can see both pictures now! However, the link doesn't work 404 Page Not Found ($HREF) any idea? Link to comment https://forums.phpfreaks.com/topic/163161-i-need-some-help-on-how-to-use-a-image-instead-of-a-text-variable/#findComment-860949 Share on other sites More sharing options...
Brink Kale Posted June 22, 2009 Share Posted June 22, 2009 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. Link to comment https://forums.phpfreaks.com/topic/163161-i-need-some-help-on-how-to-use-a-image-instead-of-a-text-variable/#findComment-861148 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.