Author Topic: Extension upgrade to support VM2  (Read 3727 times)


  • Beginner
  • *
  • Posts: 1
Extension upgrade to support VM2
« on: February 13, 2012, 16:36:36 PM »
Hi all,

I am the developer of the GoodRelations extension for Virtuemart/Joomla. To date, the extension only works with Joomla 1.5 and Virtuemart 1.1.*, but that should change of course ;-)

Until now I was able to port all the backend stuff of the extension to the new version of Virtuemart and Joomla:

What I still have difficulties with are the global variables of the new Virtuemart version, e.g. to figure out the string for the canonical shop URL (find out whether it is or, etc.). There should be something like VM_SHOP_URI.

What I still need to know and for what I require your help:
- canonical shop URL (ideally SEF URL):
   was define("SHOP_URI", preg_replace("/&/i", "&", BASE_URI.preg_replace("/^\//i", "", str_replace(JURI::base(true), "", $sess->url("?option=com_virtuemart")))) );
- image path, e.g. for referencing the URI of vendor logo or product images:
   was define("IMAGEBASEPATH", BASE_URI.preg_replace("/^\//i", "", str_replace(JPATH_BASE, "", IMAGEPATH)));
- information on whether value added tax is included or not
   was $auth["show_price_including_tax"]

In addition, can I get all the following values that I need from the product class or should I better go with a MySQL query, 1. in terms of coverage, and 2. from a performance point of view? I filled in some values already:
            "company_uri"=>SHOP_URI."#company_data", // TODO
            "stock_level"=>number_format(max($product->product_in_stock, 0), 2, ".", ""),
            "valid_through"=>$product->product_available_date, // TODO
            "product_image_uri"=>"", // TODO
            "product_thumbnail_uri"=>"", // TODO
            "manufacturer_uri"=>"", // TODO
            "prefixes"=>array("ns_prefix"=>"self", "ns_uri"=>SHOP_URI."#"), // TODO
            "uom"=>array("weight"=>$product->product_weight_uom, "lwh"=>$product->product_lwh_uom),
            "features"=>array(), // TODO
            "price"=>$product->product_price, // TODO
            "currency"=>$product->product_currency, // TODO
            "price_quantity_start"=>"", // TODO
            "price_quantity_end"=>"", // TODO
            "business_function"=>"", // TODO
            "eligible_regions"=>array(), // TODO

Once I know these things I can finalize the extension and provide a new release compatible with VM2 and Joomla 2.5!
Thanks in advance for your help.

Best wishes,