Author Topic: Converted Custom Attributes Extended Hack 3.0 for VM 1.1 + J1.5  (Read 76682 times)

dido76bg

  • Beginner
  • *
  • Posts: 40
Re: Converted Custom Attributes Extended Hack 3.0 for VM 1.1 + J1.5
« Reply #30 on: December 21, 2011, 03:00:59 am »
I have same problem with images. I dont see image but there are only name of attributes.
Jomla 1.5.22 and VirtueMart 1.1.7 stable
Check the path....

webgobe

  • Advanced
  • Full Member
  • *****
  • Posts: 535
  • Follow me on Twitter! http://twitter.com/webgobe
    • Internet craftsman carrying on the heritage of European manufacturing traditions through original Web designs.
Re: Converted Custom Attributes Extended Hack 3.0 for VM 1.1 + J1.5
« Reply #31 on: December 21, 2011, 08:04:45 am »
Thanks, dido76bg for the update!
Like a fine wine... Good from the start and getting better over time.
Donations are welcome!

ir_valentin

  • Beginner
  • *
  • Posts: 6
Re: Converted Custom Attributes Extended Hack 3.0 for VM 1.1 + J1.5
« Reply #32 on: December 22, 2011, 18:07:22 pm »
I have 56 images like radio selection, added as custom attributes, one under the other and I want to arranged them on multiple columns and lines. I need a big help because i don't know how to modify files for that.
The link is that: http://www.alluflex.it/home/tende-alla-veneziana/15-mm.html

Thanks in advance !

webgobe

  • Advanced
  • Full Member
  • *****
  • Posts: 535
  • Follow me on Twitter! http://twitter.com/webgobe
    • Internet craftsman carrying on the heritage of European manufacturing traditions through original Web designs.
Re: Converted Custom Attributes Extended Hack 3.0 for VM 1.1 + J1.5
« Reply #33 on: December 22, 2011, 19:24:33 pm »
It's not a 2 click thing, but basically this is what you need to know:
There are 2 files you need to modify. One is the VM template's CSS file, and another is the ps_product_custom_type_radiobutton_selector.tpl.php, also found in the default VM template, in templates/product_details/includes/custom_attribute folder.
This is the code you will need to play with.
Code: [Select]
<div style="width:20%;float:left;text-align:right;margin:3px;">
<input type="radio" id="custom_attr_checkbox_' . $custom_type_checkbox_group . '" name="custom_attr_checkbox" onclick="toggleCustomType' . $custom_type_checkbox_group . '(this)" />
</div>
<div style="width:75%;float:left;margin:3px;">
' . $custom_type_checkbox_label . '
</div>
<br clear="both" />
Like a fine wine... Good from the start and getting better over time.
Donations are welcome!

ir_valentin

  • Beginner
  • *
  • Posts: 6
Re: Converted Custom Attributes Extended Hack 3.0 for VM 1.1 + J1.5
« Reply #34 on: December 22, 2011, 21:26:29 pm »
I solved the problem, i used checkbox instead radio , i modified the file ps_product_custom_type.php , all colors are now aligned in three columns and also created the lightbox full image for checkbox. Code for all changes


Code: [Select]
***************************************************
 *
 * CHECKBOX element class
 * The class is is used to manage the product custom attribute type.
 *
***************************************************/
class ps_product_custom_type_checkbox extends ps_product_custom_type_base {
var $classname = "ps_product_custom_type_checkbox";

    /**
* Outputs HTML for Custom Attribute
*/
function customTypeHTML($field=array()) {
global $mosConfig_live_site;
    $html = "";
$titlevar = trim($field['attr_pagevar']);

$values=explode(",",$field['attr_value']);
foreach($values as $valueWhole) {
   
$valueArr = explode('|',$valueWhole);
$value = $valueArr[0];
$value_img = $valueArr[1];
$value_full_img = $valueArr[2];
        $checked = strstr($value, '*') ? ' checked="yes" ' : '';
$value = str_replace("*","",$value);

if(strrpos($value,'[')){
$base_var=substr($value,0,strrpos($value,'['));
} else {
$base_var = $value;
}
$base_var=trim($base_var);
$base_var=str_replace(" ","_",$base_var);

            if ( isset($_POST[$titlevar]) && in_array($base_var, $_POST[$titlevar]) ){
                    $checked = ' CHECKED';
            } else if ( isset($_POST[$titlevar]) ){
    $checked = '';
        }

      //~ $show_value = str_replace("[+","+",$value);
//~ $show_value = str_replace("[-","-",$show_value);
//~ $show_value = str_replace("[=","+",$show_value);
      //~ $show_value = str_replace("]","",$show_value);
$show_value=$this->getPriceWithTax($value);
if($value_img){
if($value_full_img){
$show_value = "<a title='".$show_value."' rel='lightbox' href='".$mosConfig_live_site."/components/com_virtuemart/shop_image/".$value_full_img."'><img src='".$mosConfig_live_site."/components/com_virtuemart/shop_image/".$value_img."' alt='".$show_value."' class='".$titlevar."_img' border=0 align='center' /></a><br />".$show_value;
}
else {
$show_value .= "<img src='".$mosConfig_live_site."/components/com_virtuemart/shop_image/".$value_img."' alt='".$show_value."' class='".$titlevar."_img' border=0 align='left' />";
}}
$html .= "<div class='checkbox_box' style='border: 1px dotted #CCC; width:150px; margin: 2px; padding: 2px; float: left;'>"; // CSS Style
$html .= "<input type=\"checkbox\" class=\"inputbox\" id=\"".$titlevar."_field\" name=\"".$titlevar."[]\" value=\"".$base_var."\" ". $checked ."/>".$show_value;
$html .= "</div>";
}

return $html;
}
Thanks for all your advice.

webgobe

