News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

Remove "+" from shipment_cost fee on edit_shipment (SOLVED)

Started by kalestud, August 22, 2016, 13:03:34 PM

Previous topic - Next topic

kalestud

Hi there,

Is there any way to get rid of the + sign displayed on edit_shipment for the shipping costs?
Thing is, we don't charge for shipping, but we want to grand a discount to people who pickup their parcel.
It all works well, the rate is negative, but it now shows + and - and that has proven to be confusing for people.
Having the sign and symbol the other way around in my currency is not an option, becuase the display is way better on the cart and invoice like it is.

So basic question: Where is the + symbol put in (that's the one I try to get rid off) ? Can't find it anywhere!!!
(also why is it there, you can format your positive numbers in the currency anyway?)

VM 3.0.16 & J! 3.6.2

kalestud

Okay,

for now I found a workaround by hiding the fee (CSS):

/component/com_virtuemart/assets/css/vm-ltr-site.css
Around line 1106
hide .vmshiment_cost by taking it from previous group and specify hidden

.vmpayment_name, .vmpayment_cost, .vmshipment_name{
  padding: 0 2px;
}

.vmshipment_cost{
visibility: hidden;
}


Would still like to know how to get rid of the + and why it's there in the first place!

GJC Web Design

it is hardcoded in the  administrator\components\com_virtuemart\plugins\vmpsplugin.php

$costDisplay = '<span class="'.$this->_type.'_cost fee"> ('.$fee.' +'.$costDisplay.")</span>";

I always over ride the function getPluginHtml ($plugin, $selectedPlugin, $pluginSalesPrice) in my ship plugs so I can control the display
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

kalestud

You're a beauty!
Staring me right in the face (of course)!!!

Milbo

As far as I know, you can do that by a simple Language override. no?
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

GJC Web Design

nope - this is hard coded

$costDisplay = '<span class="'.$this->_type.'_cost fee"> ('.$fee.' +'.$costDisplay.")</span>";
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

kalestud

Hi there Milbo,

no that was my first guess, of course.

Also, I checked the currency display. Not possible to get rid of it there.
Now that I got the + out, I tried adding it to the positive values, but it then puts it everywhere, where there is a price or value mentioned.
So that was no good, in reaction to my own suggestion  :P

The right thing to do would be to add it when there's a fee involved.
When someone wants to pay by creditcard (+2%) it shows a + €0,29 or such behind the selected method.

Maybe that would be on the wishlist for future VM editions?

Agaton

Quote from: Milbo on August 23, 2016, 20:44:30 PM
As far as I know, you can do that by a simple Language override. no?

You are right Milbo, it is a simple language override but many people will not find it as the language override is "COM_VIRTUEMART_PLUGIN_COST_DISPLAY", which is set as "Discount/Fee:".

Unless you look directly at the code you will not realise that you have set the code to split the value using "/" as the point of split.

A nice bit of coding but isn't it rather unnecessary?

"list($discount, $fee) = explode( '/', vmText::_( 'COM_VIRTUEMART_PLUGIN_COST_DISPLAY' ) );" should this not be set as two different lines.

$discount = vmText::_( 'COM_VIRTUEMART_PLUGIN_COST_DISPLAY_DISCOUNT' );
$fee = vmText::_( 'COM_VIRTUEMART_PLUGIN_COST_DISPLAY_FEE' );

Then admins would be able to find the correct language override in search.

Just a thought, there may be other reasons you have used it this way, but at the moment it is not easy to change for the basic user