You login to the Admin interface, click Components > Virtuemart
Click the menu Products > Product Type > Add/Edit Product Type
Enter a new product type called Book, and a description, click Save (top right)

This will take you to a list of product types, including the one you’ve just created, now click the [Show] link to the right of Parameters for Books (it’s on the same row)

This should give you an empty list of parameters for the product type Book.

On the top right, above the Virtuemart menu, you should have “New” and “Delete” buttons. Click “New” to create a new parameter for this product type. Enter the details and click “Save”, again top right.

We’re setting up a book store and have added parameters like ISBN, Author, Genre, Fiction / Non-Fiction, etc. Quick point, all of these are of the “Short Text” type. I may be wrong, but I think Text is the mySQL field type TEXT which is huge as opposed to the type STRING which is up to 255 characters.

In order to create a new product with this category, you can click Products > Add Product, then enter the basic product details, click “Save”, and then on the results page which displays you’re newly created product, click on the product name link and then click “Add Product Type” in the top right hand corner. You can then attach the Product Type Book to this product by selecting it from the drop down and clicking “Save” in the top right hand corner.

Once the Product Type has been attached to the Product, you need to go back into editing the product, and a new tab will have appeared called Book, to the right of “Product Information”, “Product Status”, etc. Here you can enter the details according to how you set up the product type Book.

This whole process does seem a bit clunky, there may be an easier way I’m not aware of.

How this applies to searching for products I don’t yet know, again, maybe somebody else can shed some light on it.

Good luck,

Enjoy Algo Blogging

1. do not use - (dash), use _(underscore) rather than
2. var x = ‘{a:123,b:456}’;
eval(’var z=’+x);
now structure will be referred by object ‘z’

generate pdf sobi2 joomla
Posted on December 11, 2008

Sobi2 is a great component but it lacks in some feature such as PDF generation.
Many of you must be searching on web to find the solution but there is none which can satisfy you.

Here are some simple steps to generate PDF from sobi2

There are some limitation for generating PDF one is that you have to make the sobi

detailed template in either table structure or in ’spans’.DIV IS NOT SUPPORTED HERE.

You need to download DOMPDF

unzip the DOMPDF folder and put files in to a folder inside the includes folder.

Just make a form in sobi detailed template and add all the fields in hidden fields. make the action of your form to “your site name.com/filename.php”.

Now make a link for PDF and submit the form on click of that link.

Make a file “filename.php” inside your default site folder.

Just include the file “dompdf_config.inc.php”

[require_once(realpath(dirname(__FILE__).'/includes/pdf/dompdf_config.inc.php'))]

Retrieve all the required posted values and design the PDF file accordingly.

At the end of the page just wright the following code

<?php
$old_limit = ini_set(”memory_limit”, “64M”);
$dompdf = new DOMPDF();
$dompdf->load_html($value);
$dompdf->set_paper(’a4′,’portrait’);
$dompdf->render();
$dompdf->stream(”dompdf_out.pdf”);
exit(0);
?>

Still in trouble!!! Do write your comments here and I will try to solve the problem.

Happy AlgoBloging!!!

PEAR & PECL
Posted on December 11, 2008

The PHP Extension and Application Repository, or PEAR, is a repository of PHP software code.
It promote a standard coding style.Each PEAR code package comprises an independent project under the PEAR umbrella. It has its own development team, versioning-control and documentation.
A PEAR package is distributed as a gzipped tar file. It can consist of source code or binaries or both. Many PEAR packages can readily be used by developers as ordinary third party code via simple include statements in PHP.
The PEAR base classes contain code for simulating object-oriented destructors and consistent error-handling. Packages exist for many basic PHP functions including authentication, caching, database access, encryption, configuration, HTML, web services and XML.

PECL (PHP Extension Community Library) is conceptually very similar to PEAR, and indeed PECL modules are installed with the PEAR Package Manager. PECL contains C extensions for compiling into PHP. As C programs , PECL extensions run more efficiently than PEAR packages.