Author Topic: Products Comparison  (Read 65011 times)

tug

  • Beginner
  • *
  • Posts: 7
  • Clear Modifications/Hacks for Virtuemart
    • Homepage (Russian)
Products Comparison
« on: February 25, 2007, 11:00:30 am »
Virtuemart Product Comparison Extension.
Author: truetug@gmail.com
It's highly customizable extension for comparison products of one type by parameters and other fields.


Installation
  • Install module "virtuemart_product_comparison 1.0 module.zip"
  • Unpack all files from archive "virtuemart_product_comparison 1.0 extension.zip" to "path_to_joomla/administrator/components/com_virtuemart/"
  • Enter as administrator and follow the url "your_server/administrator/index2.php?option=com_virtuemart&page=admin.vm_comparison_install"
    If Installator says that all is OK you may delete file "path_to_joomla/administrator/components/com_virtuemart/html/admin.vm_comparison_install.php"
  • Place in your browse file and/or flypage placeholder - {form_addtocomparison}
  • In shop.browse.php and shop.product_details.php, directly before "/*** Now fill the template" paste following code (samples in "virtuemart_product_comparison 1.0 docs and samples.zip")
Code: [Select]
// <!-- tugged comparison extension
$dbt = new ps_DB;
$q = "SELECT product_type_id FROM #__{vm}_product_product_type_xref WHERE product_id = '".$db_browse->f("product_id")."'";
$dbt->query($q);
$product_type_id = $dbt->loadResult();

if( !empty($product_type_id) ) {
  if( is_array($_SESSION['compare'][$product_type_id]) && in_array($db_browse->f("product_id"), $_SESSION['compare'][$product_type_id]) ) {
    $form_addtocomparison = '<p>(Product added for comparison)</p>';
  }
  else {
    $form_addtocomparison = '
      <form action="'.$mm_action_url.'index.php" method="POST" name="addtocomparison" id="addtocomparison_'.$i.'">
        <input type="submit" value="Add to comparison" />
        <input type="hidden" name="category_id" value="'.@$_REQUEST['category_id'].'" />
        <input type="hidden" name="product_id" value="'.$db_browse->f("product_id").'" />
        <input type="hidden" name="page" value="shop.browse" />
        <input type="hidden" name="func" value="comparisonAdd" />
        <input type="hidden" name="Itemid" value="'.$Itemid.'" />
        <input type="hidden" name="option" value="com_virtuemart" />
      </form>
    ';
  }
}
else {
  $form_addtocomparison = '';
}
// tugged comparison extension -->

and somewhere near "$product_cell = str_replace( "{product_name}", shopMakeHtmlSafe( $product_name ), $product_cell );"
for shop.browse.php
Code: [Select]
// <!-- tugged comparison extension
$product_cell = str_replace( "{form_addtocomparison}", $form_addtocomparison, $product_cell );
// tugged comparison extension -->

for shop.product_details.php
Code: [Select]
// <!-- tugged comparison extension
$template = str_replace( "{form_addtocomparison}", $form_addtocomparison, $template );
// tugged comparison extension -->

Installation complete.

[attachment cleanup by admin]
Donate us: E-gold - 4138621 | WebMoney (USD) - Z233549364947

SteelRat

  • Jr. Member
  • **
  • Posts: 76
    • A25 WDS
Re: Products Comparison
« Reply #1 on: February 27, 2007, 11:26:02 am »
preved :)

Adam Bazaroff

  • Jr. Member
  • **
  • Posts: 90
Re: Products Comparison
« Reply #2 on: March 12, 2007, 23:11:12 pm »
Странно, что нет реакции никакой, тогда как кто-то из модераторов на ирц жаловался, что нет такой функции. Tug, сделай скриншоты на английском, может поймут ;)
/Adam'B ... Poor english mode [ON] ;D

SteelRat

  • Jr. Member
  • **
  • Posts: 76
    • A25 WDS
Re: Products Comparison
« Reply #3 on: March 14, 2007, 15:48:42 pm »
не стоит париться, логика добавления не очень ясна. То "Круто, добавляем", то пофиг, без камментов. Соерен на ЛС не отвечает. кому надо - найдут и так, я забил ;)

kessels1234

  • Jr. Member
  • **
  • Posts: 208
Re: Products Comparison
« Reply #4 on: March 21, 2007, 22:43:20 pm »
Hi,