  • Advanced
  • Full Member
  • *****
  • Posts: 535
  • Follow me on Twitter! http://twitter.com/webgobe
    • Internet craftsman carrying on the heritage of European manufacturing traditions through original Web designs.
Re: Converted Custom Attributes Extended Hack 3.0 for VM 1.1 + J1.5
« Reply #35 on: December 23, 2011, 09:45:30 am »
Great solution, I recommend it for anyone needing something similar!
Like a fine wine... Good from the start and getting better over time.
Donations are welcome!

ivannk

  • Beginner
  • *
  • Posts: 10
Re: Converted Custom Attributes Extended Hack 3.0 for VM 1.1 + J1.5
« Reply #36 on: December 23, 2011, 11:24:01 am »
I have same problem with images. I dont see image but there are only name of attributes.
Jomla 1.5.22 and VirtueMart 1.1.7 stable
Check the path....

I think everythink is OK. I inserted images to folder images with *.jpg extension. Then I put code just fo test.

Quote
Name(radio)(tip here|location)(option1|images/img_blue.jpg,option2*|images/img_blue.jpg,option3 [+5.00] |images/img_blue.jpg)
and result is

[attachment cleanup by admin]

webgobe

  • Advanced
  • Full Member
  • *****
  • Posts: 535
  • Follow me on Twitter! http://twitter.com/webgobe
    • Internet craftsman carrying on the heritage of European manufacturing traditions through original Web designs.
Like a fine wine... Good from the start and getting better over time.
Donations are welcome!

ivannk

  • Beginner
  • *
  • Posts: 10
Re: Converted Custom Attributes Extended Hack 3.0 for VM 1.1 + J1.5
« Reply #38 on: December 23, 2011, 12:43:26 pm »
\www\joomla\images\img_blue.jpg    665 B   17.12.11 16:19   -a--
copy from file manager

webgobe

  • Advanced
  • Full Member
  • *****
  • Posts: 535
  • Follow me on Twitter! http://twitter.com/webgobe
    • Internet craftsman carrying on the heritage of European manufacturing traditions through original Web designs.
Re: Converted Custom Attributes Extended Hack 3.0 for VM 1.1 + J1.5
« Reply #39 on: December 23, 2011, 13:11:55 pm »
And you checked the source of the page you don't seeing them ;) - just rightclick on, to see where the page seeks for these images!
Like a fine wine... Good from the start and getting better over time.
Donations are welcome!

ivannk

  • Beginner
  • *
  • Posts: 10
Re: Converted Custom Attributes Extended Hack 3.0 for VM 1.1 + J1.5
« Reply #40 on: December 23, 2011, 14:06:45 pm »
ahhh yeah Fire bug
path is /components/com_virtuemart/shop_image/images/img_blue.jpg
thanks 

ma57er

  • Beginner
  • *
  • Posts: 6
    • метални врати
Re: Converted Custom Attributes Extended Hack 3.0 for VM 1.1 + J1.5
« Reply #41 on: January 10, 2012, 22:03:16 pm »
Hello guys! This hack ROCK! I have simillar problem like other person here: I get this error:

Code: [Select]
Fatal error: Class 'ps_product_custom_type_file ' not found in ...../administrator/components/com_virtuemart/classes/ps_product_custom_attribute.php on line 92J version: 1.5.23
VM Version: 1.1.9.
URL: http://vrati-bg.eu/gamers/index.php?option=com_virtuemart&page=shop.browse&category_id=1&Itemid=119 (try product "product")
Default template
No other hacks - clean installations

Anyone have any suggestions?

webgobe

  • Advanced
  • Full Member
  • *****
  • Posts: 535
  • Follow me on Twitter! http://twitter.com/webgobe
    • Internet craftsman carrying on the heritage of European manufacturing traditions through original Web designs.
Re: Converted Custom Attributes Extended Hack 3.0 for VM 1.1 + J1.5
« Reply #42 on: January 11, 2012, 09:08:27 am »
Did you have overwritten ALL the files with files found in the package? It's mandatory - or you must apply the differences found in files.
Is the most common error regarding this hack - and generates this kind of errors.
Like a fine wine... Good from the start and getting better over time.
Donations are welcome!

dido76bg

  • Beginner
  • *
  • Posts: 40
Re: Converted Custom Attributes Extended Hack 3.0 for VM 1.1 + J1.5
« Reply #43 on: January 11, 2012, 09:47:19 am »
Hi now I have some problems with production site:
User cannot order more than one item. aftethat cannot add. In local host everithing is OK
Any idea.

webgobe

  • Advanced
  • Full Member
  • *****
  • Posts: 535
  • Follow me on Twitter! http://twitter.com/webgobe
    • Internet craftsman carrying on the heritage of European manufacturing traditions through original Web designs.
Re: Converted Custom Attributes Extended Hack 3.0 for VM 1.1 + J1.5
« Reply #44 on: January 11, 2012, 11:48:19 am »
check your VM main configuration. The URL's are all okay? Often when moving from development to production site people forgot to update the VM settings... wich are pointing back to the old location, creating all sorts of weird problems.
Like a fine wine... Good from the start and getting better over time.
Donations are welcome!