News:

Looking for documentation? Take a look on our wiki

Main Menu

Payment and Shipment logos (plugin params)

Started by Rune Rasmussen, April 19, 2015, 12:24:27 PM

Previous topic - Next topic

Rune Rasmussen

Hi,

In plugins xml we can define directory for payment_logos and shipment_logos, but this seems to only tell where to look for images when setting params in admin? In frontend they wil not display unless they are placed in "/images/stories/virtuemart/payment" or "/images/stories/virtuemart/shipment".

T.ex. directory="/plugins/vmpayment/myplugin/images" will not display the logo in frontend...

Is this intentionally or a bug?

If it's intentionally, is it an easy way to get the logos saved/moved into /images/stories/virtuemart/payment or /images/stories/virtuemart/shipment when the plugins are installed?


Anyhow, the media folder would probably fit better for logos etc., since we then could do t.ex.:

    <media folder="images" destination="com_virtuemart/images/shipment">
<filename>shipping_image1.gif</filename>
<filename>shipping_image2.gif</filename>
    </media>
Rune Rasmussen - https://www.syntaxerror.no/

Norwegian Translation Team

Rune Rasmussen

Rune Rasmussen - https://www.syntaxerror.no/

Norwegian Translation Team

GJC Web Design

if you check function displayLogos ($logo_list) in vmsplugin.php you will see the path is hard coded

$url = JURI::root () . 'images/stories/virtuemart/' . $this->_psType . '/';

so yes  - intentional

I just over ride the function in my shipping plugins so then I can place the logos where ever I want

same with the html rendering etc to get more control of the display

e.g.

/**
* displays the logos of a periship VirtueMart plugin
*
* @author gjcwebdesign
* @param array $logo_list
* @return html with logos
*/
protected function displayLogos ($logo_list) {

$img = "";

if (!(empty($logo_list))) {
$url = JURI::root () . 'plugins/vmshipment/periship/periship_images/';
if (!is_array ($logo_list)) {
$logo_list = (array)$logo_list;
}
foreach ($logo_list as $logo) {
$alt_text = substr ($logo, 0, strpos ($logo, '.'));
$img .= '<span class="vmCartShipmentLogo perishipLogo" ><img align="middle" src="' . $url . $logo . '"  alt="' . $alt_text . '" /></span> ';
}
}
return $img;
}

GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

Rune Rasmussen

It can be a "mistake" or old forgotten bad way of dealing with it, even if it's hard-coded, there's lots of it in VM...
Things like this could, and probably should, be changed to improve the system and the compatibility with Joomla (here media folder).

That said, I really appreciate you sharing your work-around for it. Thanks. :)
Rune Rasmussen - https://www.syntaxerror.no/

Norwegian Translation Team