News:

Looking for documentation? Take a look on our wiki

Main Menu

Why is html saved for shipment and payment in db

Started by Rune Rasmussen, May 05, 2015, 14:40:40 PM

Previous topic - Next topic

Rune Rasmussen

I wonder why html (logos etc) is saved for shipment and payment options in the database for each order in the _virtuemart_payment_plg_NAME/_virtuemart_shipment_plg_NAME table, or rather - why it's used in different order views.

Why not just use the name as it's saved for each option in _virtuemart_paymentmethods_LANG_CODE/_virtuemart_shipmentmethods_LANG_CODE instead to give it all a cleaner normal look?

T.ex. on the Invoice pdf where it also is duplicated, making it look quite bad... I just don't get the idea behind this...

And yes... I know that some is able to modify it, both the display and the modules, but the system should be somewhat usefull for most people out of the box.

Attached is an image of a "worst case" scenario.
Rune Rasmussen - https://www.syntaxerror.no/

Norwegian Translation Team

Milbo

There is the rule that an order should not be changeable afterwards. The safest method is just to store the html. I must digger deeper to understand all the reasons for it.
But I know the problem in general, maybe a special view for the invoices would be interesting.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

Milbo

I think the problem is here that the name got misused as description. I wonder if the cart shows the description. So maybe the problem is there.
Example, use the name as name, the rest in the description. The invoice would have on top, the name and the list would be with description (as shown in the cart).
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

Rune Rasmussen

#3
OK, I see. And I like the idea of a own view for invoices.

Anyhow part of the problem might be that few know about or use any description field, one reason for that might be that it's not used by core plugins neither - or do you remember any we can look at to learn from it?

T.ex. I just tested the latest version of VM with Klarna Checkout, and this is the result. In table 'virtuemart_payment_plg_klarnacheckout', under 'payment_name' this is stored:

<span class="vmpayment klarnacheckout">
      <span class="vmCartPaymentLogo" ><img src="https://cdn.klarna.com/1.0/shared/image/generic/badge/nb_no/checkout/short-blue.png?width=385" /></span>
          <span class="vmpayment_name">Klarnakasse</span>
   </span>


In table 'virtuemart_shipment_plg_weight_countries' under 'shipment_name' this is stored:
<span class="vmshipment_name">Self pick-up</span>
Rune Rasmussen - https://www.syntaxerror.no/

Norwegian Translation Team

alatak

hello
QuoteThere is the rule that an order should not be changeable afterwards. The safest method is just to store the html.
Yes, it was the reason behind it.

Milbo

yeh but it was not meant to store parts of the template, it stores always a useless span. Just tricky to change that BC
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

Rune Rasmussen

#6
Not only the span, but also the logo etc.  and it doesn't make any sense to save it in database, and even less to display it in mails and documents.

Store owners can not change the product name and price without any good reasons in most countries, that's right, but from there to saving unneeded stuff is quite a big difference Valérie.

But I guess the problem is that everything beneath the "main" span's for payment and shipment (e.g. <span class="vmpayment ...) in cart is saved now, instead of just the names.
Rune Rasmussen - https://www.syntaxerror.no/

Norwegian Translation Team

Rune Rasmussen

Quote from: Milbo on September 15, 2015, 19:21:50 PM
I think the problem is here that the name got misused as description. I wonder if the cart shows the description. So maybe the problem is there.
Example, use the name as name, the rest in the description. The invoice would have on top, the name and the list would be with description (as shown in the cart).

And nope, see attached images. This is the standard payment and shipment plugins delivered and tested with VirtueMart 3.0.10
Rune Rasmussen - https://www.syntaxerror.no/

Norwegian Translation Team