VirtueMart Forum

VirtueMart 2 + 3 + 4 => Installation, Migration & Upgrade => Topic started by: Naturt on March 23, 2015, 12:54:28 PM

Title: I want to change VM 2.6.17 to VM newest version (VM 3.x) and Joomla 2.x to 3.x
Post by: Naturt on March 23, 2015, 12:54:28 PM
Hi there! Sadly I did not update my system a long time -.-. But now I want to be updated, so I decide to start. I want to update vm first, then joomla.
I tried it from version to version. There is no problem until VM 2.6.17, no error messages during update. But then when I want to upgrade to 2.9.9.x, everything messed up. I also have an unique tmpl file to display products, and that have many errors too. (for example $product->product_price variable not working..). Can you help me to find out what is the right way to update to the newest VM version? Following the verions history is the right way?
Also the dates and version numbers a bit confusing for me here (http://dev.virtuemart.net/projects/virtuemart/files). For example: "com_virtuemart.3.0.3_extract_first.zip" - "2015.01.09. 17:44" OR "com_virtuemart.2.6.17_extract_first.zip" - "2015.03.09. 16:40" is the primary, or newer?

I don't understand how can it be to version 3.x is from january, and after that the 2.x version from march?
Title: Re: I want to change VM 2.6.17 to VM newest version (VM 3.x) and Joomla 2.x to 3.x
Post by: GJC Web Design on March 23, 2015, 16:37:40 PM
both VM2.6.x and VM3.0.x are being maintained and are current..

it is up to you what one you use - VM3.0.x can be used on J2.5.28 and J3.3.x+

ignore VM2.9.x - they were test versions - don't use

You can go straight to VM2.6.16 or VM3.0.6.2  from what ever version you satrt with but template changes will be needed - u need to study the latest ones or just use the std ones.. get rid of your template/html/com_virtuemart and they should work
Title: Re: I want to change VM 2.6.17 to VM newest version (VM 3.x) and Joomla 2.x to 3.x
Post by: Naturt on March 24, 2015, 08:54:34 AM
Hi! Thank you for the answer. I did not know what is test version or not. Jenkinhill said somewhere on the forum, he got vm 2.9.9.x and easy to upgrade it.
So I will update straight as you said, and modify my templates and flyout pages. Where can I find the variables list? For example the $product_price is not working in VM 3.x.
Title: Re: I want to change VM 2.6.17 to VM newest version (VM 3.x) and Joomla 2.x to 3.x
Post by: GJC Web Design on March 24, 2015, 10:51:40 AM
QuoteWhere can I find the variables list?

echo the object out
Title: Re: I want to change VM 2.6.17 to VM newest version (VM 3.x) and Joomla 2.x to 3.x
Post by: Naturt on March 24, 2015, 14:16:56 PM
Hi. I tried it. My template is in "components\com_virtuemart\views\category\tmpl". var_dump or print_r causes blank page:


foreach ($this->products as $product) {
var_dump($product)
....


In the old code there was
echo round($product->product_price);
which is not working now (vm 3.0.6.2. and jml 3.4.1). somehow I figured it out, so now the working code is:
echo round($product->prices['salesPrice']);

But all of my custom fields are gone. How can I display it on this category page? The old code was:
1. if the product has custom fields:
if (!empty($product->customfieldsCart) {...
2. after that

foreach ($product->customfieldsCart as $field)
{ ...
echo "
<span style='margin-left:0px;'>".JText::_($field->custom_title).":</span>";
$data  = $field->custom_value;
$pieces = explode(";", $data);
echo "<span style='margin-left:5px;'>".$field->custom_field_desc."</span>";


The point is I cannot how to reach the customs title / description... Or which variable must I dump to know the fields.
Title: Re: I want to change VM 2.6.17 to VM newest version (VM 3.x) and Joomla 2.x to 3.x
Post by: GJC Web Design on March 24, 2015, 23:27:12 PM
var_dump($product);

or better

print 'Debug Line '.__LINE__.' $product <pre>'; print_r ($product); print "</pre><br />\n";
Title: Re: I want to change VM 2.6.17 to VM newest version (VM 3.x) and Joomla 2.x to 3.x
Post by: Naturt on March 25, 2015, 09:57:05 AM
That is not working, as I said "var_dump or print_r causes blank page". So var_dump($product) not working somehow -.-
There is no manual about the predefined variables for VM3 templating?
Title: Re: I want to change VM 2.6.17 to VM newest version (VM 3.x) and Joomla 2.x to 3.x
Post by: GJC Web Design on March 25, 2015, 10:00:41 AM
of course it works....

and none that I know of
Title: Re: I want to change VM 2.6.17 to VM newest version (VM 3.x) and Joomla 2.x to 3.x
Post by: Naturt on March 25, 2015, 10:19:40 AM
Ok I don't know, not working for me. Can somebody print_r the $product variable for me?
Title: Re: I want to change VM 2.6.17 to VM newest version (VM 3.x) and Joomla 2.x to 3.x
Post by: GJC Web Design on March 25, 2015, 10:33:53 AM
on a cat template custom fields are  $this->products[0]->customfieldsSorted
Title: Re: I want to change VM 2.6.17 to VM newest version (VM 3.x) and Joomla 2.x to 3.x
Post by: Milbo on March 31, 2015, 01:36:48 AM
Quote from: GJC Web Design on March 24, 2015, 23:27:12 PM
var_dump($product);

or better

print 'Debug Line '.__LINE__.' $product <pre>'; print_r ($product); print "</pre><br />\n";

ehrm what do you teach the people? Please use vmdebug('my product',$product); you can add as many parameters as you want like in js console.log.....
Title: Re: I want to change VM 2.6.17 to VM newest version (VM 3.x) and Joomla 2.x to 3.x
Post by: Milbo on March 31, 2015, 01:38:54 AM
Quote from: Naturt on March 24, 2015, 14:16:56 PM


In the old code there was
echo round($product->product_price);
which is not working now (vm 3.0.6.2. and jml 3.4.1). somehow I figured it out, so now the working code is:
echo round($product->prices['salesPrice']);
right.

Quote from: Naturt on March 24, 2015, 14:16:56 PM
But all of my custom fields are gone. How can I display it on this category page? The old code was:
1. if the product has custom fields:
if (!empty($product->customfieldsCart) {...
2. after that

foreach ($product->customfieldsCart as $field)
{ ...
echo "
[/quote]
The customfieldsCart do not exist that way anylonger, they are now in the variable keeping the other customs (there is just one variable now). Check the defaults.php of the productdetail view.