Menu Content

Support

> Forums, FAQs & Paid Support
Welcome, Guest
Username Password: Remember me

Comment (custom text input)
(1 viewing) (1) Guest
Support forum for customers who have purchased this product. Archive only, no new post can be added.

NOTE: This category has been locked. If you have purchased paid version, please, use our Support Ticket system instead. If you are using free edition, please see the Community Support section.
  • Page:
  • 1
  • 2

TOPIC: Comment (custom text input)

Re: Comment (custom text input) 11 years, 1 month ago #38314

Hello,

I did some more research. I guess this will have a simple sollution, as for the custom drop plugin the same ajustment was made.

See invoicehtml.php

The following was added there:

//support for Custom Field Dropbox Plugin (or more) - replace title from custom field title
if (COM_VMINVOICE_ISVM2 AND !is_numeric($key3)){
$db = JFactory::getDBO();
$db->setQuery('SELECT custom_param FROM #__virtuemart_product_customfields WHERE custom_value = '.$db->Quote($key2).' AND virtuemart_customfield_id = '.(int)$key);

Wouldn't it be easy to make the same implementation for the custom text input?

I would really appreciate if you guys can solve this matter.
Thanks in advance.
The topic has been locked.

Re: Comment (custom text input) 11 years ago #38766

Hello,

I have had email contact with makl several times and about two weeks ago he told me that this issue indeed was a bug and that you were going to resolve this in the next week (last week).

I have tried to contact several times but still didnt get a response on when this will be fixed.
I would really love to continue with my website but simply cant because this one small big in the invoice component is keeping me from going live.

So anyone knows when this will get fixed?
Thanks in advanve.
The topic has been locked.

Re: Comment (custom text input) 11 years ago #38893

Anyone? Why isn't anyone answering. I dont ask to fix it now I just ask when I can expect it to be fixed.
Please?
The topic has been locked.

Re: Comment (custom text input) 11 years ago #38955

  • pama
  • OFFLINE
  • Posts: 489
Hello. Sorry about late reply. Yes, it's similar to custom dropbox plugin. Until this will be presented in newest version, you can add support by this code:

Its in administrator/components/com_vminvoice/helpers/invoicehtml.php around line 855
(I included whole "attributes" part, you can replace it from 855 - 904 (where case 'price': starts)

 
case 'attributes':
if ($this->params->get('show_attributes')==1){
 
if (($decoded = json_decode($item->product_attribute, true))==null) //string attributes (VM1)
$replacement = preg_replace('#(\s*<\s*p\s[^>]*>\s*|\s*<\s*\/\s*p\s*>\s*|<\s*br\s*\/?\s*>\s*$|^\s*<\s*br\s*\/?\s*>)#i','',$item->product_attribute); //remove all <p>s and enclosing <br>s
else{ //JSON atrributes (VM2)
 
$attributes = array();
$db = JFactory::getDBO();
 
foreach ($decoded as $key => $val){
if (is_array($val) OR is_object($val)){
 
foreach ((array)$val as $key2 => $val2){
 
 
if (is_array($val2) OR is_object($val2)){ //another nested object :)
foreach ((array)$val2 as $key3 => $val3){
 
$title = false;
 
//support for VMCustom - textinput plugin
//{"48":{"textinput":{"comment":"10"}}}
if (COM_VMINVOICE_ISVM2){
$db->setQuery('SELECT C.custom_title FROM #__virtuemart_product_customfields AS CF
JOIN #__virtuemart_customs AS C ON (CF.virtuemart_custom_id = C.virtuemart_custom_id)
WHERE CF.custom_value = '
.$db->Quote($key2).' AND CF.virtuemart_customfield_id = '.(int)$key);
$title = $db->loadResult();
}
 
//support for Custom Field Dropbox Plugin (or more) - replace title from custom field title
if (!$title AND COM_VMINVOICE_ISVM2 AND !is_numeric($key3)){
$db = JFactory::getDBO();
$db->setQuery('SELECT custom_param FROM #__virtuemart_product_customfields WHERE custom_value = '.$db->Quote($key2).' AND virtuemart_customfield_id = '.(int)$key);
 
if (($param = $db->loadResult()) AND ($params = json_decode($param, true)))
foreach ($params as $key4 => $val4)
if (substr($key4, -5)=='_name' AND is_string($val4))
$title = $val4;
}
 
if (!$title)
$title = $key3;
 
if ($title AND !empty($val3))
$attributes[] = $this->_($title, 'com_virtuemart').': '.$this->_($val3, 'com_virtuemart');
}
}
elseif (!empty($key2) AND !empty($val2)){
 
$title = false;
 
if (COM_VMINVOICE_ISVM2){ //try to find custom field title
$db->setQuery('SELECT C.custom_title FROM #__virtuemart_product_customfields AS CF
JOIN #__virtuemart_customsAS C ON (CF.virtuemart_custom_id = C.virtuemart_custom_id)
WHERE CF.custom_value = '
.$db->Quote($key2).' AND CF.virtuemart_customfield_id = '.(int)$key);
$title = $db->loadResult();
}
 
$attributes[] = $this->_($title ? $title : $key2, 'com_virtuemart').': '.$this->_($val2, 'com_virtuemart');
}
}
}
else{
if (preg_match('#^\s*<\s*span.*>(.*)<\s*\\/\s*span\s*>\s*<\s*span.*>(.*)<\s*\\/\s*span\s*>\s*$#iU', (string)$val, $matches)) //two spans
//if (preg_match('#^\s*<\s*span\s+class\s*=\s*\\"costumTitle\\"\s*>(.*)<\s*\\?\s*/\s*span\s*>\s*<\s*span\s+class\s*=\s*\\"costumValue\\"\s*>(.*)<\s*\\?\s*/\s*span\s*>\s*$#iU', $val, $matches))
$attributes[] = $matches[1].': '.$matches[2];
elseif (($val = trim((string)$val)) AND !preg_match('#^\d+$#',$val)) //http://www.artio.net/support-forums/vm-invoice/customer-support/custom-plugin-attribute-title ?
$attributes[] = $this->_((string)$val, 'com_virtuemart'); //only when not empty and not integer
}
}
$replacement = implode("<br>\r\n", $attributes);
}
}
else
$replacement = '-remove-';
break;
 
 
ARTIO Support Team
The topic has been locked.
  • Page:
  • 1
  • 2
User Login Empty