I want to change VM 2.6.17 to VM newest version (VM 3.x) and Joomla 2.x to 3.x

Started by Naturt, March 23, 2015, 12:54:28 PM

Previous topic - Next topic

Naturt

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?

GJC Web Design

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
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

Naturt

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.

GJC Web Design

GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

Naturt

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.

GJC Web Design

var_dump($product);

or better

print 'Debug Line '.__LINE__.' $product <pre>'; print_r ($product); print "</pre><br />\n";
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

Naturt

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?

GJC Web Design

GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

Naturt

Ok I don't know, not working for me. Can somebody print_r the $product variable for me?

GJC Web Design

on a cat template custom fields are  $this->products[0]->customfieldsSorted
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

Milbo

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.....
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

Milbo

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.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/