News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

wrong data in administrator/components/com_virtuemart/models/product.php:1069

Started by nrs, July 23, 2013, 09:06:11 AM

Previous topic - Next topic

nrs

(j2.5.11/vm2.0.22.a)
I had some strange data in my product link button (a sample url, and not the product link) , an realized that VM was trowing a lot of notices about "Trying to get property of non-object" tin the error log..

It seems this this is coursed in the function product.php:getProductSingle()

First I trace it to /administrator/components/com_virtuemart/models/product.php:1069 : $product->id = $ordering->id;    where $ordering->id was not defined
a little more tracing showed that $product->virtuemart_category_id did contain the sample URL and not an vm_is as expected..
this assignment comes from line 1022 : $product->virtuemart_category_id = $product->canonCatLink;
witch comes from line 990: $product->canonCatLink = $product->product_url;

But why this propagation $product->product_url  ->  $product->canonCatLink -> $product->virtuemart_category_id  ?

URL & ID is two different things..

Can anyone comment ?

russellmd

The same problem in my case, and the same question : why this assignment $product->virtuemart_category_id = $product->canonCatLink; ???

Milbo

Quote from: nrs on July 23, 2013, 09:06:11 AM
(j2.5.11/vm2.0.22.a)
I had some strange data in my product link button (a sample url, and not the product link)

What do you mean with "product link button"? Where is it? And which sample URL? Do you use the product URL in the product edit 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/

nrs

I think I can explain it myself now.

The primary confusion (at least from my side), is the intended usage of the product field "URL" ( virtuemart_products:product_url)

My first understanding of this field, was that it would appear in the product page, and give the customer a link to click on to go to the original manufacture webpage.
In my case my predecessor, that created the shop once, did some notes, that the link did point to a online sample of the product (this is my reason for calling it a "sample url")

I now realize that the URL is not to be embedded in the product page, but is used as a direct link, used instead of the "purchase this item" button (even that the reason for this is not clear to me, why anyone would do that.)

(Milbo, can you explain the intended usage of virtuemart_products:product_url ?)

My next confusion, was the fact that an 'id' variable (normally numeric)  did carry an string. well it does work (if the intended result is to replace the href in the purchase/add to cart) but the coding is not that clear.

I did resolve my issue, by resetting all product_url's, and create the sample url as an custom field.