I would love to have this mod but I tried with my own files. didn's work. Tried with your sample files: didn't work either. Nothing to see on my flypage where i can choosen to compare. Looks like if there is missing something. Did Exactly what you described. Can you help me?

Gr Danny

tug

  • Beginner
  • *
  • Posts: 7
  • Clear Modifications/Hacks for Virtuemart
    • Homepage (Russian)
Re: Products Comparison
« Reply #5 on: March 27, 2007, 00:16:07 am »
I made a simple video installation manual. Do not be scared "exe" file. It is video with the player programm. Just run the file. In the process can be a error, simply restart file, and skip critical chapter.

exe (good quality, navigation, 8 mb)
swf (poor quality, navigation, 23 mb)
Donate us: E-gold - 4138621 | WebMoney (USD) - Z233549364947

kessels1234

  • Jr. Member
  • **
  • Posts: 208
Re: Products Comparison
« Reply #6 on: March 27, 2007, 09:06:01 am »
Thanks for doing this. It cleared a lot.

Gr Danny

addison

  • Jr. Member
  • **
  • Posts: 61
Re: Products Comparison
« Reply #7 on: March 27, 2007, 11:18:09 am »
Hello Tug,

This is one of the most requested features. Great job man!

Can you go further? I mean to allow comparison only between products in the same category?

Cheers,
Addison

addison

  • Jr. Member
  • **
  • Posts: 61
Re: Products Comparison
« Reply #8 on: March 27, 2007, 12:54:06 pm »
... Here is one more idea ...

How could be used also all the entered data for comparison in the product page, as characteristics or technical information?

AddisSon

tug

  • Beginner
  • *
  • Posts: 7
  • Clear Modifications/Hacks for Virtuemart
    • Homepage (Russian)
Re: Products Comparison
« Reply #9 on: March 27, 2007, 22:04:42 pm »
Quote
Can you go further? I mean to allow comparison only between products in the same category?
Normal situation: The manager retrieves goods with the parameters via csv. Thus every seller decides for itself as a place available for comparison products. In addition, this extension allows you to compare multiple types.

Quote
How could be used also all the entered data for comparison in the product page, as characteristics or technical information?
I saw an order for the modifications and I can adjust this extension, under these requirements.
U mean something like this?
Donate us: E-gold - 4138621 | WebMoney (USD) - Z233549364947

addison

  • Jr. Member
  • **
  • Posts: 61
Re: Products Comparison
« Reply #10 on: March 28, 2007, 09:43:10 am »
Hi Tug,

Thanks for your reply. In product page I have only product description as a field in Admin, which could be OK to describe a product.

How can I get and list the entered comparition data in product page in a new part, let's call it Characteristics?

Something like this in product page:

Product description:

This is a wonderful product. You can buy it and solve your problems ...

Technical Characteristics

value 1 - 100 km/s
value 2 - 10 minutes
value 3 - N/A
value 4 - 1 year

SteelRat

  • Jr. Member
  • **
  • Posts: 76
    • A25 WDS
Re: Products Comparison
« Reply #11 on: April 10, 2007, 10:13:39 am »
I've made for this own compare mod based on product type parameters

tug

  • Beginner
  • *
  • Posts: 7
  • Clear Modifications/Hacks for Virtuemart
    • Homepage (Russian)
Re: Products Comparison
« Reply #12 on: April 11, 2007, 10:54:42 am »
Hi Tug,
Technical Characteristics

value 1 - 100 km/s
value 2 - 10 minutes
value 3 - N/A
value 4 - 1 year

It is a standart product type feature.
Donate us: E-gold - 4138621 | WebMoney (USD) - Z233549364947

notelseit

  • Jr. Member
  • **
  • Posts: 58
    • Notelseit
Re: Products Comparison
« Reply #13 on: September 10, 2007, 08:59:25 am »


i have this error

link --> administrator/index2.php?option=com_virtuemart&page=admin.vm_comparison_install

Register module.

Fatal error: Call to undefined method ps_DB::buildQuery() in .......\administrator\components\com_virtuemart\classes\ps_module.php on line 149




Notelseit

aravot

  • Peter
  • Quality&Testing Team
  • Sr. Member
  • *
  • Posts: 2874
    • VirtueMart Extensions
Re: Products Comparison
« Reply #14 on: September 11, 2007, 07:21:30 am »
The error could be due to changes between v1.0.10 and 1.0.12