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

[SOLVED] Custom field type E not displayed correctly in cart

Started by iWim, May 10, 2015, 20:05:59 PM

Previous topic - Next topic

iWim

Hey, hey,

Custom field type E is not displayed correctly in the cart.
From what I can see is that the second custom field type E is nested inside the first, and the third inside the second...

It worked fine in VM 3.0.6, it happened after the upgrade to 3.0.8.

See attachment.
I colored it for clearance.

In the attachment you also see a type-S, that one is displayed correctly.
But when placed at the end it is also nested inside product field type E.

J! 3.4.1
VM 3.0.8

Thank you.
Wim

GJC Web Design

isn't it a problem with 'custom fields for all' missing a closing 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

iWim

Yeah... but VM updated and Custom Fields for All did not.

As I said in VM 3.0.6 it was displayed correctly, in VM 3.0.8 it's not.

Just in case I also informed the CF4A devs.

balai

I tested it with other plug-ins including the text input.
It happened with all of them.

<span class="product-field-type-E">
    <span>
        Input 1
    </span>
    <span class="product-field-type-E">
   <span>
        Input 2
    </span>
</span>
</span>


Seems like the <span class="product-field-type-E"> is not closing after a custom field display

balai

file: administrator/components/com_virtuemart/models/customfields.php
lines 1236-1248
code:

                                        $otag = ' <span class="product-field-type-' . $productCustom->field_type . '">';
if ($productCustom->field_type == "E") {

$tmp = '';
if (!class_exists ('vmCustomPlugin'))
require(VMPATH_PLUGINLIBS . DS . 'vmcustomplugin.php');
JPluginHelper::importPlugin ('vmcustom');
$dispatcher = JDispatcher::getInstance ();
$dispatcher->trigger ($trigger.'VM3', array(&$product, &$productCustom, &$tmp));
if(!empty($tmp)){
$html .= $otag.$tmp;
}
}


should be:


                                        $otag = ' <span class="product-field-type-' . $productCustom->field_type . '">';
$closing_tag='</span>';
if ($productCustom->field_type == "E") {

$tmp = '';
if (!class_exists ('vmCustomPlugin'))
require(VMPATH_PLUGINLIBS . DS . 'vmcustomplugin.php');
JPluginHelper::importPlugin ('vmcustom');
$dispatcher = JDispatcher::getInstance ();
$dispatcher->trigger ($trigger.'VM3', array(&$product, &$productCustom, &$tmp));
if(!empty($tmp)){
$html .= $otag.$tmp.$closing_tag;
}
}


I suggest using the $closing_tag for the rest of the code instead of repeating the '</span>' closure
Since you use a variable for opening tag, better have a variable also for the closing to avoid such errors

Milbo

I suggest to use the latest version, called vm3.0.9 and to be delighted by the fix given by Kainhofer around 3 weeks ago.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

iWim